Maybe someone else might find the script useful...
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ; Sticky v0.01 ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ; An extremely basic emulation of MS Windows built-in StickyKeys. ; ; * To get a feel for the real MS StickKeys, press the Shift key five times in ; a row. ; ; Description: Successive presses of modifier keys (shift, control, alt, and ; windows) causes a change their functionality, namely... ; - 1st press: Waits for another key to be pressed, then sends ; modifier along with last typed key. ; - 2nd press: Forces the key to be in a 'down' state until 3rd ; press. ; - 3rd press: changes the key back to a normal 'up' state. ; ; As per the AHK Help File for 'Send': ; "Note: Windows does not allow the simulation of the CTRL-ALT-DEL combination" ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ; set hotkey threads to 3... three states for sticky: single, hold on, hold off #MaxThreadsPerHotkey 3 ; sound settings playSound = True highFreq = 440 lowFreq = 220 duration = 60 ; key-related variables ;shiftName = Shift shiftKey = + shiftState = up shiftCount = 0 ;altName = Alt altKey = ! altState = up altCount = 0 ;ctrlName = Ctrl ctrlKey = ^ ctrlState = up ctrlCount = 0 ;winName = LWin winKey = # winState = up winCount = 0 modifiers = ; grab input and prepend modifiers as they are needed... Loop { Input, key, L1, {F1}{F2}{F3}{F4}{F5}{F6}{F7}{F8}{F9}{F10}{F11}{F12}{Left}{Right}{Up}{Down}{Home}{End}{PgUp}{PgDn}{Del}{Ins}{BS}{CapsLock}{NumLock}{PrintScreen}{Pause}{ScrollLock}{Enter}{AppsKey}{Sleep} ; continue if interrupted by hotkey if ErrorLevel = NewInput Continue ; if in EndKeys, format EndKey for 'Send' command else if InStr(ErrorLevel, "EndKey:") { StringReplace, key, ErrorLevel, EndKey: key = {%key%} } ; send modifiers and key Send, %modifiers%%key% ; remove modifier from list of modifiers if shiftCount = 1 { StringReplace, modifiers, modifiers, %shiftKey% shiftCount = 0 } if altCount = 1 { StringReplace, modifiers, modifiers, %altKey% altCount = 0 } if ctrlCount = 1 { StringReplace, modifiers, modifiers, %ctrlKey% ctrlCount = 0 } if winCount = 1 { StringReplace, modifiers, modifiers, %winKey% winCount = 0 } } Return ;------------------------------------------------------------------------------ ; StickyKey(keyValue, ByRef keyState, ByRef keyCount) ; Description: Keeps track of key states and plays system beeps as appropriate. ;------------------------------------------------------------------------------ StickyKey(keyValue, ByRef keyState, ByRef keyCount) { global modifiers, playSound, lowFreq, highFreq, duration keyCount++ ; sticky key in 'up' state if keyState = up { ; 1st press of sticky key: single modifier if keyCount = 1 { if playSound SoundBeep, %lowFreq%, %duration% ifnotinstring, modifiers, %keyValue% modifiers = %modifiers%%keyValue% } ; 2nd consecutive press of sticky key: enable hold state else if keyCount = 2 { if playSound { SoundBeep, %lowFreq%, %duration% SoundBeep, %highFreq%, %duration% } keyState = down } } ; 3rd press of sticky key: restore to normal mode else { if playSound { SoundBeep, %highFreq%, %duration% SoundBeep, %lowFreq%, %duration% } keyState = up ; remove from modifiers StringReplace, modifiers, modifiers, %keyValue% keyCount = 0 } Return } ;------------------------------------------------------------------------------ ; End Function StickyKey ;------------------------------------------------------------------------------ ;============================================================================== ; Hotkeys ;============================================================================== *$RShift:: *$LShift:: StickyKey(shiftKey, shiftState, shiftCount) Return *$RAlt:: *$LAlt:: StickyKey(altKey, altState, altCount) Return *$RCtrl:: *$LCtrl:: StickyKey(ctrlKey, ctrlState, ctrlCount) Return *$RWin:: *$LWin:: StickyKey(winKey, winState, winCount) Return ;============================================================================== ; End Hotkeys ;==============================================================================