: fill-controller-state ( XINPUT_STATE -- controller-state )
Gamepad>> controller-state new dup rot
{
- [ wButtons>> HEX: f bitand >pov swap pov<< ]
+ [ wButtons>> 0xf bitand >pov swap pov<< ]
[ wButtons>> fill-buttons swap buttons<< ]
[ sThumbLX>> >axis swap x<< ]
[ sThumbLY>> >axis swap y<< ]
FALSE XInputEnable ;
M: xinput-game-input-backend (reset-game-input)
- global [
+ [
{
+dinput+ +keyboard-device+ +keyboard-state+
+controller-devices+ +controller-guids+
+device-change-window+ +device-change-handle+
} [ off ] each
- ] bind ;
+ ] with-global ;
M: xinput-game-input-backend get-controllers
{ 0 1 2 3 } ;