This example is rather contrived to showcase the practices that I use rather than the functions to which I apply them.
; ahk for example (what this is used for)
version = 20140506070810
author = alexx ; Tooltip can talk to me by name with %author%
#SingleInstance force ; try to prevent multipe instances of ahk
SetCapsLockState, off
SetNumLockState, off
CapsLock::Shift ; happy hacker style - turns Caps Lock into a shift key
; F6 breaks any active loops and tries to reload the AutoHotkey.ahk script
F6::
Reload
return
;Shift-F6 toggles Suspends AutoHotkey so that everything works as normal
+F6::
Suspend
return
; get the position and colour at the location of the mouse pointer
^!+?::
MouseGetPos, xpos, ypos
PixelGetColor, pixColor, %xpos%, %ypos%
Tooltip, %pixColor% %xpos%`,%ypos%, %xpos%, ( ypos - 20 ), 20
return
;
; global functions
;
blank_screen(){
SendMessage 0x112, 0xF170, 2, , Program Manager ; Monitor off
return
}
; "boss key" Windows-\ (Windows "backslash")
#\:: blank_screen()
If you hammer F6 it can still, sometimes end up with two or more instanced of ahk running