If a key is held, send [action] every [length of time]. Just send keypress if tapped.
-
- Posts: 10
- Joined: 10 Sep 2020, 11:59
If a key is held, send [action] every [length of time]. Just send keypress if tapped.
Looking for a way to code around my lack of arrow keys on a 60% keyboard. It has a function layer and fn + i/j/k/l sends the four arrow key directions. I'm looking for a way where if I press and hold any of those keys it will send the direction key every [variable length of time, maybe starting at every 0.5s]. I don't want it to interfere with regular typing though, so if I just hit the letters for a normal length of time I want it to register. So only activate if it's held for more than 0.25s maybe.
Re: If a key is held, send [action] every [length of time]. Just send keypress if tapped.
Hallo,
try:
You have to test whether the script can press the fn key
https://www.autohotkey.com/docs/v2/KeyList.htm#SpecialKeys
try:
Code: Select all
#Requires AutoHotkey v2.0
$Up::Send(Keywait("Up", "T.5")?"{Up}":"q"), Keywait("Up")
$Down::Send(Keywait("Down", "T.5")?"{Down}":"w"), Keywait("Down")
https://www.autohotkey.com/docs/v2/KeyList.htm#SpecialKeys