Here's hoping this may be useful for some of youse. I really like that location for the winkey, as many frequent combinations are quite easy to do with one hand, e.g. Win + e / r / x / low numbers.
More specifically I have included one example of a custom combination not usually used by Windows, i.e. when I press that key in combination with Capslock, it will shut down my computer.
Any feedback appreciated!
Code: Select all
$SC029:: ; downstroke!
if (WinActive("Cortana")) ; do nothing on downstroke if the start menu is active (usually this is the downstroke on the second press for double press intended to send the caret / tilde character)
return
Suspend ; on any other downstroke, these three lines prepare to read the key that is to be combined with the windows key as a modifier
Input, ZirkumCombo, I L1 T0.8, {CapsLock}, abcdefghijklmnopqrstuvwxyz1234567890
ErrLvl := ErrorLevel
return
$SC029 Up:: ; upstroke
Suspend Off
if (WinActive("Cortana")) { ; on the upstroke of a double press, close the start menu and send the key's original character
Send {Escape}
sleep 100
Send {SC029}
return
}
if (ErrLvl = "EndKey:CapsLock") { ; example of how to use non-alphanumeric keys for special combos - these also have to be listed in the 'Input' statement above
Send {Capslock} ; make sure Caps is not locked
SetCapsLockState Off ; same as above - to make doubly sure
Shutdown, 8 ; shutdown Windows - useful?
return
}
Send {LWin Down}%ZirkumCombo%{LWin Up} ; send the combination of Win + your chosen combo key to the OS
ZirkumCombo := "" ; empty the Input variable to allow a single press of the key to show the start menu
return