Code: Select all
Joy7 & Joy8:: Send, a
Code: Select all
Joy7 & Joy8:: Send, a
Yes, you’re trying to do something the documentation specifically says cannot be done:
Try creating a hotkey out of one of the buttons and check the state of the other using GetKeyState() to see if they’re pressed simultaneously.Hotkey Custom Combinations wrote:You can define a custom combination of two keys (except joystick buttons) by using " & " between them.
Code: Select all
Joy7::
GetKeyState, StateJoy8, Joy8
if (StateJoy8 = "D")
Send, a
Return
Joy8::
GetKeyState, StateJoy7, Joy7
if (StateJoy7 = "D")
Send, a
Return
I imagine it has to do with Windows’ ability to set up keyboard and mouse hooks in a way that it isn’t available for joystick buttons.
You’re welcome. By the way, since the GetKeyState command is deprecated, I suggest using the GetKeyState() function instead. It also eliminates the need for a temporary variable:
Code: Select all
Joy7::
if GetKeyState("Joy8")
Send, a
Return
Joy8::
if GetKeyState("Joy7")
Send, a
Return