#740811 xdotool seems not to be keyboard layout aware

Package:
xdotool
Source:
xdotool
Description:
simulate (generate) X11 keyboard/mouse input events
Submitter:
Michael Stummvoll
Date:
2015-01-21 14:27:05 UTC
Severity:
normal
#740811#5
Date:
2014-03-05 09:15:38 UTC
From:
To:
Hi,

I am using german QWERTZ layout, and when I do "xdotool type z", an "y" reaches
the application.

This is an xev output while testing xdotool. The first three entries
are showing the output when sending the keypress with "xdotool type y"
to xev, the other when directly pressing my y-key in xev.

As you can see, the same keycode reaches the application in both cases,
but they are mapped to different keysyms

MappingNotify event, serial 142, synthetic NO, window 0x0,
    request MappingKeyboard, first_keycode 8, count 248

KeyPress event, serial 142, synthetic NO, window 0x1c00001,
    root 0x260, subw 0x0, time 5916456, (76,126), root:(2000,132),
    state 0x10, keycode 52 (keysym 0x7a, z), same_screen YES,
    XLookupString gives 1 bytes: (7a) "z"
    XmbLookupString gives 1 bytes: (7a) "z"
    XFilterEvent returns: False

KeyRelease event, serial 143, synthetic NO, window 0x1c00001,
    root 0x260, subw 0x0, time 5916460, (76,126), root:(2000,132),
    state 0x10, keycode 52 (keysym 0x7a, z), same_screen YES,
    XLookupString gives 1 bytes: (7a) "z"
    XFilterEvent returns: False

MotionNotify event, serial 143, synthetic NO, window 0x1c00001,
    root 0x260, subw 0x0, time 5916687, (75,126), root:(1999,132),
    state 0x10, is_hint 0, same_screen YES

MappingNotify event, serial 143, synthetic NO, window 0x0,
    request MappingKeyboard, first_keycode 8, count 248

KeyPress event, serial 143, synthetic NO, window 0x1c00001,
    root 0x260, subw 0x0, time 5917590, (75,126), root:(1999,132),
    state 0x10, keycode 52 (keysym 0x79, y), same_screen YES,
    XLookupString gives 1 bytes: (79) "y"
    XmbLookupString gives 1 bytes: (79) "y"
    XFilterEvent returns: False

KeyRelease event, serial 144, synthetic NO, window 0x1c00001,
    root 0x260, subw 0x0, time 5917646, (75,126), root:(1999,132),
    state 0x10, keycode 52 (keysym 0x79, y), same_screen YES,
    XLookupString gives 1 bytes: (79) "y"
    XFilterEvent returns: False


Kind Regards,
Michael Stummvoll

#740811#10
Date:
2015-01-21 14:23:28 UTC
From:
To:
Hi,

I had a similar problem with a french (AZERTY) keyboard. A workaround is to issue a "setxkbmap fr" (for a french keyboard) in an terminal at least once in your X session before you use xdotool.

Yours,

J. Courant