无法使用 shift 键输入大写字母

Bor*_*ski 3 keyboard-shortcuts keyboard x11

在某些应用程序中,输入大写字母的作用类似于按 ESC 键。

再现:

  • 打开 LibreOffice 文档
  • 选择“另存为”(Unity 对话框)
  • 点击“创建文件夹”
  • 使用 shift 键输入大写字母(例如 Shift+A)

此时,新文件夹的创建被取消。(如 ESC 键被击中)

这种行为也存在于许多不同的程序和游戏中。

使用xev(按 Shift+d)分析情况

# xev
KeyPress event, serial 37, synthetic NO, window 0x4c00001,
    root 0x259, subw 0x0, time 994702, (15,-13), root:(987,197),
    state 0x10, keycode 50 (keysym 0xffe1, Shift_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

FocusOut event, serial 37, synthetic NO, window 0x4c00001,
    mode NotifyGrab, detail NotifyAncestor

FocusIn event, serial 37, synthetic NO, window 0x4c00001,
    mode NotifyUngrab, detail NotifyAncestor

KeymapNotify event, serial 37, synthetic NO, window 0x0,
    keys:  89  0   0   0   0   1   4   0   0   0   0   0   0   0   0   0   
           0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   

KeyPress event, serial 37, synthetic NO, window 0x4c00001,
    root 0x259, subw 0x0, time 994927, (15,-13), root:(987,197),
    state 0x11, keycode 40 (keysym 0x44, D), same_screen YES,
    XLookupString gives 1 bytes: (44) "D"
    XmbLookupString gives 1 bytes: (44) "D"
    XFilterEvent returns: False

KeyRelease event, serial 37, synthetic NO, window 0x4c00001,
    root 0x259, subw 0x0, time 995062, (15,-13), root:(987,197),
    state 0x11, keycode 40 (keysym 0x44, D), same_screen YES,
    XLookupString gives 1 bytes: (44) "D"
    XFilterEvent returns: False

KeyRelease event, serial 37, synthetic NO, window 0x4c00001,
    root 0x259, subw 0x0, time 995395, (15,-13), root:(987,197),
    state 0x11, keycode 50 (keysym 0xffe1, Shift_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False
Run Code Online (Sandbox Code Playgroud)

我认为,FocusOutFocusIn事件看起来很可疑。

Linux:Ubuntu 14.04 LTS 32 位,Unity

如何修复我的系统?欢迎任何想法或进一步的测试!

编辑:解决方案

我曾经将语言切换配置为 LeftShift+RightShift。这工作了多年,但在某些时候成为问题。无论如何,将 switch 配置为任何其他组合键解决了这个问题。

Gil*_*il' 5

FocusOut event, serial 37, synthetic NO, window 0x4c00001,
    mode NotifyGrab, detail NotifyAncestor

FocusIn event, serial 37, synthetic NO, window 0x4c00001,
    mode NotifyUngrab, detail NotifyAncestor
Run Code Online (Sandbox Code Playgroud)

什么,当你按下发生的AShift保持是一个被动的抢:有其中有超过这个组合键独家控制的X客户端,并按下组合键时,该事件只能转移到客户端,而不是xev或其他任何人。xev确实报告客户端在发生时抓住了组合键,并在结束时取消了它。

用外行的话来说,有一个程序被定义为Shift+A全局键绑定。这也可能是在那里你的意思是绑定一个错字Shift+ Alt+keyWin+ Shift+A的东西。

在命令行上操作 X 键和指针抓取中,我询问了如何找到抓取者是谁。我发现的最好方法只报告主动抓取,因此在查询信息时必须关闭密钥。

  1. 如果您还没有xdotool,请安装它。
  2. 运行sleep 1; xdotool key XF86LogGrabInfo
  3. 在一秒钟内,按住Shift+ A。保持直到xdotool运行。
  4. 查看 X 服务器日志以获取有关抓取的信息。X 服务器日志的典型位置是/var/log/Xorg.0.log0反映显示编号,即$DISPLAY:if $DISPLAYis:1:1.0then look at/var/log/Xorg.1.log中的编号等)。

以下是一些示例输出,显示我按下的键是锯鱼定义的键绑定:

[2292688.331] Active grab 0x41602244 (core) on device 'Virtual core keyboard' (3):
[2292688.331]       client pid 6745 sawfish 
[2292688.331]       at 2292687547 (from passive grab) (device thawed, state 3)
[2292688.331]         core event mask 0x3
[2292688.331]       passive grab type 2, detail 0x4e, activating key 78
[2292688.331]       owner-events false, kb 0 ptr 0, confine 0, cursor 0x0
[2292688.331] (II) End list of active device grabs
Run Code Online (Sandbox Code Playgroud)