Admin mode?
Send, {Numpad1 Down}
Sleep, 10 ; pause 10ms to allow application to recognize the pressed state
Send, {Numpad1 Up}
; OBS Studio existing keys test (Studio v0.15.4, ahk v1.0.47.3)
; Start loop as auto-execute, loop until ScrollLock is pressed!!!
; Infinite loop!!! Simulates f3, f6 keypress at ~3 sec intervals
Loop {
Send, {F3 Down}
Sleep, 10 ; pause 10ms to allow application to recognize the pressed state
Send, {F3 Up}
Sleep, 3000
Send, {F6 Down}
Sleep, 10 ; pause 10ms to allow application to recognize the pressed state
Send, {F6 Up}
Sleep, 3000
}
;;;;;;;;;;;;;;;;;;;;;;;;;
; Pause timers and loops on ScrollLock press.
ScrollLock::
{
Pause
}
return
; OBS Studio non-existing keys test (Studio v0.15.4, ahk v1.0.47.3)
; Start loop as auto-execute, loop until ScrollLock is pressed!!!
; Infinite loop!!! Simulates f13, f16 keypress at ~3 sec intervals
Loop {
Send, {F13 Down}
Sleep, 10 ; pause 10ms to allow application to recognize the pressed state
Send, {F13 Up}
Sleep, 3000
Send, {F16 Down}
Sleep, 10 ; pause 10ms to allow application to recognize the pressed state
Send, {F16 Up}
Sleep, 3000
}
;;;;;;;;;;;;;;;;;;;;;;;;;
; Pause timers and loops on ScrollLock press.
ScrollLock::
{
Pause
}
return
; OBS Studio existing keys test, advanced scripting with timer loops (Studio v0.15.4, ahk v1.0.47.3)
; Start loop as auto-execute, loop until ScrollLock is pressed!!!
; Infinite loop!!! Simulates any statement check each 10ms
SetTimer, Label_1, 10 ; execute subrutine at label_1 each 10ms
; No more auto-executed strings (after first "return" word).
return
;;;;;;;;;;;;;;;;;;;;;;;;;
; my subroutine, checks the state of the f2 key and returns to the loop (timer at 10ms where it called from)
Label_1:
if GetKeyState("F2") ; or any 'your' event is true then go to Label_2
Gosub, Label_2
return
;;;;;;;;;;;;;;;;;;;;;;;;;
; my subroutine, trigger f3 key and returns to the loop (where it called from by f2 key press)
Label_2:
Sleep, 30 ; wait for 30ms before trigger next key
Send, {F3 Down}
Sleep, 10 ; pause 10ms to allow application to recognize the pressed state
Send, {F3 Up}
return
;;;;;;;;;;;;;;;;;;;;;;;;;
; Let's program the script suspend by ScrollLock press,
; (for easy script termination when important keys in use).
; Pause timers and loops too.
ScrollLock::
{
Suspend
Pause
}
return
;;;;;;;;;;;;;;;;;;;;;;;;;
; turn f5 to f6 key (f5 excluded, remap)
F5::F6
; trigger f7 key each time I press Right Mouse Button, while keep Right Mouse Button func.
~RButton::F7
; turn f8 into NumPad 1 (f8 excluded, remap)
F8::Numpad1
;;;;;;;;;;;;;;;;;;;;;;;;;
; we will loop until f4 is pressed,
F4::My_variable_to_exit_the_loop:=true
; Start loop by f1 key, triggers non existing f9, f10 keys in ~3 sec intervals
F1::
{
My_variable_to_exit_the_loop:=fasle ; we wait for F4
SetTimer, Label_3, 6000
; it is almost impossible to press key f1 and f4 so fast to rise cancel but for other logic it's normal, so you can insert "if->return" there too
Send, {F9 Down} ; execute at least once
Sleep, 10 ; pause 10ms to allow application to recognize the pressed state
Send, {F9 Up}
Sleep 3000 ; pause
SetTimer, Label_4, 6000
if My_variable_to_exit_the_loop
return ; there was delay after key f1 press, so f4 could cancel all the actions
Send, {F10 Down} ; execute at least once
Sleep, 10 ; pause 10ms to allow application to recognize the pressed state
Send, {F10 Up}
}
return
;;;;;;;;;;;;;;;;;;;;;;;;;
Label_3:
if My_variable_to_exit_the_loop
{
SetTimer, Label_3, Off ; I want to exit before any visible action taken
return
}
Send, {F9 Down}
Sleep, 10 ; pause 10ms to allow application to recognize the pressed state
Send, {F9 Up}
return
;;;;;;;;;;;;;;;;;;;;;;;;;
Label_4:
if My_variable_to_exit_the_loop
{
SetTimer, Label_4, Off ; I want to exit before any visible action taken
return
}
Send, {F10 Down}
Sleep, 10 ; pause 10ms to allow application to recognize the pressed state
Send, {F10 Up}
return
; OBS Studio non-existing keys test, advanced scripting with timer loops (Studio v0.15.4, ahk v1.0.47.3)
; Start loop as auto-execute, loop until ScrollLock is pressed!!!
; Infinite loop!!! Simulates any statement check each 10ms
SetTimer, Label_1, 10 ; execute subrutine at label_1 each 10ms
; No more auto-executed strings (after first "return" word).
return
;;;;;;;;;;;;;;;;;;;;;;;;;
; my subroutine, checks the state of the F3 key and returns to the loop (timer at 10ms where it called from)
Label_1:
if GetKeyState("F2") ; or any 'your' event is true then go to Label_2
Gosub, Label_2
return
;;;;;;;;;;;;;;;;;;;;;;;;;
; my subroutine, trigger non-existing f14 key and returns to the loop (where it called from by F2 key press)
Label_2:
Sleep, 30 ; wait for 30ms before trigger next key
Send, {F14 Down}
Sleep, 10 ; pause 10ms to allow application to recognize the pressed state
Send, {F14 Up}
return
;;;;;;;;;;;;;;;;;;;;;;;;;
; Let's program the script suspend by ScrollLock press,
; (for easy script termination when important keys in use).
; Pause timers and loops too.
ScrollLock::
{
Suspend
Pause
}
return
;;;;;;;;;;;;;;;;;;;;;;;;;
; turn f7 to non-existing on my keyboard f17 key (f7 excluded, remap)
F5::F17
; trigger non-existing on my keyboard f19 key each time I press Right Mouse Button, while keep Right Mouse Button func.
~RButton::F19
; turn f8 into NumPad 1 (f8 excluded, remap)
F8::Numpad1
;;;;;;;;;;;;;;;;;;;;;;;;;
; we will loop until f4 is pressed,
F4::My_variable_to_exit_the_loop:=true
; Start loop by f1 key, triggers non existing f13, f16 keys in ~3 sec intervals
F1::
{
My_variable_to_exit_the_loop:=fasle ; we wait for F4
SetTimer, Label_3, 6000
; it is almost impossible to press key f1 and f4 so fast to rise cancel but for other logic it's normal, so you can insert "if->return" there too
Send, {F13 Down} ; execute at least once
Sleep, 10 ; pause 10ms to allow application to recognize the pressed state
Send {F13 Up}
Sleep 3000 ; pause
SetTimer, Label_4, 6000
if My_variable_to_exit_the_loop
return ; there was delay after key f1 press, so f4 could cancel all the actions
Send, {F16 Down} ; execute at least once
Sleep, 10 ; pause 10ms to allow application to recognize the pressed state
Send, {F16 Up}
}
return
;;;;;;;;;;;;;;;;;;;;;;;;;
Label_3:
if My_variable_to_exit_the_loop
{
SetTimer, Label_3, Off ; I want to exit before any visible action taken
return
}
Send, {F13 Down}
Sleep, 10 ; pause 10ms to allow application to recognize the pressed state
Send, {F13 Up}
return
;;;;;;;;;;;;;;;;;;;;;;;;;
Label_4:
if My_variable_to_exit_the_loop
{
SetTimer, Label_4, Off ; I want to exit before any visible action taken
return
}
Send, {F16 Down}
Sleep, 10 ; pause 10ms to allow application to recognize the pressed state
Send, {F16 Up}
return
; OBS Studio non-existing keys test assignment (Studio v0.15.4, ahk v1.0.47.3)
; assign f1-f12 to non-existing on my keyboard f13-f24
F1::F13
F2::F14
F3::F15
F4::F16
F5::F17
F6::F18
F7::F19
F8::F20
F9::F21
F10::F22
F11::F23
F12::F24
;;;;;;;;;;;;;;;;;;;;;;;;;
; Let's program the script suspend by ScrollLock press,
; (for easy script termination when important keys in use).
ScrollLock::
{
Suspend
}