autohotkey_recipes
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| autohotkey_recipes [2026/03/19 15:23] – tkbletsc | autohotkey_recipes [2026/03/19 15:23] (current) – tkbletsc | ||
|---|---|---|---|
| Line 33: | Line 33: | ||
| !`::Send +#{Right} | !`::Send +#{Right} | ||
| + | </ | ||
| + | |||
| + | ===== Capslock on a timer ===== | ||
| + | < | ||
| + | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | ||
| + | ; --- CapsLock hold-to-enable, | ||
| + | |||
| + | CapsLock:: | ||
| + | capsHoldTime := 500 ; ms required to enable | ||
| + | |||
| + | ; If already ON → turn OFF immediately | ||
| + | if GetKeyState(" | ||
| + | SetCapsLockState, | ||
| + | SoundBeep, 800, 50 ; disable chirp | ||
| + | SoundBeep, 600, 50 | ||
| + | return | ||
| + | } | ||
| + | |||
| + | ; Start hold detection | ||
| + | SoundBeep, 600, 40 ; start-of-hold chirp | ||
| + | start := A_TickCount | ||
| + | |||
| + | while GetKeyState(" | ||
| + | if (A_TickCount - start >= capsHoldTime) { | ||
| + | SetCapsLockState, | ||
| + | SoundBeep, 600, 50 ; enable chirp | ||
| + | SoundBeep, 800, 50 | ||
| + | |||
| + | ; --- critical fix --- | ||
| + | KeyWait, CapsLock | ||
| + | |||
| + | return | ||
| + | } | ||
| + | Sleep, 10 | ||
| + | } | ||
| + | |||
| + | ; Released early → do nothing | ||
| + | return | ||
| </ | </ | ||
autohotkey_recipes.txt · Last modified: by tkbletsc
