当某些键与修饰键一起按下时,Xmodmap 会释放修饰键

当某些键与修饰键一起按下时,Xmodmap 会释放修饰键

我的计算机是 Ubuntu 18.04 LTS,带有 Linux 内核 5.0.0-23-generic。

我将Shift_R键重新映射到 a Mode_switch,

clear Shift
keycode  50 = Shift_L NoSymbol Shift_L
keycode  62 = Mode_switch NoSymbol Mode_switch
add Shift = Shift_L

以及一些Shift_L-Shift_R-<key>符号键,例如,

keycode  41 = i I I braceleft
keycode  53 = t T T grave

尽管其中一些效果很好,但另一些则不然。

例如,Shift_L-Shift_R-F(keycode 41) 打印{(正确),而Shift_L-Shift_R-X(keycode 53) 不打印任何内容。

所以我跑起来xev并按下Shift_L(键码50),Shift_R(键码62),X(键码53):

$ xev
KeyPress event, serial 37, synthetic NO, window 0x4000001,
    root 0x31c, subw 0x0, time 3610499, (1273,328), root:(1347,399),
    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 37, synthetic NO, window 0x4000001,
    root 0x31c, subw 0x0, time 3611315, (1273,328), root:(1347,399),
    state 0x1, keycode 62 (keysym 0xff7e, Mode_switch), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 37, synthetic NO, window 0x4000001,
    root 0x31c, subw 0x0, time 3612803, (1273,328), root:(1347,399),
    state 0x2001, keycode 50 (keysym 0xffe1, Shift_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 37, synthetic NO, window 0x4000001,
    root 0x31c, subw 0x0, time 3612803, (1273,328), root:(1347,399),
    state 0x2000, keycode 62 (keysym 0xff7e, Mode_switch), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

然后以相反的顺序释放:

KeyPress event, serial 37, synthetic NO, window 0x4000001,
    root 0x31c, subw 0x0, time 3614962, (1273,328), root:(1347,399),
    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 37, synthetic NO, window 0x4000001,
    root 0x31c, subw 0x0, time 3614962, (1273,328), root:(1347,399),
    state 0x1, keycode 62 (keysym 0xff7e, Mode_switch), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 37, synthetic NO, window 0x4000001,
    root 0x31c, subw 0x0, time 3616673, (1273,328), root:(1347,399),
    state 0x2001, keycode 62 (keysym 0xff7e, Mode_switch), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 37, synthetic NO, window 0x4000001,
    root 0x31c, subw 0x0, time 3617441, (1273,328), root:(1347,399),
    state 0x1, keycode 50 (keysym 0xffe1, Shift_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

Shift_LShift_R于何时释放Shift_L-Shift_R-X


xmodmap与默认值相比的所有更改是:

clear Shift
keycode  20 = minus question question underscore
keycode  24 = v V V V
keycode  25 = k K K K
keycode  26 = r R R R
keycode  27 = y Y Y Y
keycode  28 = q Q Q Q
keycode  29 = x X X X
keycode  30 = a A A A
keycode  31 = f F F F
keycode  32 = u U U U
keycode  33 = d D D D
keycode  34 = z Z Z Z
keycode  35 = dollar asciicircum asciicircum dollar
keycode  36 = slash Escape Escape slash
keycode  38 = h H H H
keycode  39 = j J J plus
keycode  40 = l L L bracketleft
keycode  41 = i I I braceleft
keycode  42 = semicolon apostrophe apostrophe parenleft
keycode  43 = colon quotedbl quotedbl parenright
keycode  44 = o O O braceright
keycode  45 = s S S bracketright
keycode  46 = e E E asterisk
keycode  47 = g G G G
keycode  48 = b B B B
keycode  49 = grave asciitilde asciitilde grave
keycode  51 = backslash bar bar backslash
keycode  52 = m M M M
keycode  53 = t T T grave
keycode  54 = n N N numbersign
keycode  55 = BackSpace backslash backslash BackSpace
keycode  56 = comma less less equal
keycode  57 = period greater greater minus
keycode  58 = Return underscore underscore Return
keycode  59 = c C C percent
keycode  60 = w W W asciitilde
keycode  61 = p P P P
keycode  62 = Mode_switch NoSymbol Mode_switch
add Shift = Shift_L

Well-keys(比如Shift_L-Shift_R-F变成{)是

  • 20、24、25、26、27、30、31、32、33、38、39、40、41、42、43、44、45、46、47、48、49、51、56、57、61。

错误的键(如Shift_L-Shift_R-XreleasesShift_LShift_R)是

  • 28、29、34、35、36、52、53、54、55、58、59、60。

这两种类型的密钥有何不同?

我该如何解决这种奇怪的行为?

相关内容