xf86PostKeyEvent and xf86PostKeyboardEvent

Andrew Zabolotny anpaza at mail.ru
Sun Mar 19 04:57:47 PST 2006


Hello!

I'm working here on a tablet driver for my wacom tablet, and while
doing that I've encountered a problem that I think is a bug in X11
core. Can someone enlighten me if I'm correct in my assumptions:

a) xf86PostKeyEvent won't work for devices with 0 valuators as seen
from xf86XInput.c - if num_valuators is 0, the loop never executes, and
no events are posted. This is actually a bug from my point of view,
since the analogous function xf86PostButtonEvent() checks for the case
when number of valuators is 0 and posts a proper event in any case.

b) xf86PostKeyboardEvent won't work for non-core devices, since it
doesn't fill xev->deviceid field, thus xf86eqProcessInputEvents () will
barf "LookupDeviceIntRec id=0x%x not found". I'm not sure why it
doesn't barf on core key events for the same reason, but it's obvious it
doesn't -- otherwise the regular keyboard driver wouldn't work. This
seems a bug as well, as seen from xf86PostKeyEvent there are two
missing lines in xf86PostKeyboardEvent:

xf86Info.lastEventTime = xev->time = GetTimeInMillis();
xev->deviceid = device->id;

besides, xE[2] could be just xE.

So it turns out that there is no way to generate non-core key events. I
would like to generate key events for tablet pad buttons, but since the
pad subdevice sometimes (e.g. on my tablet) has no valuators, the only
quirk that comes to my mind is to pretend that it has at least one
valuator, which would result in bogus events being emited.

BTW all said above refers to xorg 6.8.2 sources. If it is already fixed
in later versions, I'm sorry.

-- 
Greetings,
   Andrew



More information about the xorg mailing list