0

我想覆盖Windows 7 中各种程序中Ctrl+DelCtrl+的行为,Backspace默认情况下不会删除插入符号之前或之后的整个单词。Ctrl例如:当按下+时,记事本会显示一个看起来像盒子的字符(不确定是哪个字符)Backspace

在 Windows 7 中有解决此问题的方法吗?

我可以使用 Python、Autohotkey 或其他语言来覆盖这种行为吗?例如:找到光标/插入符号的位置并删除以下整个单词。

4

3 回答 3

1

删除插入符号之前或之后的整个单词

^Del::SendInput ^+{Right}{Delete}

^BackSpace::SendInput ^+{Left}{Delete}

这依赖于Ctrl++Shift←</kbd> selecting the word to the left of the caret, and Ctrl+Shift+→</kbd> selecting the word to the right of the caret.


如果您只想为特定程序启用它,您可以按照其他答案的建议进行操作,例如使用#IfWinActiveCoupled with ahk_class,如下所示:

#IfWinActive ahk_class Notepad
^Del::SendInput ^+{Right}{Delete}    
^BackSpace::SendInput ^+{Left}{Delete}
于 2012-06-10T09:07:31.533 回答
1

AutoHotkey 会做你想做的事。

#IfWinActive ahk_class Notepad
^Delete::SendInput something else
#IfWinActive

您可以找到带有 Au3 Window Spy 的 ahk_class,以及文档中的键列表。

于 2012-03-18T16:32:32.843 回答
0

我想这会给你一个开始......

^Del::
SetTitleMatchMode, 2
IfWinActive, Application title ; Use windows spy
{
    Send, xyz ; modified behaviour
}
Else
{
    Send, ^{Del} ; Original behaviour
}
Return
于 2012-03-18T16:30:20.190 回答