Author Topic: Is There Any Way To Rearrange Ts Events ?  (Read 1529 times)

iamasmith

  • Hero Member
  • *****
  • Posts: 1248
    • View Profile
Is There Any Way To Rearrange Ts Events ?
« on: January 14, 2005, 10:03:03 am »
Start up xev and hit one area of the test target and then another area of the test target (no dragging).

You get...

ButtonPressEvent, MotionNotify then ButtonReleaseEvent (obviously you need this for drag drop)

Rather than MotionNotify, ButtonPressEvent and ButtonReleaseEvent. (which is clearly desirable if you click a new area rather than drag)

I have ported pingus but the above ordering means that to select a pingu you must place your cursor in a spot and tap it when the pingu moves into that area because the ButtonPress is read before pingus realises the cursor has moved to the new position (over the pingu). (pingus gets cursor position only on MotionNotify and does NOT read it from the ButtonPress event structure )

I could patch the source but I was wondering if there's a way of temporarily rearranging the tslib event ordering so that MotionNotify is sent before the ButtonPressEvent.

If there's a good reason for this just tell me, I'll shut up and patch pingus.

Actually I can see the rationale behind this, after all your ButtonPress event is triggered by the touch screen generating a screen of co-ordinate data and the ButtonRelease is easy, just do it when you haven't had any new data. However, it should be easy to inject a ButtonPress after a co-ordinate 'hop' (i.e. clicking in a new area).

Event on ButtonPress rather than ButtonRelease is quite key to a fast action game like pingus.

- Andy
« Last Edit: January 14, 2005, 10:53:50 am by iamasmith »
OpenBSD 4.2 -current on full 4Gb of SL-C3000
Microdrive replaced with 4Gb SanDisk Extreme III card