관리 메뉴

ㄴrㅎnㅂrㄹrㄱi

Overriding or Disabling Hotkeys 본문

AUTOHOTKEY/레퍼런스

Overriding or Disabling Hotkeys

님투 2007. 11. 7. 23:49
반응형

Overriding or Disabling Hotkeys

You can disable all built-in Windows hotkeys except Win+L and Win+U by making the following change to the registry (should work on all OSes, reboot is probably required):
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer
NoWinKeys REG_DWORD 0x00000001 (1)

But read on if you want to do more than just disable them all. Note that most of the below examples are not supported on Windows Me/98/95.

Hotkeys owned by another application can be overridden or disabled simply by assigning them to an action in the script. The most common use for this feature is to change the hotkeys that are built into Windows itself. For example, if you wish Win+E (the shortcut key that launches Windows Explorer) to perform some other action, use this:

#e::
MsgBox, This hotkey is now owned by the script.
return

In this next example, the Win+R hotkey, which is used to open the RUN window, is completely disabled:

#r::return

Similarly, to disable both Windows keys, use this:

Lwin::return
Rwin::return

To disable or change an application's non-global hotkey (that is, a shortcut key that only works when that application is the active window), consider the following example which disables Control+P (Print) only for Notepad, leaving the key in effect for all other types of windows:

$^p::
SetTitleMatchMode, 2
IfWinActive, - Notepad, , Return
Send, ^p
return

In the above example, the $ prefix is needed so that the hotkey can "send itself" without activating itself (which would otherwise trigger a warning dialog about an infinite loop).

You can try out any of the above examples by copying them into a new text file such as "Override.ahk", then launching the file.

반응형

'AUTOHOTKEY > 레퍼런스' 카테고리의 다른 글

Hotstring  (0) 2007.11.07
Remap  (0) 2007.11.07
키/mouse button명 일람  (0) 2007.11.07
함수  (0) 2007.11.07
  (0) 2007.11.07
Comments