strange uinput behavior

Jon Oberheide jon at oberheide.org
Thu Aug 21 16:22:20 PDT 2008


I'm observing some strange behavior with xorg and uinput.

Attached is a simple testcase that creates a uinput device and sends a
KEY_ENTER event.  In bad.c, when the device is only set up with a
KEY_ENTER key, the KEY_ENTER event is not observed in X.  However, in
good.c, if another supported key (say KEY_A) is added to the uinput
device as well, the sending of the KEY_ENTER event works just fine.

Both of the testcases work as expected outside of X in the terminal
which leads to me to believe something is getting munged in X's input
layer.

--- bad.c       2008-08-21 19:06:20.000000000 -0400
+++ good.c      2008-08-21 19:02:34.000000000 -0400
@@ -26,6 +26,7 @@
     dev.id.bustype = BUS_USB;
 
     ioctl(fd, UI_SET_EVBIT, EV_KEY);
+    ioctl(fd, UI_SET_KEYBIT, KEY_A);
     ioctl(fd, UI_SET_KEYBIT, KEY_ENTER);
     write(fd, &dev, sizeof(dev));

This strageness is observable on Ubuntu Intrepid (xorg
(1:7.4~1ubuntu1)), but works as expected on Ubuntu Hardy (xorg (1:7.3
+10ubuntu10)).

Regards,
Jon Oberheide

-- 
Jon Oberheide <jon at oberheide.org>
GnuPG Key: 1024D/F47C17FE
Fingerprint: B716 DA66 8173 6EDD 28F6  F184 5842 1C89 F47C 17FE
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bad.c
Type: text/x-csrc
Size: 1214 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg/attachments/20080821/5ee4a754/attachment.c>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: good.c
Type: text/x-csrc
Size: 1252 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg/attachments/20080821/5ee4a754/attachment-0001.c>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
URL: <http://lists.x.org/archives/xorg/attachments/20080821/5ee4a754/attachment.pgp>


More information about the xorg mailing list