如何调试不起作用的键盘快捷键?

如何调试不起作用的键盘快捷键?

我在使用 XUbuntu 15.10。我注意到一些键盘快捷键无法到达我的应用程序(Sublime Text)。

Ctrl++对应用程序来说是不可见的,而例如++Alt却可以被正确识别。pCtrlAlti

我尝试用 来调试该问题xev,以下是我所看到的结果。

Ctrl++Alti我:

KeyPress event, serial 28, synthetic NO, window 0x3e00001,
    root 0xf9, subw 0x0, time 473258, (88,-10), root:(4850,512),
    state 0x0, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False

KeyPress event, serial 28, synthetic NO, window 0x3e00001,
    root 0xf9, subw 0x0, time 473378, (88,-10), root:(4850,512),
    state 0x4, keycode 64 (keysym 0xffe9, Alt_L), same_screen YES,
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False

KeyPress event, serial 28, synthetic NO, window 0x3e00001,
    root 0xf9, subw 0x0, time 473530, (88,-10), root:(4850,512),
    state 0xc, keycode 31 (keysym 0x69, i), same_screen YES,
    XLookupString gives 1 bytes: (09) " "
    XmbLookupString gives 1 bytes: (09) "       "
    XFilterEvent returns: False

KeyRelease event, serial 28, synthetic NO, window 0x3e00001,
    root 0xf9, subw 0x0, time 473602, (88,-10), root:(4850,512),
    state 0xc, keycode 31 (keysym 0x69, i), same_screen YES,
    XLookupString gives 1 bytes: (09) " "
    XFilterEvent returns: False

KeyRelease event, serial 28, synthetic NO, window 0x3e00001,
    root 0xf9, subw 0x0, time 473770, (88,-10), root:(4850,512),
    state 0xc, keycode 64 (keysym 0xffe9, Alt_L), same_screen YES,
    XLookupString gives 0 bytes:
    XFilterEvent returns: False

KeyRelease event, serial 28, synthetic NO, window 0x3e00001,
    root 0xf9, subw 0x0, time 473778, (88,-10), root:(4850,512),
    state 0x4, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
    XLookupString gives 0 bytes:
    XFilterEvent returns: False

Ctrl+Alt+P给出:

KeyPress event, serial 28, synthetic NO, window 0x3e00001,
    root 0xf9, subw 0x0, time 508401, (90,-17), root:(4852,505),
    state 0x0, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False

KeyPress event, serial 28, synthetic NO, window 0x3e00001,
    root 0xf9, subw 0x0, time 508497, (90,-17), root:(4852,505),
    state 0x4, keycode 64 (keysym 0xffe9, Alt_L), same_screen YES,
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False

KeymapNotify event, serial 28, synthetic NO, window 0x0,
    keys:  4294967289 0   0   0   32  0   0   0   1   0   0   0   0   0   0   0
           0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   

KeyRelease event, serial 28, synthetic NO, window 0x3e00001,
    root 0xf9, subw 0x0, time 508785, (90,-17), root:(4852,505),
    state 0xc, keycode 64 (keysym 0xffe9, Alt_L), same_screen YES,
    XLookupString gives 0 bytes:
    XFilterEvent returns: False

KeyRelease event, serial 28, synthetic NO, window 0x3e00001,
    root 0xf9, subw 0x0, time 508793, (90,-17), root:(4852,505),
    state 0x4, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
    XLookupString gives 0 bytes:
    XFilterEvent returns: False

没有KeyPressKeyReleasep,而是有一个神秘的KeymapNotify

我查看过,xfce4-settings-editor但没有发现匹配的键绑定。

我该怎么做?如何找到窃取此组合键的内容?

答案1

我以前也遇到过类似的问题。另一个应用程序已经在使用键盘快捷键,但它没有显示在键盘 > 应用程序快捷键中。因此,它无法重新分配。

在终端中,使用您最喜欢的文本编辑器打开以下内容:

gedit ~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml

我假设您想使用ctrl+ alt+ p。搜索带有 的行<Primary><Alt>p并将其删除。现在尝试为 Sublime Text 设置键盘快捷键。

相关内容