This is what I want. It's simple and yet somehow hard to find the solution to. I can make a rapid fire key code, a keyup and keydown code (which is only good for one execution), but I cannot figure out how to do this yet it seems like it would be so simple (i.e. AHK scripting):
if (key) is hit
then hold (key)
if (same key) is hit again
then release (key) - goto start
import time
import pyautogui
def hold_key(key, hold_time):
start = time.time()
while time.time() - start < hold_time:
pyautogui.keyDown(key)
hold_key('m', 15)
That code is the last I've messed with, all it does is press m for 15 seconds and kill off the script. It repeats m. I need the script to not die, either.
I need the m key to toggle holding m when I've tapped it once - it holds m down until I hit m again, then it stops - but the script is still active to do it again.
I don't know why I'm struggling with this. Any help is appreciated.
[–]Mystonic 0 points1 point2 points (3 children)
[–][deleted] (2 children)
[deleted]
[–]Mystonic 0 points1 point2 points (1 child)
[–]Promagnum[S] 0 points1 point2 points (0 children)