Ctrl+Backspace 插入一个小框而不是擦除

54 keyboard windows-7 keyboard-shortcuts notepad text-editing

当我按下Ctrl+ 时Backspace,有时会插入一个小方块,而不是整个单词被删除。

问题只发生在一些文本框中;在其他人中,快捷方式就像它应该的那样工作。

  • 开始菜单搜索框:有效

  • 记事本:工作

    在记事本中使用 Ctrl+Backspace 创建的小框

  • Notepad2:有效

  • 火狐:有效

我正在运行 Windows 7 x64。

Ror*_*ane 31

您可以通过使用AutoHotkey覆盖Ctrl+Backspace快捷方式来修复此行为。使用给定的文件名和扩展名将以下代码保存在纯文本文件中,然后使用 AutoHotkey 启动脚本:

FixCtrlBackspace.ahk

; how to write scripts: http://www.autohotkey.com/docs/

#IfWinActive ahk_class CabinetWClass ; File Explorer
    ^Backspace::
#IfWinActive ahk_class Notepad
    ^Backspace::
    Send ^+{Left}{Backspace}
#IfWinActive

; source and context: http://superuser.com/a/636973/124606

; relevant documentation links:
; writing hotkeys
; http://www.autohotkey.com/docs/Hotkeys.htm
; list of key codes (including Backspace)
; http://www.autohotkey.com/docs/KeyList.htm
; the #IfWinActive directive
; http://www.autohotkey.com/docs/commands/_IfWinActive.htm
; the Send command
; http://www.autohotkey.com/docs/commands/Send.htm
Run Code Online (Sandbox Code Playgroud)

您可能会发现从 GitHub 下载此脚本文件比自己创建文件并粘贴其内容更容易。

要在启动时自动启动此脚本,请将快捷方式添加到“开始”菜单中的“启动”文件夹中,如如何使程序在任何计算机上启动时运行中所述

脚本的基本思想是这样的:

; how to write scripts: http://www.autohotkey.com/docs/

#IfWinActive ahk_class CabinetWClass ; File Explorer
    ^Backspace::
#IfWinActive ahk_class Notepad
    ^Backspace::
    Send ^+{Left}{Backspace}
#IfWinActive

; source and context: http://superuser.com/a/636973/124606

; relevant documentation links:
; writing hotkeys
; http://www.autohotkey.com/docs/Hotkeys.htm
; list of key codes (including Backspace)
; http://www.autohotkey.com/docs/KeyList.htm
; the #IfWinActive directive
; http://www.autohotkey.com/docs/commands/_IfWinActive.htm
; the Send command
; http://www.autohotkey.com/docs/commands/Send.htm
Run Code Online (Sandbox Code Playgroud)

这会更改所有程序中的Ctrl+Backspace快捷方式,使其等效于按Ctrl+ Shift+ ?,选择上一个单词,然后按Backspace,将其删除。

这种选择并删除的解决方法虽然比键入一个框更好,但很脆弱。在已经使用Ctrl+ 的程序中不启用此快捷方式会更安全Backspace。这就是为什么我使用#IfWinActive将热键限制为仅我知道不支持该快捷方式的程序的原因。


Jar*_*ley 24

您看到的“框”就是所谓的控制字符。显示该框是因为,正如您所发现的,并非所有程序都处理 ctrl+backspace 来删除单词。

此控制字符是 128 个字符的ASCII 字符编码方案中的 33 个“非打印”字符之一。

  • 插入的字符是 127 - 删除字符。 (8认同)

djh*_*ell 17

在 MSDN博客上找到了这个...

Internet Explorer 组早期的一些人使用了 Brief 编辑器,该编辑器使用 Ctrl+Backspace 作为删除前一个单词的快捷键,他们非常喜欢它,以至于其中一个将其添加到自动完成处理程序中。因此,任何使用 SHAutoComplete 的编辑控件都将获得这个秘密的 Ctrl+Backspace 热键。

因此,听起来如果应用程序不使用 SHAutoComplete,它将不支持该功能,除非应用程序的作者明确添加了该功能。

PS control-delete 删除光标前的单词


th3*_*ude -2

并非所有应用程序都以相同的方式处理键盘快捷键。记事本似乎不处理这个组合键并以自己的方式处理它。