Two keyboards - modifier oddity

Tom Cowell t.a.cowell at gmail.com
Wed Mar 17 12:53:39 PDT 2010


Hello

I'd be grateful if anyone could help with this - perhaps someone can
give a quick answer before I go digging through different Xorg
versions.

I have two keyboards (humour me please!) and the modifiers are not
working as I would like.

If I hold down the shift key on one keyboard, and press keys on the
other keyboard, the shift modifier only takes effect on the second and
subsequent keystrokes.

Actually, it's a little odder than that: The modifier takes effect on
the first RELEASE on the second keyboard, as shown by the following
annotated output from xev:

#### I press the j key on the second keyboard
KeyPress event, serial 31, synthetic NO, window 0x1a00001,
    root 0x154, subw 0x0, time 12762035, (120,57), root:(974,82),
    state 0x10, keycode 44 (keysym 0x6a, j), same_screen YES,
    XLookupString gives 1 bytes: (6a) "j"
    XmbLookupString gives 1 bytes: (6a) "j"
    XFilterEvent returns: False

#### I release the j key on the second keyboard
KeyRelease event, serial 34, synthetic NO, window 0x1a00001,
    root 0x154, subw 0x0, time 12762107, (120,57), root:(974,82),
    state 0x10, keycode 44 (keysym 0x6a, j), same_screen YES,
    XLookupString gives 1 bytes: (6a) "j"
    XFilterEvent returns: False

#### I don't know the significance of these
MappingNotify event, serial 34, synthetic NO, window 0x0,
    request MappingKeyboard, first_keycode 8, count 248

MappingNotify event, serial 34, synthetic NO, window 0x0,
    request MappingKeyboard, first_keycode 8, count 247

#### I press (and hold) the shift key on the first keyboard
KeyPress event, serial 34, synthetic NO, window 0x1a00001,
    root 0x154, subw 0x0, time 12763800, (120,57), root:(974,82),
    state 0x10, keycode 50 (keysym 0xffe1, Shift_L), same_screen YES,
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False

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

MappingNotify event, serial 36, synthetic NO, window 0x0,
    request MappingKeyboard, first_keycode 8, count 247

#### I press the j key on the second keyboard, and I expect the shift
#### modifier to apply already but it doesn't
KeyPress event, serial 36, synthetic NO, window 0x1a00001,
    root 0x154, subw 0x0, time 12764571, (120,57), root:(974,82),
    state 0x10, keycode 44 (keysym 0x6a, j), same_screen YES,
    XLookupString gives 1 bytes: (6a) "j"
    XmbLookupString gives 1 bytes: (6a) "j"
    XFilterEvent returns: False

#### I release the j key, and now the shift modifier can be seen.
#### This is correct, I think, but not consistent with the previous event
KeyRelease event, serial 38, synthetic NO, window 0x1a00001,
    root 0x154, subw 0x0, time 12764651, (120,57), root:(974,82),
    state 0x11, keycode 44 (keysym 0x4a, J), same_screen YES,
    XLookupString gives 1 bytes: (4a) "J"
    XFilterEvent returns: False

#### I press the j key on the second keyboard, and now shift
#### works as expected
KeyPress event, serial 38, synthetic NO, window 0x1a00001,
    root 0x154, subw 0x0, time 12765459, (120,57), root:(974,82),
    state 0x11, keycode 44 (keysym 0x4a, J), same_screen YES,
    XLookupString gives 1 bytes: (4a) "J"
    XmbLookupString gives 1 bytes: (4a) "J"
    XFilterEvent returns: False

KeyRelease event, serial 38, synthetic NO, window 0x1a00001,
    root 0x154, subw 0x0, time 12765531, (120,57), root:(974,82),
    state 0x11, keycode 44 (keysym 0x4a, J), same_screen YES,
    XLookupString gives 1 bytes: (4a) "J"
    XFilterEvent returns: False


The behaviour is symmetrical - shift on keyboard 2 does the same thing
with keystrokes on keyboard 1. Using caps-lock instead of shift has
the same effect.

I'm running Open SUSE 11.2, and Xorg -version says "X.Org X Server
1.6.5". The two keyboards are configured in xorg.conf as shown below.
I also get the same behaviour with the Ubuntu netbook remix (X.Org X
Server1.6.0), which has no explicit keyboard configuration.

I did not get this behaviour with my previous OS Installation, which
was Open SUSE 10.3. Checking the XOrg version is on my list of things
to do.

Here are extracts from my xorg.conf:


Section "ServerFlags"
    Option  "AutoAddDevices" "false"
    Option  "AutoEnableDevices" "false"
    Option  "AllowEmptyInput" "false"
EndSection

Section "ServerLayout"
    Identifier     "seat1"
    Screen      0  "Screen1" 0 0
    InputDevice    "Mouse1" "CorePointer"
    InputDevice    "Keyboard1" "CoreKeyboard"
    InputDevice    "Keyboard2"
EndSection

Section "InputDevice"
    Identifier     "Keyboard1"
    Driver         "evdev"
    Option         "Device" "/dev/input/event3"
    Option         "XkbLayout" "gb"
EndSection

Section "InputDevice"
    Identifier     "Keyboard2"
    Driver         "evdev"
    Option         "Device" "/dev/input/event10"
EndSection

The whole xorg.conf is a bit more complicated, because it's a
multi-seat configuration but, as I said, I get the same thing on my
un-complicated netbook.

Final disclosure - I'm using the proprietary nvidia driver (but not on
the netbook).



Thanks in advance for any comments.

Tom Cowell



More information about the xorg mailing list