On Sat, Jan 16, 2010 at 10:20 AM, Enlightenment SVN <no-re...@enlightenment.org> wrote: > Log: > initial multi-touch support. ... > +struct _Evas_Event_Multi_Down /** Multi button press event */ > +{ > + int device; /**< Multi device number that went down (1 or more) */ > + int radius, radius_x, radius_y; > + struct { > + int x, y; > + } output; > + struct { > + Evas_Coord x, y; > + } canvas; > + void *data; > + Evas_Modifier *modifiers; > + Evas_Lock *locks; > + > + Evas_Button_Flags flags; > + unsigned int timestamp; > + Evas_Event_Flags event_flags; > + Evas_Device *dev; > +}; > + > +struct _Evas_Event_Multi_Up /** Multi button release event */ > +{ > + int device; /**< Multi button number that was raised (1 - 32) */ > + int radius, radius_x, radius_y; > + struct { > + int x, y; > + } output; > + struct { > + Evas_Coord x, y; > + } canvas; > + void *data; > + Evas_Modifier *modifiers; > + Evas_Lock *locks; > + > + Evas_Button_Flags flags; > + unsigned int timestamp; > + Evas_Event_Flags event_flags; > + Evas_Device *dev; > +}; > + > +struct _Evas_Event_Multi_Move /** Multi button down event */ > +{ > + int device; /**< Button pressed mask, Bits set to 1 are buttons currently > pressed (bit 0 = mouse button 1, bit 1 = mouse button 2 etc.) */ > + int radius, radius_x, radius_y; > + struct { > + struct { > + int x, y; > + } output; > + struct { > + Evas_Coord x, y; > + } canvas; > + } cur; > + void *data; > + Evas_Modifier *modifiers; > + Evas_Lock *locks; > + unsigned int timestamp; > + Evas_Event_Flags event_flags; > + Evas_Device *dev; > +};
I have no clue about multi touch and specially the low level reporting system, but what's good in this? I mean, there is no way to know number of touchs at that time. Okay, down-up are fine, since they might go at different time, but move should have a list of radius and positions, no? The way it is will make life hard to users, they will have to track and mix down-up events to know the big picture of how many fingers are there (it's just harder), but on move you're quite without relevant data. Again, I might be saying shit as I never saw low level reporting APIs and Xi2 (if related), but for development POV, this would be better: Multi_Touch_Base: unsigned int count; struct { int radius, radius_x, radius_y; Eina_Bool current; /* would flag activity in the event mode: down, up or move */ struct { int x, y; } output; struct { Evas_Coord x, y; } canvas; } points[]; Dow: <event-specific> Multi_Touch_Base common; Up: <event-specific> Multi_Touch_Base common; Move: <event-specific> Multi_Touch_Base cur, prev; Maybe this is even the way it is reported by the hardware, if not we can keep this state inside evas and avoid doing it in every app that wants to use multi-touch events. Some processing examples with these new structures: Double finger click: if (down->common.count == 2) Double finger click (considering some spacing): if ((down->common.count == 2) && (abs(down->common.points[0].x - down->common.points[1].x) > THRESHOLD) && (abs(down->common.points[0].y - down->common.points[1].y) > THRESHOLD)) pinch (iphone zooming): if ((move->common.count == 2) && ((down->cur.points[0].x - down->cur.points[1].x) > (down->prev.points[0].x - down->prev.points[1].x)) && ((down->cur.points[0].y - down->cur.points[1].y) > (down->prev.points[0].y - down->prev.points[1].y))) of course most real things will need some history and path-fitting to smooth values and detect gestures and ignore errors from measurements (that can go into another lib) -- Gustavo Sverzut Barbieri http://profusion.mobi embedded systems -------------------------------------- MSN: barbi...@gmail.com Skype: gsbarbieri Mobile: +55 (19) 9225-2202 ------------------------------------------------------------------------------ Throughout its 18-year history, RSA Conference consistently attracts the world's best and brightest in the field, creating opportunities for Conference attendees to learn about information security's most important issues through interactions with peers, luminaries and emerging and established companies. http://p.sf.net/sfu/rsaconf-dev2dev _______________________________________________ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel