does XkbSetMap affect XTestFakeKeyEvent?

Daiki Ueno ueno at unixuser.org
Wed Oct 24 03:10:40 PDT 2012


Hi,

I'm currently looking into Caribou (an on-screen keyboard software)[1]
and found that its keysym replacement logic does not work reliably[2].

That code basically does the following:

(1) assign a keysym to some unused keycode (like keycode 246, which
    XF86WLAN is assigned here) with XkbSetMap
(2) send key press event using XTestFakeKeyEvent to get the keysym typed

Is this supposed to work?  After (1), I could type the new keysym with
physical keyboard, but couldn't with XTestFakeKeyEvent.  If I change the
mapping with XChangeKeyboardMapping instead of XkbSetMap, it seems to
work with both physical and virtual keyboard.

I'm attaching a test program which changes keysym mapping on 'a' key
(keycode 38) on US keyboard and then send key press.

The original code can be found at:

http://git.gnome.org/browse/caribou/tree/libcaribou/xadapter.vala#n148
http://git.gnome.org/browse/at-spi2-core/tree/registryd/deviceeventcontroller.c#n286

Footnotes: 
[1]  http://live.gnome.org/Caribou
[2]  https://bugzilla.gnome.org/show_bug.cgi?id=673547

Regards,
-- 
Daiki Ueno
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: test-xkb-xtest.c
URL: <http://lists.x.org/archives/xorg/attachments/20121024/54789b53/attachment.c>


More information about the xorg mailing list