xev 可以检测到使用 xmodmap 进行的键重新映射,但其他应用程序却无法检测到?

xev 可以检测到使用 xmodmap 进行的键重新映射,但其他应用程序却无法检测到?

因此,当我购买了一台带有外国键盘的笔记本电脑(qwerty,但我大多数时候都使用 azerty)时,我没有专门用于 V 形 (<>) 的键。这很烦人,所以我想将我的右控制键(我从来不用)重新映射为 V 形键。我在 Ubuntu 上运行,所以我使用 xev 来检测哪个键在哪里,并按照说明执行了 xmodmap 操作这里它基本上是使用 xmodmap pke > .Xmodmap 在 .Xmodmap 文件中输出当前键盘布局,修改需要修改的键,保存并关闭文件,然后在 shell 中运行 xmodmap .Xmodmap。

我目前遇到的问题是它似乎无法被其他应用程序检测到。Xev 可以很好地检测到它,但我在使用 Firefox 时无法制作 V 形,例如,在 xev 之外的任何地方,该键仍可用作控制键。我试过谷歌搜索。这个问题看起来这正是我所寻找的,但缺乏答案是没有帮助的,而且我还没有遇到其他类似的问题,它似乎对每个人都很有用。

这是我按下右控制键时的 xev 输出,我将其包括在内以防它包含任何线索来说明为什么其他应用程序无法检测到它(我只包含了 KeyPress 事件以便于阅读,KeyRelease 事件看起来相同):

KeyPress event, serial 37, synthetic NO, window 0x2000001,
    root 0x49d, subw 0x0, time 1612206, (1243,666), root:(1355,775),
    state 0x2011, keycode 59 (keysym 0x3c, less), same_screen YES,
    XKeysymToKeycode returns keycode: 94
    XLookupString gives 1 bytes: (3c) "<"
    XmbLookupString gives 1 bytes: (3c) "<"
    XFilterEvent returns: False


KeyPress event, serial 37, synthetic NO, window 0x2000001,  # this is the left shift key
    root 0x49d, subw 0x0, time 1613158, (1243,666), root:(1355,775),
    state 0x2010, 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 0x2000001,
    root 0x49d, subw 0x0, time 1613404, (1243,666), root:(1355,775),
    state 0x2011, keycode 60 (keysym 0x3e, greater), same_screen YES,
    XKeysymToKeycode returns keycode: 94
    XLookupString gives 1 bytes: (3e) ">"
    XmbLookupString gives 1 bytes: (3e) ">"
    XFilterEvent returns: False

我还没有尝试自动化该行为,因为即使不自动化它也无法工作。有人知道为什么会发生这种情况以及如何解决它吗?谢谢您的时间。

编辑:我在 .Xmodmap 文件中修改的行是这样的:

keycode 105 = less greater less greater Control_R NoSymbol Control_R NoSymbol Control_R

(我在开头添加了 less greater)

该命令setxkbmap -query输出以下内容:

rules:      evdev
model:      pc105
layout:     us

相关内容