Delay numlock

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
UUalrus
Posts: 1
Joined: 20 Oct 2017, 23:20

Delay numlock

20 Oct 2017, 23:28

I want a code that doesn't do anything if numlock is pressed but if it is held down for like 5 seconds then it still can send numlock. Is there any way to write code for this, I tired using SetKeyDelay but had no success. Any help would be appreciated!
User avatar
Nextron
Posts: 1391
Joined: 01 Oct 2013, 08:23
Location: Netherlands OS: Win10 AHK: Unicode x32

Re: Delay numlock

21 Oct 2017, 04:03

Code: Select all

NumLock::
    Keywait, NumLock, T5
    if ErrorLevel  ;timeout -> button held
        SetNumLockstate,% GetKeyState("NumLock","T") ? "Off" : "On"
Return

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Descolada, jaka1, mikeyww, RussF and 318 guests