let’s say I want to automate a key hold h
for a specific duration, say 10 seconds.
my first thought was AutoHotKey
, and I tried it.
#Requires AutoHotkey v2.0
*s::
{
Send "{h down}"
Sleep 10000
Send "{h up}"
}
it works. but it taps the h
, not holding it.
and I look at the AutoHotKey forum, no one has any idea how to make it automatic, the best solution is to hold down the trigger, which defeat the purpose.
the I went to PyAutoGUI
, tried make a simple solution like
import pyautogui
import time
pyautogui.keyDown('h')
time.sleep(10)
pyautogui.keyUp('h')
somehow it only taps the h
, not holding it down.
please help me.
I tried AutoHotKey and PyAutoGUI, and they only can tap the key, not holding it.