xedit:ctrl-下划线组合键麻木了

xedit:ctrl-下划线组合键麻木了

我有一台 Dell Latitude,最终在 cygwin-X 下使用 xedit(在 Linux 机器上也通过 ssh -X)。我需要 CTRL-_ 键来撤消编辑。该组合键可以被 xemacs 等识别(出于不同的目的)。据我所知,X 应用程序中的击键被接收为 ASCII 31(“单位分隔符”)。 xedit 期望什么代码,如果它不是 ASCII 31,我如何将其映射到期望的代码?

答案1

X应用程序解释事件, 不是击键。如果你运行xev,你可能会看到类似这样的东西(下划线是我键盘上的移位键):

KeyPress event, serial 34, synthetic NO, window 0xe00001,
    root 0x111, subw 0xe00002, time 1812782646, (61,35), root:(81,78),
    state 0x0, keycode 67 (keysym 0xffe3, Control_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyPress event, serial 34, synthetic NO, window 0xe00001,
    root 0x111, subw 0xe00002, time 1812783382, (61,35), root:(81,78),
    state 0x4, keycode 68 (keysym 0xffe2, Shift_R), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyPress event, serial 34, synthetic NO, window 0xe00001,
    root 0x111, subw 0xe00002, time 1812784150, (61,35), root:(81,78),
    state 0x5, keycode 35 (keysym 0x5f, underscore), same_screen YES,
    XLookupString gives 1 bytes: (1f) ""
    XmbLookupString gives 1 bytes: (1f) ""
    XFilterEvent returns: False

KeyRelease event, serial 34, synthetic NO, window 0xe00001,
    root 0x111, subw 0xe00002, time 1812784374, (61,35), root:(81,78),
    state 0x5, keycode 35 (keysym 0x5f, underscore), same_screen YES,
    XLookupString gives 1 bytes: (1f) ""
    XFilterEvent returns: False

KeyRelease event, serial 34, synthetic NO, window 0xe00001,
    root 0x111, subw 0xe00002, time 1812785271, (61,35), root:(81,78),
    state 0x5, keycode 68 (keysym 0xffe2, Shift_R), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 34, synthetic NO, window 0xe00001,
    root 0x111, subw 0xe00002, time 1812785335, (61,35), root:(81,78),
    state 0x4, keycode 67 (keysym 0xffe3, Control_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

xedit使用 X 工具包翻译将这些事件转换为操作的资源,例如,使用默认资源设置编译成TextTr.c:

":c<Key>_:"     "undo()\n"

因此(除非您覆盖默认资源),它只是控制修饰符加上下划线(无论您的键盘如何生成它)。

xedit无法识别类似的 ASCII^_

相关内容