In xi2 sample program (in MPX), XI_DeviceValuator event was changed to ButtonPress ! Is that right?

Peter Hutterer peter.hutterer at who-t.net
Mon May 18 18:51:13 PDT 2009


On Mon, May 18, 2009 at 11:22:02PM +0900, 박성진 wrote:
>    Hello. I'm implementing multitouch application using MPX and gtk-mpx.
> 
>    First of all, plz don't make me shy for my poor English! :)
> 
> 
>    For testing MPX, 'xi2' sample application which was copied from Peter
>    Hurterer's blog was used.

I really recommend using the xi2 branch instead of git master. not quite
sure what test program you're referring to, but the best example right now
is the xi2 branch on git://people.freedesktop.org/~whot/xinput.git

>    During the testing, I realized that two button press/release events was
>    made per one button press/release.

What devices did you register for events? if you registered a master device
and a slave device for button presses you will get two events with the same
data. Only the deviceid is different. This would be correct behaviour.

>    The type of button press/release was 70/71
>    (DeviceButtonPress/DeviceButtonRelease).
> 
>    And I realized that the second button press event was made from
>    DeviceValuator (= 67 in decimal).
> 
> 
>    Is this a normal situation?

Device valuators should be packed into the XEvent axis_data[] by Xlib, though
this only works for the first 6 valuators. if for some reason you get more
you'll get two events IIRC. I doubt that's the case though, my guess is
you're listening for events from all devices instead of just from master
devices.

Cheers,
  Peter

>    In the specification document in xfree86.org (Xinput Extension event
>    protocol document), 'DeviceValuator' event will be followed by
>    DeviceKeyPress/Release, DeviceMotionNotify, DeviceButtonPress/Release
>    and so on.
> 
> 
>    But in my project, buttonpress/release(70, 71 in decimal) event should
>    be once.
> 
>    I modified libXi not to translate XI_DeviceValuator event to
>    DeviceButton Press or DeviceButtonRelease.
> 
>    It was successful, but I know it wasn't a good way.
> 
> 
>    Please let me know, which part of x window system do I have to modify
>    for an xi2 application to receive a button press/release event per on
>    click!
> 
>    Why buttonpress/release event was made twice in a xi2 sample
>    application ?



More information about the xorg-devel mailing list