This is my autohotkey script and it works! I just want to add another part that does:…
- User
This is my autohotkey script and it works! I just want to add another part that does: When I press F1 it uses "q" every 200ms on repeat until I stop it #Requires AutoHotkey v2.0+ ; Require version 2.0 or newer
global isKey1Pressed := false ; Declare the status variable as global
Right:: { ; Change the hotkey to the right arrow key global isKey1Pressed ; Declare it as global within the hotkey scope isKey1Pressed := !isKey1Pressed ; Toggle the state if (isKey1Pressed) { SetTimer(SendKey1, 200) ; Start a timer that calls SendKey1 every 200 ms } else { SetTimer(SendKey1, 0) ; Stop the timer } }
SendKey1() { global isKey1Pressed ; Declare it as global within the function scope if (isKey1Pressed) { Send("{1}") ; Send the "1" key } }
- Assistant
You can add the functionality to use the "q" key every 200ms when you press F1, similar to how you're currently managing the "1" key with the Right arrow key. Below is the modified version of your script that includes this new feature.
In this implementation, pressing F1 will start sending "q", and pressing it again will stop it.