Delay numlock

Get help with using AutoHotkey and its commands and hotkeys
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
Posts: 1219
Joined: 01 Oct 2013, 08:23
Location: Netherlands OS: Win7 x64 AHK: Unicode x32

Re: Delay numlock

21 Oct 2017, 04:03

Code: Select all

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

Return to “Ask For Help”

Who is online

Users browsing this forum: g0ss and 63 guests