GetKeyState for XBox Elite controller stops working when window is not active
Posted: 05 Sep 2018, 13:01
I have had numerous reports of this from users of my scripts, and have no idea what is causing it.
THIS ONLY HAPPENS WITH XBOX ONE, ELITE OR ACCESSIBILITY CONTROLLERS
Test script:
On the same system, using GetKeyState on a keyboard key continues to work while the window is inactive
Just doing a loop with Tooltip % A_TickCount continues to work while the window is inactive
So this seems to be solely related to the XBE / XBA controllers
THIS ONLY HAPPENS WITH XBOX ONE, ELITE OR ACCESSIBILITY CONTROLLERS
Test script:
Code: Select all
id := 1
OutputDebug DBGVIEWCLEAR
Gui, Add, Text,, Stick ID:
Gui, Add, DDL, x+5 yp-3 AltSubmit gStickChanged hwndhStickId ,1|2||3|4|5|6|7|8
Gui, Show, w200 h200
GoSub, StickChanged
Loop {
ToolTip % GetKeyState(id "JoyX")
Sleep 100
}
StickChanged:
GuiControlGet, id,, % hStickId
return
^Esc::
GuiClose:
ExitApp
Just doing a loop with Tooltip % A_TickCount continues to work while the window is inactive
So this seems to be solely related to the XBE / XBA controllers