Holding down a key gives me another key.

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
carophi
Posts: 13
Joined: 11 Nov 2022, 23:29

Holding down a key gives me another key.

Post by carophi » 03 Dec 2022, 00:41

I have the idea of holding down Space for 300ms and it would press Enter. But I do not know how to execute this idea, since I'm new to AHK.
Any help would be massively appreciated. :D

Rohwedder
Posts: 7647
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Holding down a key gives me another key.

Post by Rohwedder » 03 Dec 2022, 01:49

Hallo,
try:

Code: Select all

$Space::
KeyWait, Space, T.3
Send,% ErrorLevel?"{Enter}":"{Space}"
Return
Keywait sets the ErrorLevel to True if the waiting time .3 seconds has been exceeded.

carophi
Posts: 13
Joined: 11 Nov 2022, 23:29

Re: Holding down a key gives me another key.

Post by carophi » 11 Dec 2022, 01:48

Rohwedder wrote:
03 Dec 2022, 01:49
Hallo,
try:

Code: Select all

$Space::
KeyWait, Space, T.3
Send,% ErrorLevel?"{Enter}":"{Space}"
Return
Keywait sets the ErrorLevel to True if the waiting time .3 seconds has been exceeded.
Thank you! This helped me out a lot!

Post Reply

Return to “Ask for Help (v1)”