Skip to content

Commit

Permalink
The hat index passed to the application should be zero-based with no …
Browse files Browse the repository at this point in the history
…holes
  • Loading branch information
slouken committed Jun 12, 2019
1 parent a1a2f9b commit 3fbaa5d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/joystick/linux/SDL_sysjoystick.c
Expand Up @@ -773,9 +773,8 @@ HandleHat(SDL_Joystick * stick, Uint8 hat, int axis, int value)
}
if (value != the_hat->axis[axis]) {
the_hat->axis[axis] = value;
SDL_PrivateJoystickHat(stick, hat,
position_map[the_hat->
axis[1]][the_hat->axis[0]]);
SDL_PrivateJoystickHat(stick, stick->hwdata->hats_indices[hat],
position_map[the_hat->axis[1]][the_hat->axis[0]]);
}
}

Expand Down

0 comments on commit 3fbaa5d

Please sign in to comment.