New to AHK and need help with my code

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Buergels
Posts: 1
Joined: 19 Jun 2021, 14:13

New to AHK and need help with my code

19 Jun 2021, 14:31

Thank's for the help in advance.
I bought 4 way hat switches with push, unfortunatly the push activates with every direction. Now i am trying a workaround with AHK.
I got to the point where the single switches are working but i can't use them simultaneously.
Also i have trouble with handing over key's into a function.

my ugly first try it does work but i can't press buttons simlutaneously.
Joystick.ahk
(10.33 KiB) Downloaded 6 times
Here i tried to write a fuction to make everything easier.
Joystick2.ahk
(1.22 KiB) Downloaded 3 times
Thanks for your help.
User avatar
mikeyww
Posts: 26885
Joined: 09 Sep 2014, 18:38

Re: New to AHK and need help with my code

19 Jun 2021, 15:02

I don't think you can actually use "%" in the label name itself, but you also would not need it. One example is below.

Code: Select all

3::press("1", "2", "3")
press(x, y, z)
{
 Send {%x% down}
 Send {%y% down}
 KeyWait, %z%
 Send {%y% up}
 Send {%x% up}
 SoundBeep, 1000
}
It might not work with a joystick button, but if needed, you can still do this with a timer with a static label name.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: RandomBoy and 247 guests