VirtualBox

Opened 7 years ago

Last modified 7 years ago

#17051 new defect

Caps Lock key being remapped in Linux guest can cause the mapping to malfunction

Reported by: GeneralFailer Owned by:
Component: guest control Version: VirtualBox 5.1.26
Keywords: Cc:
Guest type: Linux Host type: Linux

Description

When Colemak is set as the default keyboard layout and Shift+Shift is mapped to serve as a Caps Lock (e.g. with "setxkbmap -option shift:both_capslock"), Shift+Shift also starts working as Backspace for a little while.

Attachments (1)

Test-2017-09-04-03-11-48.log (193.4 KB ) - added by GeneralFailer 7 years ago.

Download all attachments as: .zip

Change History (17)

by GeneralFailer, 7 years ago

comment:1 by GeneralFailer, 7 years ago

For a little while after enabling, I mean. This may be a Xorg bug I suppose, but this works fine on the host.

comment:2 by Michael Thayer, 7 years ago

To get an idea of whether this is a problem in the guest operating system or in VirtualBox you might try using xev in the guest and seeing whether the key events received by X.Org match the keys pressed on the keyboard.

comment:3 by GeneralFailer, 7 years ago

Xev detects Backspace events when I press Shift+Shift.

comment:4 by Michael Thayer, 7 years ago

Could you please paste the xev event here?

comment:5 by GeneralFailer, 7 years ago

The Backspace events are triggered by the subsequent input.

KeyPress event, serial 40, synthetic NO, window 0xe00001,
    root 0x281, subw 0x0, time 167310, (607,422), root:(607,451),
    state 0x0, keycode 50 (keysym 0xffe1, Shift_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyPress event, serial 40, synthetic NO, window 0xe00001,
    root 0x281, subw 0x0, time 167376, (607,422), root:(607,451),
    state 0x1, keycode 62 (keysym 0xffe5, Caps_Lock), same_screen YES,
    XKeysymToKeycode returns keycode: 50
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 40, synthetic NO, window 0xe00001,
    root 0x281, subw 0x0, time 167556, (607,422), root:(607,451),
    state 0x3, keycode 50 (keysym 0xffe5, Caps_Lock), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 40, synthetic NO, window 0xe00001,
    root 0x281, subw 0x0, time 167565, (607,422), root:(607,451),
    state 0x2, keycode 62 (keysym 0xffe2, Shift_R), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyPress event, serial 40, synthetic NO, window 0xe00001,
    root 0x281, subw 0x0, time 174880, (607,422), root:(607,451),
    state 0x2, keycode 66 (keysym 0xff08, BackSpace), same_screen YES,
    XKeysymToKeycode returns keycode: 22
    XLookupString gives 1 bytes: (08) "
    XmbLookupString gives 1 bytes: (08) "
    XFilterEvent returns: False

KeyRelease event, serial 40, synthetic NO, window 0xe00001,
    root 0x281, subw 0x0, time 174880, (607,422), root:(607,451),
    state 0x2, keycode 66 (keysym 0xff08, BackSpace), same_screen YES,
    XKeysymToKeycode returns keycode: 22
    XLookupString gives 1 bytes: (08) "
    XFilterEvent returns: False

KeyPress event, serial 40, synthetic NO, window 0xe00001,
    root 0x281, subw 0x0, time 174880, (607,422), root:(607,451),
    state 0x2, keycode 50 (keysym 0xffe1, Shift_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 40, synthetic NO, window 0xe00001,
    root 0x281, subw 0x0, time 174880, (607,422), root:(607,451),
    state 0x3, keycode 50 (keysym 0xffe5, Caps_Lock), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyPress event, serial 40, synthetic NO, window 0xe00001,
    root 0x281, subw 0x0, time 174880, (607,422), root:(607,451),
    state 0x2, keycode 38 (keysym 0x41, A), same_screen YES,
    XLookupString gives 1 bytes: (41) "A"
    XmbLookupString gives 1 bytes: (41) "A"
    XFilterEvent returns: False

KeyRelease event, serial 40, synthetic NO, window 0xe00001,
    root 0x281, subw 0x0, time 174978, (607,422), root:(607,451),
    state 0x2, keycode 38 (keysym 0x41, A), same_screen YES,
    XLookupString gives 1 bytes: (41) "A"
    XFilterEvent returns: False

comment:6 by Michael Thayer, 7 years ago

What does xev on the host show you? I assume you have the same layout there.

comment:7 by GeneralFailer, 7 years ago

Edited as I had different settings.

KeyRelease event, serial 34, synthetic NO, window 0x2c00001,
    root 0x49f, subw 0x0, time 69002149, (-375,137), root:(496,617),
    state 0x0, keycode 36 (keysym 0xff0d, Return), same_screen YES,
"   XLookupString gives 1 bytes: (0d) "
    XFilterEvent returns: False

KeyPress event, serial 37, synthetic NO, window 0x2c00001,
    root 0x49f, subw 0x0, time 69004925, (-375,137), root:(496,617),
    state 0x0, keycode 62 (keysym 0xffe2, Shift_R), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyPress event, serial 37, synthetic NO, window 0x2c00001,
    root 0x49f, subw 0x0, time 69004948, (-375,137), root:(496,617),
    state 0x1, keycode 50 (keysym 0xffe5, Caps_Lock), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 37, synthetic NO, window 0x2c00001,
    root 0x49f, subw 0x0, time 69005189, (-375,137), root:(496,617),
    state 0x3, keycode 62 (keysym 0xffe5, Caps_Lock), same_screen YES,
    XKeysymToKeycode returns keycode: 50
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 37, synthetic NO, window 0x2c00001,
    root 0x49f, subw 0x0, time 69005205, (-375,137), root:(496,617),
    state 0x2, keycode 50 (keysym 0xffe1, Shift_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyPress event, serial 37, synthetic NO, window 0x2c00001,
    root 0x49f, subw 0x0, time 69007004, (-375,137), root:(496,617),
    state 0x2, keycode 38 (keysym 0x41, A), same_screen YES,
    XLookupString gives 1 bytes: (41) "A"
    XmbLookupString gives 1 bytes: (41) "A"
    XFilterEvent returns: False

KeyRelease event, serial 37, synthetic NO, window 0x2c00001,
    root 0x49f, subw 0x0, time 69007060, (-375,137), root:(496,617),
    state 0x2, keycode 38 (keysym 0x41, A), same_screen YES,
    XLookupString gives 1 bytes: (41) "A"
    XFilterEvent returns: False
Last edited 7 years ago by GeneralFailer (previous) (diff)

comment:8 by Michael Thayer, 7 years ago

What were the different settings? Do they make a difference to what you see on the guest?

comment:9 by GeneralFailer, 7 years ago

Just an unmapped Shift+Shift.

comment:10 by GeneralFailer, 7 years ago

With Shift+Shift mapped on the host, pressing Shift+Shift in the guest inputs Backspace and doesn't affect any subsequent inputs.

KeyPress event, serial 41, synthetic NO, window 0x4000001,
    root 0x281, subw 0x0, time 274366, (743,643), root:(929,672),
    state 0x0, keycode 50 (keysym 0xffe1, Shift_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyPress event, serial 41, synthetic NO, window 0x4000001,
    root 0x281, subw 0x0, time 274374, (743,643), root:(929,672),
    state 0x1, keycode 66 (keysym 0xff08, BackSpace), same_screen YES,
    XKeysymToKeycode returns keycode: 22
    XLookupString gives 1 bytes: (08) "
    XmbLookupString gives 1 bytes: (08) "
    XFilterEvent returns: False

KeyRelease event, serial 41, synthetic NO, window 0x4000001,
    root 0x281, subw 0x0, time 274374, (743,643), root:(929,672),
    state 0x1, keycode 66 (keysym 0xff08, BackSpace), same_screen YES,
    XKeysymToKeycode returns keycode: 22
    XLookupString gives 1 bytes: (08) "
    XFilterEvent returns: False

KeyPress event, serial 41, synthetic NO, window 0x4000001,
    root 0x281, subw 0x0, time 274374, (743,643), root:(929,672),
    state 0x1, keycode 62 (keysym 0xffe5, Caps_Lock), same_screen YES,
    XKeysymToKeycode returns keycode: 50
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 41, synthetic NO, window 0x4000001,
    root 0x281, subw 0x0, time 274604, (743,643), root:(929,672),
    state 0x3, keycode 50 (keysym 0xffe5, Caps_Lock), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 41, synthetic NO, window 0x4000001,
    root 0x281, subw 0x0, time 274630, (743,643), root:(929,672),
    state 0x2, keycode 62 (keysym 0xffe2, Shift_R), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

EDIT:It does work as Caps Lock still.

Last edited 7 years ago by GeneralFailer (previous) (diff)

comment:11 by Michael Thayer, 7 years ago

I can well believe that this is a problem with our keyboard handling, which handles a number of legacy configurations. I'm afraid that this is not something I will be able to look at in the near future. If you or anyone feels like working on the code, the place to look in the source is src/VBox/Frontends/Common/VBoxKeyboard/keyboard.c. Any changes need to be triple tested by several people of course. If you do feel like doing fixes though, feel free to remove the two non-XKB code paths, as well as the code which does look-ups by keysym - lookup by keycode using XKB should be enough.

comment:12 by GeneralFailer, 7 years ago

Well, this definitely sucks. QEMU's Colemak support seems to be even worse somehow. Linux's Colemak support in general is shockingly lackluster IMO.

Last edited 7 years ago by GeneralFailer (previous) (diff)

comment:13 by Michael Thayer, 7 years ago

I think that you might be looking in the wrong place here: we have many things to work on and for us Colemak support is very low down the list (if you look through the bug tracker you will find many requests for things which are important to the requester but also low down our list). I am sure that there are people with the skills to investigate this problem and for whom Colemak support is important. Since this is clearly important to you, you are probably best investing time finding those people.

comment:14 by GeneralFailer, 7 years ago

I understood your motivation; I was just expressing my frustration.

comment:15 by Michael Thayer, 7 years ago

I understand that. What I said above though was meant as encouragement, not discouragement. Our keyboard code is something that any reasonably competent programmer should be able to understand, and we accept patches as long as the submitter does their work to keep the extra work for us as low as possible (and we are willing to take some time to guide programmers if we feel that they are serious about what they want to do). I am sure there must be programmers out there interested in Colemak support.

comment:16 by GeneralFailer, 7 years ago

Sure, I've already posted about this on Colemak forums.

Note: See TracTickets for help on using tickets.

© 2023 Oracle
ContactPrivacy policyTerms of Use