Xbutton1 Hold Keypress Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
masataka90

Xbutton1 Hold Keypress

22 Apr 2018, 08:08

hi, i wanted to make my xbutton1 to serve as keyboard press a (laptop keyboard is broken), but when I hold down the xbutton1 it only sends 1 instance of a. I wanted it to emulate a long press of keyboard press a.
Noesis
Posts: 301
Joined: 26 Apr 2014, 07:57

Re: Xbutton1 Hold Keypress  Topic is solved

23 Apr 2018, 01:02

This kind of emulates the keyboard's auto repeat, which is the aspect you're probably missing, the long press is likely already happening, just I can't tell since there isn't any code listed so I don't know what you've tried.

Code: Select all

XButton1::
Send {a down}
Sleep 500
While GetKeyState("XButton1","P")
{
	Send {a down}
	Sleep 50
}
Send {a up}
return
Play around with the Sleep amounts to get the timing how you want it.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Dobbythenerd1 and 333 guests