You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
WASD mapped to the Left GamePad Stick for moving, sometimes gets stuck #61
I tried this in Portal 1 and with both v 0.7.0 and 0.6.0 the game will occasionally not catch me releasing A and get me stuck walking towards the left.
A theory on why this happens:
Some Keyboard input is inadvertently captured besides the simulated gamepad input, but the release isn't.
I think this might be the case, because on my other monitor the tester shows the gamepad stick movement just fine.
Note: an issue with how mappings for gamepad sticks currently work:
Keyboard input: S KeyDown -> GamePad 2 Left x=0 y=-32768
Keyboard input: S KeyUp -> GamePad 2 Left x=0 y=32767
This will get the stick into position 0, -1
Note: Abort should really be tied to Releasing Escape (not pressing as it is now), since overriding default behavior may keep escape stuck pressed down
I'm having serious trouble reproducing it if I remove the mouse-move -> right stick mapping. Also I feel that this may be a problem with the game not having focus, keyboard input getting picked up (but only press) then game input getting picked up by it and switching to gamepad mode, but when the gamepad somehow gets deactivated (by keyboard input sneaking into the game again?) it gets stuck on the last pressed (but never released input key).
It's quite the bug to reproduce and it's even hard to explain. I'll put more work into this another time.
I think this is a race condition between simulated game inputs. Consider the following happening in sequence:
Thread A: Mouse Move -> Right Stick gets the controller state
Thread B: Keyboard WASD -> Left stick gets the controller
Thread A: Mouse Move -> Right Stick Updates the controller state
Thread B: Keyboard WASD -> Left stick Updates the controller state with now outdated information
This is different orders would explain the weird behavior. I will try ensure only one thread is manipulating the input at a time. Or use a queue of some sort
Activity
luttje commentedon Nov 1, 2023
The 'sometimes' can be replicated consistently by:Release ANevermind, it's a bit different
luttje commentedon Nov 1, 2023
Relevant mappings:

Config where problem occurs:

luttje commentedon Nov 1, 2023
Note: an issue with how mappings for gamepad sticks currently work:
Keyboard input: S KeyDown -> GamePad 2 Left x=0 y=-32768
Keyboard input: S KeyUp -> GamePad 2 Left x=0 y=32767
This will get the stick into position 0, -1
luttje commentedon Nov 1, 2023
Note: Abort should really be tied to Releasing Escape (not pressing as it is now), since overriding default behavior may keep escape stuck pressed down
luttje commentedon Nov 1, 2023
I'm having serious trouble reproducing it if I remove the mouse-move -> right stick mapping. Also I feel that this may be a problem with the game not having focus, keyboard input getting picked up (but only press) then game input getting picked up by it and switching to gamepad mode, but when the gamepad somehow gets deactivated (by keyboard input sneaking into the game again?) it gets stuck on the last pressed (but never released input key).
It's quite the bug to reproduce and it's even hard to explain. I'll put more work into this another time.
luttje commentedon Nov 1, 2023
I think this is a race condition between simulated game inputs. Consider the following happening in sequence:
This is different orders would explain the weird behavior. I will try ensure only one thread is manipulating the input at a time. Or use a queue of some sort
Failed attempt fix bug in #61 w/ exclusive access to simulated gamepa…
luttje commentedon Nov 11, 2023
Consider replacing my faulty implementation with: https://github.com/jnm2/LowLevelHooking/blob/master/src/LowLevelHooking/GlobalKeyboardHook.cs
I especially handle nCode incorrectly
luttje commentedon Nov 19, 2023
Notes for possible solutions...
Other libraries:
Other windows hook related sources:
Other techniques and sources: