- NumLock activates the cursor keys or the remapped keypad keys (standard).
- NumpadDiv Alt/Ctrl/Shift/Win sticky keys in cyclic order. More than a second delay starts a cycle entering a further modifier. It activates cmd mode, where commands, like Ctrl-Alt-C or Win-R are edited (shown in a TrayTip) and executed by NumpadEnter.
- NumpadMult Tab
- NumpadSub BackSpace. In command mode deletes char then last modifier
- NumpadAdd select CapsLock mode: Capital letters or Small letters
- Other NumPad keys send characters chosen cyclically from assigned lists, when they are pressed repeatedly within one second. A longer delay or different key terminates the character entry cycle and starts a new one. In cmd mode (activated by NumpadDiv) characters are not sent to the foreground window, but the command gets updated before execution (by NumpadEnter).
If you need more symbols, the lists of the character cycles can be extended, or the NumpadAdd key could have a third mode: Symbols, where a second set of character-cycles gets activated.
#SingleInstance force Mods = ^!+# Numpad1::KeyBD("()[]1") Numpad2::KeyBD("ABC2@") Numpad3::KeyBD("DEF3#") Numpad4::KeyBD("GHI4$") Numpad5::KeyBD("JKL5%") Numpad6::KeyBD("MNO6^") Numpad7::KeyBD("PQRS7&") Numpad8::KeyBD("TUV8~") Numpad9::KeyBD("WXYZ9'") Numpad0::KeyBD("+-*/\0") NumpadDot::KeyBD(",.:;!?") NumpadDiv:: ; Cmd mode with Ctrl/Alt/Shift/Win sticky keys If (A_ThisHotKey = A_PriorHotKey and A_TimeSincePriorHotkey < 1000) { StringTrimRight Mod, Mod, 1 ModI++ ; index of next modifier, wrapped around IfGreater ModI,4, SetEnv ModI,1 } Else ModI = 1 ; first modifier from list StringMid m, Mods, ModI, 1 Mod = %Mod%%m% c = ; clear char ModTip(Mod,c) Return NumpadMult:: ; TAB (multi letter key name, no cycle) IfEqual Mod,, Send {Tab} Else { c = {TAB} ModTip(Mod,c) } Return NumpadSub:: ; BackSpace IfEqual Mod,, Send {BackSpace} Else { IfEqual c,, StringTrimRight Mod, Mod, 1 Else c = ModTip(Mod,c) } Return NumpadAdd:: ; ~CapsLock Caps:=!Caps TrayTip,,Caps = %Caps% Return $NumpadEnter:: ; Enter / Execute commnad IfEqual Mod,, Send {Enter} Else { Send %Mod%%c% Mod = ; Exit cmd mode TrayTip } Return KeyBD(list) { Static i ; index of the character in the list, to be sent Global Caps, Mod, c If (A_ThisHotKey = A_PriorHotKey and A_TimeSincePriorHotkey < 1000) { IfEqual Mod,,Send {BS} ; erase the char this key has inserted i++ ; index of next char, wrapped around IfGreater i,% StrLen(list), SetEnv i,1 } Else i = 1 ; at new key send first char from list StringMid c, list, i, 1 IfEqual Mod,, { IfEqual Caps,1, StringUpper c,c Else StringLower c,c SendRaw %c% ; send selected } Else { StringLower c,c ModTip(Mod,c) } } ModTip(s,c) { StringReplace s, s, ^, Ctrl-, All StringReplace s, s, !, Alt-, All StringReplace s, s, +, Shift-,All StringReplace s, s, #, Win-, All TrayTip,,Cmd = %s%%c% }See changes HotKeyIt proposed for better cell phone cmpatibility and easier use.
Edit 20050806: Added support for multiple modifiers, like Alt-Shift-Tab
Edit 20071023: Changed title
Edit 20090114: Added link to HotKeyIt's post