A modder asked for gamepad button event functions which return raw xInput button codes. This commit adds new 2 F4SE functions and 2 new events(can be copied to the end of "ScriptObject.psc"):
Function RegisterForGamepadButton(int key) native
Function UnregisterForGamepadButton(int key) native
A modder asked for gamepad button event functions which return raw xInput button codes. This commit adds new 2 F4SE functions and 2 new events(can be copied to the end of "ScriptObject.psc"):
Function RegisterForGamepadButton(int key) native Function UnregisterForGamepadButton(int key) native
Event OnGamepadButtonDown(int keyCode) EndEvent
Event OnGamepadButtonUp(int keyCode, float time) EndEvent
Papyrys test code:
Event OnGamepadButtonDown(int keyCode) Debug.Notification("GAMEPAD buttonDOWN>>>" + keyCode ) EndEvent
Event OnGamepadButtonUp(int keyCode, float time) Debug.Notification("GAMEPAD buttonUP>>>" + keyCode + ", time is " + time ) EndEvent
Function FunctionInit() RegisterForGamepadButton(1) RegisterForGamepadButton(2) RegisterForGamepadButton(4) RegisterForGamepadButton(8) RegisterForGamepadButton(16) RegisterForGamepadButton(32) RegisterForGamepadButton(64) RegisterForGamepadButton(128) RegisterForGamepadButton(256) RegisterForGamepadButton(512) RegisterForGamepadButton(1024) RegisterForGamepadButton(4096) RegisterForGamepadButton(8192) RegisterForGamepadButton(16384) RegisterForGamepadButton(32768) EndFunction
Feel free to ask any questions, I'm TommInfinite on xSE Discord channel. Sorry for gitiignore in the pull request, I don't know how to get rid of it.