Delay numlock

Get help with using AutoHotkey 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: 1040
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] [Download] GeSHi © Codebox Plus

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

Return to “Ask For Help”

Who is online

Users browsing this forum: Darkthornex, Hellbent, teadrinker, Wigi, zndr and 33 guests