From: Sylvain <be...@be...> - 2012-05-05 10:24:07
|
Hi, On Sat, May 05, 2012 at 09:20:19AM +0300, John Tsiombikas wrote: > On Sat, May 05, 2012 at 12:27:09AM +0200, Sylvain wrote: > > At first glance Android will pass both multiple devices (touchscreen, > > touchpad, actual mouse - but only one of each) and multiple motions > > (multiple fingers). > > > > I guess we can make id = 100*id_device + id_finger as a work-around. > > If you must do that, pick a power of two so that the compiler can make > it into a shift. The translation in ARM assembly of the whole 128*X+Y > operation is a single instruction with the barrel shifter. > > but ... > > I'm not sure that it's necessary to identify which device is responsible > for each event. I feel that the aforementioned "id" is just a way > of disambiguating between multiple touches in the scope of a single > "gesture". At least that's what I got from reading the apple API > documentation for the iphone, assuming the same principles apply on > other multitouch systems. > > I might be completely wrong though. The point of tracking device is distinguish between the screen and the touchpad on this device: http://img2.generation-nt.com/sony-ericsson-xperia-play-03_0902A601C600809931.jpg http://developer.sonymobile.com/cws/devworld/downloads/download/xperiaplaytouchpadtutorial I don't own one myself so I can't say if it's crucial to handle events where the screen _and_ the touchpad are manipulated at the same time. I believe some games might be designed for 4-hands - though we may not want FreeGLUT to support such a complex use case. On Fri, May 04, 2012 at 09:46:19PM -0500, John F. Fay wrote: > I've not been following the discussion very closely, but the words > "as a work-around" set off alarm bells in my head. What would be the > way to do it right, and how difficult would it be to implement it correctly? At first glance the callback would require and additional parameter. Alternatively, pass a series of touch events in an array, rather than each "finger" separately (that's how one receive the events on Android). I'm not sure what the current multi-touch implementation supports. It seems this support for MPX/XInput2 is meant to deal with multiple mouses, but I have no idea whether it supports single multi-touch devices. Is Florian still around? Depending on whether it supports multi-touch devices (rather than multiple single-touch devices), - either we obsolete the current callback and replace it with a different one, - either we provide 2 different sets of call-backs, the current one for multiple pointer devices, and another one for multiple multi-touch devices, - alternatively the current callback can be kept as-is, and the "work-around" I mentioned can be a documented and stable way to extract the (rarely used) device id. -- Sylvain |