Holding Down 2 Buttons Script

Ask gaming related questions
donplittle2
Posts: 2
Joined: 21 Jan 2021, 12:50

Holding Down 2 Buttons Script

Post by donplittle2 » 21 Jan 2021, 13:04

Hello! I'm trying to make a script so that I when I press one button, being the x button, I would like two buttons to be pressed down simultaneously.

Code: Select all

Loop
{
KeyWait, x, D
Send, {x down}
Send, {Numpad3 down}
}
Return
[Mod edit: [code][/code] tags added.]

I've tried this simple code, but the thing is it doesn't seem to press down both the buttons simultaneously, and instead presses the two buttons rapidly, which I'm guessing is because of the loop. I've tried messing with a bit of the other codes like KeyWait and GetKeyState, but I'm not 100% sure how to use them efficiently, so I wanted to see I could receive some assistance with how to set this script up if it is possible.
(An example of what happens when I press down x ---> xx3x3x3x3x3x3x3x3xx3xx3xx3xx3xx3xx3)
Really what I'm looking for is how to mimic a sticky keys action of two keys with the press of a single button, being able to rid of the other function buttons from having to be double pressed. I'm not sure if that is possible on AutoHotkey, but I'd love to hear from someone if they know how.
Last edited by donplittle2 on 21 Jan 2021, 22:41, edited 1 time in total.
Rohwedder
Posts: 3980
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Holding Down 2 Buttons Script

Post by Rohwedder » 21 Jan 2021, 13:18

Hallo,
this x3x3x3x3x3x.. is Auto Repeat a driver/hardware feature.
If you don't like it:

Code: Select all

$x::
Send, {x Down}{Numpad3 Down}
KeyWait, x
Send, {x Up}{Numpad3 Up}
Return
Otherwise:

Code: Select all

~x::Numpad3
donplittle2
Posts: 2
Joined: 21 Jan 2021, 12:50

Re: Holding Down 2 Buttons Script

Post by donplittle2 » 21 Jan 2021, 13:42

Rohwedder wrote:
21 Jan 2021, 13:18

this x3x3x3x3x3x.. is Auto Repeat a driver/hardware feature.
When you say this is a driver/hardware feature, is there anyway to change this setting? Or is this setting unchangeable?
(Thank you for replying!)
Rohwedder
Posts: 3980
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Holding Down 2 Buttons Script

Post by Rohwedder » 22 Jan 2021, 03:07

I do not know how.
This is the first time for me that Auto Repeat is undesirable. Normally, missing Auto Repeat is criticized.
Post Reply

Return to “Gaming”