Bug 48770 - XTestFakeKeyEvent handles ISO_Level3_Latch inconsistently
Summary: XTestFakeKeyEvent handles ISO_Level3_Latch inconsistently
Status: RESOLVED MOVED
Alias: None
Product: xorg
Classification: Unclassified
Component: Server/Input/XKB (show other bugs)
Version: 7.7 (2012.06)
Hardware: Other All
: medium normal
Assignee: Xorg Project Team
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-04-16 06:37 UTC by Arthur Huillet
Modified: 2018-12-13 18:37 UTC (History)
3 users (show)

See Also:
i915 platform:
i915 features:


Attachments
xkbcomp -xkb output (65.51 KB, text/plain)
2012-06-15 00:41 UTC, Arthur Huillet
no flags Details

Description Arthur Huillet 2012-04-16 06:37:08 UTC
Hello,

I am using X.Org X Server 1.12.1 with the Xdummy wrapper script, and XTest to inject key events (this is as part of Xpra, a remote desktop project).
My keyboard layout is -layout fr -variant dvorak, and it uses a dead key on 8.

Using a real keyboard, pressing "dead key" + i yields ì and "dead key" + e yields è.
When using Xtest, ì works, but è appears as e.

Those are the relevant key bindings:

arthur@Gurney:~$ xmodmap -pke | egrep ' (17|31|93) '               
keycode  17 = ISO_Level3_Latch 8 ISO_Level3_Latch 8 grave
keycode  31 = i I i I igrave Igrave
keycode  93 = e E e E egrave Egrave

If I do (pseudo code):

xtest_fake_key(17, press)
xtest_fake_key(17, release)
xtest_fake_key(31, press)
xtest_fake_key(31, release)

I get ì.

If I do:

xtest_fake_key(17, press)
xtest_fake_key(17, release)
xtest_fake_key(93, press)
xtest_fake_key(93, release)

I get e instead of è.

xtest_fake_key() is a trivial wrapper for XTestFakeKeyEvent().

Keycodes that "work" with dead key: 24 26 31 32 38 39 60
Keycodes that do not work (produce keysym as it it wasn't modified): 30 42 48 57 93

Help appreciated. Thanks
Comment 1 Arthur Huillet 2012-04-16 07:22:15 UTC
Update: in the 8 calls to XTestFakeKeyEvent I've represented, it returns 1. So there seems to be no error returned from XTest.
Comment 2 Peter Hutterer 2012-06-11 22:09:08 UTC
(In reply to comment #1)
> Update: in the 8 calls to XTestFakeKeyEvent I've represented, it returns 1. So
> there seems to be no error returned from XTest.

heh, XTestFakeKeyEvent() is hardcoded to return 1, getting it to return anything else would be an achievement :)

how are you applying the keyboard layout? just running setxkbmap, I get egrave correctly through xtest, but on keycode 41 (see below)

(In reply to comment #0)
> arthur@Gurney:~$ xmodmap -pke | egrep ' (17|31|93) '               
> keycode  17 = ISO_Level3_Latch 8 ISO_Level3_Latch 8 grave
> keycode  31 = i I i I igrave Igrave
> keycode  93 = e E e E egrave Egrave

what kind of keyboard is this? my e in fr(dvorak) is on 41 and that's where it works - where is 93?
Comment 3 Arthur Huillet 2012-06-12 02:53:11 UTC
This is not a real keyboard, but the "keyboard" as configured by Xdummy. The actual keyboard layout is applied with calls to XChangeKeyboardMapping.

Section "InputDevice"
  Identifier "NoKeyboard"
  Option "CoreKeyboard" "true"
  Driver "void"
EndSection

Then, the commands that are run are the following:
$ setxkbmap -print
xkb_keymap {
        xkb_keycodes  { include "xfree86+aliases(qwerty)"       };
        xkb_types     { include "complete"      };
        xkb_compat    { include "complete"      };
        xkb_symbols   { include "pc+us+inet(pc105)"     };
        xkb_geometry  { include "pc(pc105)"     };
};

$ setxkbmap -rules evdev -model evdev -layout fr

$ setxkbmap -print
xkb_keymap {
        xkb_keycodes  { include "evdev+aliases(qwerty)" };
        xkb_types     { include "complete"      };
        xkb_compat    { include "complete"      };
        xkb_symbols   { include "pc+us+inet(evdev)"     };
        xkb_geometry  { include "pc(pc105)"     };
};

$ echo 'xkb_keymap {
        xkb_keycodes  { include "evdev+aliases(azerty)" };
        xkb_types     { include "complete"      };
        xkb_compat    { include "complete"      };
        xkb_symbols   { include "pc+fr(dvorak)+inet(evdev)"     };
        xkb_geometry  { include "pc(pc104)"     };
};' | xkbcomp - :2

And then XChangeKeyboardMapping() calls (only the relevant ones):

keycode 17 keysyms 65028L, 56L, 65028L, 56L, 96L]),
keycode 31 keysyms [105L, 73L, 105L, 73L, 236L, 204L]),
keycode 93 keysyms [101L, 69L, 101L, 69L, 232L, 200L]),

So - is there anything fundamentally incorrect with calling XChangeKeyboardMapping that way? I'm struggling to understand why X seems to ignore ISO_Level3 for my keycode 93.

Thanks
Comment 4 Peter Hutterer 2012-06-14 21:41:43 UTC
please attach the full map from xkbcomp -xkb :0. It could be key type issues here
Comment 5 Arthur Huillet 2012-06-15 00:41:26 UTC
Created attachment 63057 [details]
xkbcomp -xkb output

Output attached.
Comment 6 Daniel Stone 2012-11-02 00:18:44 UTC
Looking at the keymap there, there isn't actually anything assigned to 93 at all.  Is this actually the same keymap?
Comment 7 GitLab Migration User 2018-12-13 18:37:58 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/xorg/xserver/issues/284.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.