autohotkey_recipes
This is an old revision of the document!
Table of Contents
AutoHotKey does input macro programming and keyboard remapping in Windows. Key docs:
Recipes
Below are some useful recipes. See also: Using AutoHotKey to map keys on the Amtelco KB163 Unified Keyboard.
General
; General controls:
; Win+Esc to reload
; Win+Shift+Esc to exit
; Win+Ctrl+Esc to exit
#Escape::Reload
#+Escape::ExitApp
#^Escape::Edit
; Win+Backtick = Sleep
#`::DllCall("PowrProf\SetSuspendState", "int", 0, "int", 0, "int", 0)
; Win+M = toggle mute
#m::Send {Volume_Mute}
Auto mouse
; Auto mouse click:
; Win+Shift+I to auto click slowly
; Win+Shift+Ctrl+I to auto click quickly
; Win+I to auto stop
#+i::
SetTimer DoClick,500
SoundBeep 440,100
SoundBeep 660,100
return
#+^i::
SetTimer DoClick,50
SoundBeep 440,100
SoundBeep 660,100
SoundBeep 880,100
return
#i::
SetTimer DoClick,off
SoundBeep 660,100
SoundBeep 440,100
return
DoClick:
Send {LButton}
SoundBeep 200,10
return
FoxIt
The F5 for reload only works if the active file is the most recently opened. The F6 will switch to a MinTTY session and issue a "make again" command. Obviously this latter one is very specific.
; FoxIt keys: F5=reload and F6=latex build
#IfWinActive, ahk_class classFoxitReader
F5::Send ^w!f1
F6::
WinActivate ahk_class mintty
Send make again{enter}
WinActivate ahk_class classFoxitReader
return
#IfWinActive
Terraria
; Terraria: middle click is turbo left click #IfWinActive, ahk_class WindowsForms10.Window.8.app.0.ea7f4a_r16_ad1 MButton:: SetTimer DoClick,50 SoundBeep 880,50 return MButton up:: SetTimer DoClick,off SoundBeep 440,50 return #IfWinActive
Minecraft movement
; Ctrl+W = hold W (auto-run)
; Ctrl+LButton = hold LButton (auto-mine)
; Ctrl+RButton = hold RButton (auto-use)
; MButton = Sprint without double-tapping W
; Ctrl+MButton = hold MButton (auto-sprint)
#IfWinActive Minecraft ahk_class SunAwtFrame
^w::
Send {w down}
SoundBeep 500,100
return
^LButton::
Send {LButton down}
SoundBeep 500,100
return
^RButton::
Send {RButton down}
SoundBeep 500,100
return
MButton::
SetKeyDelay 55
Send {w down}{w up}{w down}
KeyWait MButton
Send {w up}
return
^MButton::
SetKeyDelay 55
Send {w down}{w up}{w down}
SoundBeep 500,100
return
#IfWinActive
autohotkey_recipes.1316621150.txt.gz · Last modified: by tkbletsc
