Script for pressing the same key to activate and deactivate a keypress Topic is solved
-
- Posts: 4
- Joined: 12 Apr 2022, 20:14
Script for pressing the same key to activate and deactivate a keypress
Hi, I'm trying to write a script that presses the S key down when I press backspace, and then releases the S key again when I press backspace agaim. Can someone please help me out?
Re: Script for pressing the same key to activate and deactivate a keypress
already answered here
https://www.autohotkey.com/board/topic/92188-break-a-loop-with-the-same-hotkey-its-pressed/
you can also do it with a while loop...
https://www.autohotkey.com/board/topic/92188-break-a-loop-with-the-same-hotkey-its-pressed/
you can also do it with a while loop...
Code: Select all
#MaxThreadsPerHotkey 2
Backspace::
Toggle := !Toggle
while Toggle
send s
return
-
- Posts: 4
- Joined: 12 Apr 2022, 20:14
Re: Script for pressing the same key to activate and deactivate a keypress
Hi, it doesn’t work. It just sends a lot of S keys. I would like it to be a key down, and upon pressing backspace again, key up.
Re: Script for pressing the same key to activate and deactivate a keypress Topic is solved
Code: Select all
Backspace::Send, % "{s " . ((Toggle := !Toggle) ? "down}" : "up}")
Who is online
Users browsing this forum: Bing [Bot], Playa 01 and 83 guests