Press/hold X = X+Num6

Get help with using AutoHotkey (v2 or newer) and its commands and hotkeys
Pounc3r
Posts: 5
Joined: 06 Apr 2018, 04:05

Press/hold X = X+Num6

Post by Pounc3r » 28 Mar 2023, 03:37

I want both Z and Num6 to trigger when I hold down Z, any help is appreciated!

User avatar
mikeyww
Posts: 26883
Joined: 09 Sep 2014, 18:38

Re: Press/hold X = X+Num6

Post by mikeyww » 28 Mar 2023, 05:55

Code: Select all

#Requires AutoHotkey v2.0
~z::Numpad6

Pounc3r
Posts: 5
Joined: 06 Apr 2018, 04:05

Re: Press/hold X = X+Num6

Post by Pounc3r » 28 Mar 2023, 06:35

i figured out the logic sort of, just dont know how to do it
while x down, x down num6 down
on x up, x up num6 up

Pounc3r
Posts: 5
Joined: 06 Apr 2018, 04:05

Re: Press/hold X = X+Num6

Post by Pounc3r » 28 Mar 2023, 06:56

mikeyww wrote:
28 Mar 2023, 05:55

Code: Select all

#Requires AutoHotkey v2.0
~z::Numpad6
This works great! however, due to latency, i need to add about 30ms latency between when i press Z and Num6, i tried using sleep but i am not sure how to implement it in this fashion, can you help?

User avatar
mikeyww
Posts: 26883
Joined: 09 Sep 2014, 18:38

Re: Press/hold X = X+Num6

Post by mikeyww » 28 Mar 2023, 07:26

Code: Select all

#Requires AutoHotkey v2.0
$z::SetKeyDelay(30), SendEvent('z{NumPad6}')

Pounc3r
Posts: 5
Joined: 06 Apr 2018, 04:05

Re: Press/hold X = X+Num6

Post by Pounc3r » 28 Mar 2023, 07:42

ok the problem appears to be different...i need Num6 to be pressed once when i press or hold x

User avatar
mikeyww
Posts: 26883
Joined: 09 Sep 2014, 18:38

Re: Press/hold X = X+Num6

Post by mikeyww » 28 Mar 2023, 08:53

Test in Notepad.

Code: Select all

#Requires AutoHotkey v2.0
x::Send('{Numpad6}'), KeyWait(ThisHotkey)
Perhaps you get the idea here. You have a hotkey followed by ::. You can then use the :arrow: Send function to send any keys that you want.

Explained: Introduction and simple examples

Post Reply

Return to “Ask for Help (v2)”