Thoughts on Gestures & pointerList

Hi,


I saw mentioned at some point that it was considered for v2 that a ‘pointerList’ property could be added to pointer events.


My take on the question is that it is probably a bad idea and should be avoided if possible. The reason is that pointer events are really meant to work on a per-pointer basis, and if you need to access the state of multiple pointers when performing an action, using an abstraction seems the best way to me.


So, if some pointerList property had to be defined, I would prefer the property to be defined on the gesture objects instead (the positive point is that the position of pointers should only be kept in memory if they are actually part of a gesture, and it makes sure people use the good technique to handle gestures instead of manually fiddling with the per-pointer events).


However, I’m wondering if someone has a good reason why we would want pointerList to be accessible during all the single-pointer events.




<thoughts on gestures>


Since I used the MSGesture class from IE10 in one of my Windows 8 application recently, I must say I appreciate the facilities offered by the pre-computed properties like zoom, translation, rotation, inertia, etc. While this could be emulated in an acceptable way by listening to the pointer events at the document level, and using requestAnimationFrame to fire deduplicated GestureUpdated events, it’s actually very useful to get some get-go implementation of them.


Having that said, I’m not quite happy with the customization of the inertia and the fact I can’t add pointers from multiple types into a single gesture. If some specification is to define gestures, those shortcomings would probably need to be fixed.


I’m also wondering whether PointerEvents should not have a event.gestures property on pointer events that would return the list of all gestures that are hooked to the pointer. That could be useful in some context where you don’t want to add a pointer to a gesture if some other gesture already used it.


It’s probably also a good idea to add a ‘removePointer’ method to the gesture class for times when you don’t want to survey a pointer anymore.


</thougs on gestures>



Well, that’s all for this thread,

François

Received on Saturday, 13 April 2013 11:06:33 UTC