Skip to content
Permalink
Browse files

ignore depressed gamepad triggers #88

On joystick event notification, filter out axis values that are equal to
their initial state.

The reason for doing this is explained in 539027c. Triggers on e.g. the
360 controller are an axis that are the max negative value in the
depressed state, and for some reason a constant stream of events are
generated for them, that's another issue that needs to be addressed.

For the time being, this fixes the other half of the main issue in #88:
users with an old config with the default special key bindings will now
be able to use keyboard hotkeys as these spurious joystick events will
be filtered out and will not block keyboard events.

TODO:

- stop generating events for depressed triggers in the first place

- fix joystick events completely blocking keyboard events
  • Loading branch information...
rkitover committed Dec 28, 2018
1 parent 979ef8e commit e57beed8906638a1309076be8f453f299cefddca
Showing with 5 additions and 0 deletions.
  1. +5 −0 src/wx/widgets/sdljoy.cpp
@@ -134,6 +134,11 @@ void wxSDLJoy::Notify()
for (int j = 0; j < nax; j++) {
val = SDL_JoystickGetAxis(dev, j);

// trigger axes always return max negative value, we ignore these
int16_t initial_state;
if (SDL_JoystickGetAxisInitialState(dev, j, &initial_state) && val == initial_state)
continue;

if (digital) {
if (val > 0x3fff)
val = 0x7fff;

0 comments on commit e57beed

Please sign in to comment.
You can’t perform that action at this time.