Problem with RECORD, XInput(2) (and Xnee)

Henrik Sandklef hesa at sandklef.com
Mon May 24 15:36:38 PDT 2010


hi

  I am currently implementing support for XInput(2) devices in GNU Xnee, 
starting out with recording events.

  Xnee gets copies of events from the X Server (using the RECORD 
extension). It seems to be a problem in the RECORD extension regarding 
XI (or XI(2)), but I am not sure and it would be great to get feedback.

  I'll try to describe the problem as good as I can.

  ---

  When reading the XInput spec and the corresponding source code I 
understand it as one XI2 event is packed into two "normal" events. I 
started by implementing support for MotionEvents. This worked out rather 
well. Xnee receives four "normal" events and packs them into two XI2 
events (one from the master and one from the slave) and prints them out.

  When moving a pointer one pixel Xnee gets (event, detail):
    83 detail=0
    78 detail=9
    83 detail=0
    78 detail=13
  The event base for XI is 78, so it looks ok to me. The detail is set 
to the deviceid of the input device (when not 0).

  But when adding support for ButtonPress and ButtonRelease I don't get 
the 4 events for every press (or release). And the detail is always set 
to the number of the button pressed.

  When pressing a button Xnee gets (event, detail):
     81 detail=1
     81 detail=1
     82 detail=2
     82 detail=2

  When reading the source code of XInputWireToEvent 
(libXi/src/XExtInt.c) it looks as if the client side of XI does pack two 
events together to one.

   Since RECORD doesn't give Xnee normal client side events (as normal 
apps get from client libs) but rather "limited" copies directly from the 
server, it seems to be something odd in the RECORD extension (or with my 
code).

  Most of my tests are done using swinput (Linux module) with support 
for 8 input devices, but I've tested with real devices as well.



  Any input is welcome.

  regards, Henrik Sandklef





GNU Xnee version:
============================================
Latest on Branch: xinput2-support
   with some minor local modifications

My system:
============================================
name of display:    :2.0
version number:    11.0
vendor string:    The X.Org Foundation
vendor release number:    10706000
X.Org version: 1.7.6
maximum request size:  16777212 bytes
motion buffer size:  256
bitmap unit, bit order, padding:    32, LSBFirst, 32
image byte order:    LSBFirst
number of supported pixmap formats:    7
supported pixmap formats:
     depth 1, bits_per_pixel 1, scanline_pad 32
     depth 4, bits_per_pixel 8, scanline_pad 32
     depth 8, bits_per_pixel 8, scanline_pad 32
     depth 15, bits_per_pixel 16, scanline_pad 32
     depth 16, bits_per_pixel 16, scanline_pad 32
     depth 24, bits_per_pixel 32, scanline_pad 32
     depth 32, bits_per_pixel 32, scanline_pad 32
keycode range:    minimum 8, maximum 255
focus:  window 0x3200004, revert to Parent
number of extensions:    27
     BIG-REQUESTS
     Composite
     DAMAGE
     DOUBLE-BUFFER
     DPMS
     DRI2
     GLX
     Generic Event Extension
     MIT-SCREEN-SAVER
     MIT-SHM
     RANDR
     RECORD
     RENDER
     SECURITY
     SGI-GLX
     SHAPE
     SYNC
     X-Resource
     XC-MISC
     XFIXES
     XFree86-DGA
     XFree86-VidModeExtension
     XINERAMA
     XInputExtension
     XKEYBOARD
     XTEST
     XVideo




More information about the xorg mailing list