Refer to Virtual-Key Codes at MSDN for information necessary to extend the capabilities of this script.
note: present incarnation requires that all keys be depressed simultaneously
To test, open Notepad, simultaneously press and hold 'a', 'g', and 'i', then release.
#Persistent SetBatchLines, -1 SetFormat, Integer, Hex SetKeyDelay, -1 OnExit, HandleExit tid_this := DllCall( "GetCurrentThreadId" ) VarSetCapacity( state, 256 ) SetTimer, timer_MonitorKeyboard, 10 return HandleExit: DllCall( "AttachThreadInput", "uint", tid_this, "uint", tid_active_old, "int", false ) ExitApp timer_MonitorKeyboard: tid_active := DllCall( "GetWindowThreadProcessId", "uint", WinActive( "A" ), "uint", 0 ) if ( tid_active != tid_active_old ) { DllCall( "AttachThreadInput", "uint", tid_this, "uint", tid_active_old, "int", false ) DllCall( "AttachThreadInput", "uint", tid_this, "uint", tid_active, "int", true ) tid_active_old := tid_active } DllCall( "GetKeyboardState", "uint", &state ) state_text= loop, 254 if ( *( &state+A_Index ) & 0x80 ) state_text = %state_text%|%A_Index% ; 0x41, 0x44, 0x53, etc. are Virtual-Key codes ; must be listed in numerically increasing order if ( state_text = "|0x41|0x44|0x53" ) ; ads Send, {Backspace 3}about super dogs if ( state_text = "|0x41|0x47|0x49" ) ; agi Send, {Backspace 3}AHk is great! else if ( state_text = "|0x48|0x57" ) ; hw Send, {Backspace 2}Hello, World! else if ( state_text = "|0x4A|0x4B|0x4C" ) ; jkl Send, {Backspace 3}just kidding Latecia else if ( state_text = "|0x43|0x56|0x58|0x5A" ) ; cvxz Send, {Backspace 4}zoology xylophone category vertical return