After several test I found that it only works when ahk window is actived, any help?
Code I use to test:
Code: Select all
; joy test
Joy1::
{
MsgBox("The A button was pressed.")
}
Press A button of controller when on window of ahk: working
Code: Select all
; joy test
Joy1::
{
MsgBox("The A button was pressed.")
}
Still the sameboiler wrote: ↑04 Mar 2023, 08:36I am away from where I have my controller for a while, so I can't test it myself.
What happens when you run the Joystick Test Script from the script showcase in the documentation?
Thanks for that!neogna2 wrote: ↑04 Mar 2023, 08:50This is a known limitation. In Windows 10 and 11 with newer Xbox controllers (those released after the Xbox 360 controller) built in hotkeys like Joy1 and and GetKeyState reading of controller states only works when an AutoHotkey window has focus. To get them working when other windows are active you have to use XInput.
Here is the thread with the v2 version of XInput.ahk by Lexikos
viewtopic.php?f=83&t=106254
Edit: I should add that the share button is not detectable even with XInput, at least I found no way to do it. See the linked thread for discussion about that.
Users browsing this forum: No registered users and 43 guests