You are not logged in.
Hi,
I am trying to remap keys using xmodmap, and am seing some really strange behavior when trying to have my right control key do something else than the print on the key says it should do. In some cases, pressing the right control key (Control_R) produces KeyPress / KeyRelease events for the left control key (Control_L). A minimal example follows.
sh-4.3$ file ~/.Xmodmap
/home/willard/.Xmodmap: cannot open `/home/willard/.Xmodmap' (No such file or directory)
sh-4.3$ xmodmap -pm > xmodmap-pm-0 ; xmodmap -pk > xmodmap-pk-0 # available on request
sh-4.3$ xevWith the xev window in keyboard focus, xev produces the following on standard output when the left control key is pressed and released.
KeyPress event, serial 32, synthetic NO, window 0x2600001,
root 0x16d, subw 0x0, time 18553030, (1051,568), root:(1053,585),
state 0x0, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False
KeyRelease event, serial 32, synthetic NO, window 0x2600001,
root 0x16d, subw 0x0, time 18553148, (1051,568), root:(1053,585),
state 0x4, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: FalseWith the xev window in keyboard focus, xev produces the following on standard output when the right control key is pressed and released.
KeyPress event, serial 32, synthetic NO, window 0x2600001,
root 0x16d, subw 0x0, time 18578526, (1053,595), root:(1055,612),
state 0x0, keycode 105 (keysym 0xffe4, Control_R), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False
KeyRelease event, serial 32, synthetic NO, window 0x2600001,
root 0x16d, subw 0x0, time 18578629, (1053,595), root:(1055,612),
state 0x4, keycode 105 (keysym 0xffe4, Control_R), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: FalseAll is normal.
Now we make these control keys cease to be control modifiers.
sh-4.3$ xmodmap -e "clear Control"
sh-4.3$ xmodmap -pm > xmodmap-pm-1 ; xmodmap -pk > xmodmap-pk-1
sh-4.3$ xevPressing and releasing the left control key has xev produce the following output.
KeyPress event, serial 44, synthetic NO, window 0x2600001,
root 0x16d, subw 0x0, time 18862143, (1051,475), root:(1053,492),
state 0x0, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False
KeyRelease event, serial 44, synthetic NO, window 0x2600001,
root 0x16d, subw 0x0, time 18862232, (1051,475), root:(1053,492),
state 0x0, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: FalsePressing and releasing the right control key has xev produce the following output.
KeyPress event, serial 32, synthetic NO, window 0x1e00001,
root 0x16d, subw 0x0, time 28870407, (1051,648), root:(1053,665),
state 0x0, keycode 105 (keysym 0xffe4, Control_R), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False
KeyRelease event, serial 32, synthetic NO, window 0x1e00001,
root 0x16d, subw 0x0, time 28870511, (1051,648), root:(1053,665),
state 0x0, keycode 105 (keysym 0xffe4, Control_R), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: FalseSo far, so good.
Now, here is where things get strange.
sh-4.3$ xmodmap -e "add Control = Control_L"
sh-4.3$ xmodmap -pm > xmodmap-pm-2 ; xmodmap -pk > xmodmap-pk-2
sh-4.3$ xevPressing and releasing the left control key makes xev produce the following output.
KeyPress event, serial 52, synthetic NO, window 0x2600001,
root 0x16d, subw 0x0, time 19215501, (1045,504), root:(1047,521),
state 0x0, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False
KeyRelease event, serial 52, synthetic NO, window 0x2600001,
root 0x16d, subw 0x0, time 19215599, (1045,504), root:(1047,521),
state 0x4, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: FalsePressing and releasing again (and any number of times) makes xev produce the same output.
That's fine.
Now, pressing and releasing the right control key makes xev produce the following output.
KeyPress event, serial 32, synthetic NO, window 0x2600001,
root 0x16d, subw 0x0, time 25626884, (1050,337), root:(1052,354),
state 0x0, keycode 105 (keysym 0xffe4, Control_R), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False
KeyPress event, serial 32, synthetic NO, window 0x2600001,
root 0x16d, subw 0x0, time 25627022, (1050,337), root:(1052,354),
state 0x0, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False
KeyRelease event, serial 32, synthetic NO, window 0x2600001,
root 0x16d, subw 0x0, time 25627022, (1050,337), root:(1052,354),
state 0x4, keycode 105 (keysym 0xffe4, Control_R), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: FalseHmm? An extra event for the left control key got generated.
Pressing and releasing the right control key again (and any number of times) makes xev produce the following output.
KeyRelease event, serial 32, synthetic NO, window 0x2600001,
root 0x16d, subw 0x0, time 25693741, (1052,564), root:(1054,581),
state 0x4, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False
KeyPress event, serial 32, synthetic NO, window 0x2600001,
root 0x16d, subw 0x0, time 25693741, (1052,564), root:(1054,581),
state 0x0, keycode 105 (keysym 0xffe4, Control_R), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False
KeyPress event, serial 32, synthetic NO, window 0x2600001,
root 0x16d, subw 0x0, time 25693826, (1052,564), root:(1054,581),
state 0x0, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False
KeyRelease event, serial 32, synthetic NO, window 0x2600001,
root 0x16d, subw 0x0, time 25693826, (1052,564), root:(1054,581),
state 0x4, keycode 105 (keysym 0xffe4, Control_R), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: FalseTwo extra events now.
Now switching back to the left control key, pressing and releasing it has xev produce the following output.
KeyRelease event, serial 32, synthetic NO, window 0x2600001,
root 0x16d, subw 0x0, time 25843772, (1051,456), root:(1053,473),
state 0x4, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False
KeyPress event, serial 32, synthetic NO, window 0x2600001,
root 0x16d, subw 0x0, time 25843772, (1051,456), root:(1053,473),
state 0x0, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False
KeyRelease event, serial 32, synthetic NO, window 0x2600001,
root 0x16d, subw 0x0, time 25843889, (1051,456), root:(1053,473),
state 0x4, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: FalseOne rogue event for the left control key.
Pressing and releasing again (and any number of times) makes xev produce the following (normal) output.
KeyPress event, serial 32, synthetic NO, window 0x2600001,
root 0x16d, subw 0x0, time 25844800, (1051,456), root:(1053,473),
state 0x0, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False
KeyRelease event, serial 32, synthetic NO, window 0x2600001,
root 0x16d, subw 0x0, time 25844939, (1051,456), root:(1053,473),
state 0x4, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: FalseMaking the right control key a control modifier key again will make the control keys behave normally again.
sh-4.3$ xmodmap -e "add Control = Control_R"Can anyone explain to me what is going on, or how I can remove this strange attachment Control_R has to Control_L, so that I can remap my control keys to whatever I want without experiencing strange behavior?
In case it matters: I am running this in an Arch Linux chroot on Chrome OS (installed with crouton / chroagh) on a Samsung Chromebook 2. While this might be an issue with my setup, I suspect not, since I have had similar problems with my keyboard at my workplace, which is an old IBM keyboard with a trackpoint (I can find the exact model name if it matters) (I "solved" the problem there by remapping keys in the xkb files instead of using xmodmap, something I'd like to avoid now). Both keyboards have no Windows keys.
Thanks,
Willard.
Last edited by willardthor (2014-09-14 21:31:14)
Offline