-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPushToToggle.ahk
More file actions
35 lines (30 loc) · 766 Bytes
/
Copy pathPushToToggle.ahk
File metadata and controls
35 lines (30 loc) · 766 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
; PushToToggle.ahk
#Persistent
#SingleInstance Force
SendMode Input
pttActive := false
F9:: ; Toggle Push-to-Talk
pttActive := !pttActive
if (pttActive) {
Send, {F8 down} ; Hold F8
SetScrollLockState(true) ; Turn ON LED
} else {
Send, {F8 up} ; Release F8
SetScrollLockState(false) ; Turn OFF LED
}
return
F10:: ; Clean exit
if (pttActive) {
Send, {F8 up}
SetScrollLockState(false)
}
ExitApp
return
; --- Helper: Set Scroll Lock LED explicitly ---
SetScrollLockState(state) {
currentState := GetKeyState("ScrollLock", "T")
if (state && !currentState)
Send, {ScrollLock}
else if (!state && currentState)
Send, {ScrollLock}
}