Is it possible to make Ctrl+C as responsive as Ctrl+Break in the Windows 7 console?
There's no setting that I know of, but you can accomplish this with an AutoHotkey script.
The script
^c::
WinGetClass, WinClass, A
if(WinClass = "ConsoleWindowClass")
SendPlay ^{CtrlBreak}
else
SendPlay ^c
How it works
^c
specifies the key combination to modify: Ctrl + C (^
indicates Ctrl).WinGetClass, WinClass, A
stores the active window's title in the variableWinClass
.-
if(WinClass = "ConsoleWindowClass") ... else ...
checks ifWinClass
macthes the stringConsoleWindowClass
(the window class of the Windows 7 command prompt).If it does,
SendPlay ^{CtrlBreak}
simulates the key combination Ctrl + Break.-
Otherwise,
SendPlay ^c
simulates the key combination Ctrl + C.This way, other programs still behave as they should.
How to use
Download and install the latest version of AutoHotkey.
Save the above script as
break-on.ahk
, using your favorite text editor.Double-click the file to run the script.
If you wish, copy the script (or a link to it) in the
Startup
folder.