Shift+Ctrl+[Left|Right] 突出显示文本,然后键入,忽略键入的前两个字符

Shift+Ctrl+[Left|Right] 突出显示文本,然后键入,忽略键入的前两个字符

我正在使用 openSuse。它是本周工作的 IT 团队为我安装的。我通常使用 Shift+Ctrl+某个箭头键来突出显示文本,并且我习惯简单地键入以替换已突出显示的文本。

如果我用鼠标突出显示文本并开始输入,一切都会正常。如果我使用键盘组合突出显示文本,那么我键入的第一个字符将删除突出显示的文本,而第二个字符则不执行任何操作,然后我键入的其余字符将替换突出显示的文本。无论应用程序如何,此行为似乎都会发生。我在 Google chrome(虽然不是 URL 栏)、Firefox 和 Eclipse 文本编辑器中看到过它。

我不知道发生了什么,但这真的很烦人并且减慢了我在 Eclipse 中的速度。

更新:我在侏儒。我已经在 Open Office writer、Google Chrome、Firefox、Eclipse、Thunderbird 中看到了这种行为。我做到了不是在 Tomboy Notes 或 gedit 中查看它。

答案1

这也困扰我一段时间了。

发现使用左 Ctrl 而不是右 Ctrl(我一直在这样做,因为它更接近箭头键)可以消除这个问题。

我想知道为什么以及是否可以在配置中的某个地方更改它?我还使用 openSuse 和 Eclipse。

编辑:按照此处的说明使用 .Xmodmap 文件解决了这个问题: http://forums.opensuse.org/showthread.php/450727-How-to-change-or-disable-compose-key-in-OpenSuse-11-3

默认情况下,右 ctrl 是多键字符的组合键,因此出现此问题。

EDIT2:上面的修复不久前对我不起作用。找到了一种不同的方法来解决它,也使用 Xmodmap。这次我的主目录中的 .Xmodmap 文件只有一个活动行:

键码 105 = Control_R Control_R Control_R Control_R Control_R Control_R

以前,键 105 被映射为

Control_R 多键 Control_R 多键 Control_R 多键

这意味着按 Shift、Alt 或 Meta 与 Control_R 会使其成为 Multi_Key,从而导致此问题。

答案2

所以您会期望第一个和第二个字符覆盖所选文本,对吧?

打印什么xev
(从终端运行它,然后将鼠标移到窗口上,然后按
Ctrl Shift Left Left a b

对我来说,它就是这样做的。

按住Ctrl然后Shift...

    KeyPress event, serial 33, synthetic NO, window 0x4c00001,
        root 0x109, subw 0x4c00002, time 143718968, (47,65), root:(48,147),
        state 0x10, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
        XLookupString gives 0 bytes: 
        XmbLookupString gives 0 bytes: 
        XFilterEvent returns: False

    KeyPress event, serial 33, synthetic NO, window 0x4c00001,
        root 0x109, subw 0x4c00002, time 143719024, (47,65), root:(48,147),
        state 0x14, keycode 50 (keysym 0xffe1, Shift_L), same_screen YES,
        XLookupString gives 0 bytes: 
        XmbLookupString gives 0 bytes: 
        XFilterEvent returns: False

然后LeftLeft...

    KeyPress event, serial 33, synthetic NO, window 0x4c00001,
        root 0x109, subw 0x4c00002, time 143720176, (47,65), root:(48,147),
        state 0x15, keycode 113 (keysym 0xff51, Left), same_screen YES,
        XLookupString gives 0 bytes: 
        XmbLookupString gives 0 bytes: 
        XFilterEvent returns: False

    KeyRelease event, serial 33, synthetic NO, window 0x4c00001,
        root 0x109, subw 0x4c00002, time 143720280, (47,65), root:(48,147),
        state 0x15, keycode 113 (keysym 0xff51, Left), same_screen YES,
        XLookupString gives 0 bytes: 
        XFilterEvent returns: False

    KeyPress event, serial 33, synthetic NO, window 0x4c00001,
        root 0x109, subw 0x4c00002, time 143720952, (47,65), root:(48,147),
        state 0x15, keycode 113 (keysym 0xff51, Left), same_screen YES,
        XLookupString gives 0 bytes: 
        XmbLookupString gives 0 bytes: 
        XFilterEvent returns: False

    KeyRelease event, serial 33, synthetic NO, window 0x4c00001,
        root 0x109, subw 0x4c00002, time 143721040, (47,65), root:(48,147),
        state 0x15, keycode 113 (keysym 0xff51, Left), same_screen YES,
        XLookupString gives 0 bytes: 
        XFilterEvent returns: False

然后放手CtrlShift...

    KeyRelease event, serial 33, synthetic NO, window 0x4c00001,
        root 0x109, subw 0x4c00002, time 143723304, (47,65), root:(48,147),
        state 0x15, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
        XLookupString gives 0 bytes: 
        XFilterEvent returns: False

    KeyRelease event, serial 33, synthetic NO, window 0x4c00001,
        root 0x109, subw 0x4c00002, time 143723304, (47,65), root:(48,147),
        state 0x11, keycode 50 (keysym 0xffe1, Shift_L), same_screen YES,
        XLookupString gives 0 bytes: 
        XFilterEvent returns: False

然后按a,b

    KeyPress event, serial 33, synthetic NO, window 0x4c00001,
        root 0x109, subw 0x4c00002, time 143724576, (47,65), root:(48,147),
        state 0x10, keycode 38 (keysym 0x61, a), same_screen YES,
        XLookupString gives 1 bytes: (61) "a"
        XmbLookupString gives 1 bytes: (61) "a"
        XFilterEvent returns: False

    KeyRelease event, serial 33, synthetic NO, window 0x4c00001,
        root 0x109, subw 0x4c00002, time 143724672, (47,65), root:(48,147),
        state 0x10, keycode 38 (keysym 0x61, a), same_screen YES,
        XLookupString gives 1 bytes: (61) "a"
        XFilterEvent returns: False

    KeyPress event, serial 33, synthetic NO, window 0x4c00001,
        root 0x109, subw 0x4c00002, time 143725048, (47,65), root:(48,147),
        state 0x10, keycode 57 (keysym 0x62, b), same_screen YES,
        XLookupString gives 1 bytes: (62) "b"
        XmbLookupString gives 1 bytes: (62) "b"
        XFilterEvent returns: False

    KeyRelease event, serial 33, synthetic NO, window 0x4c00001,
        root 0x109, subw 0x4c00002, time 143725136, (47,65), root:(48,147),
        state 0x10, keycode 57 (keysym 0x62, b), same_screen YES,
        XLookupString gives 1 bytes: (62) "b"
        XFilterEvent returns: False

我会特别关注最后两个块,即释放时CtrlShift按下时a b看看是否有任何差异。

其他想法:

  • 你有粘滞键吗?
  • 您是否已Ctrl设置Shift更改键盘布局或语言?

相关内容