1
0
mirror of git://projects.qi-hardware.com/gmenu2x.git synced 2024-11-22 07:02:29 +02:00

Fix key repeat of analog stick working only on some screens

This commit is contained in:
Paul Cercueil 2014-02-24 22:34:53 +01:00
parent 7777b9edde
commit b087e5c1f9

View File

@ -279,16 +279,18 @@ bool InputManager::getButton(Button *button, bool wait) {
Uint32 keyRepeatCallback(Uint32 timeout __attribute__((unused)), void *d)
{
struct Joystick *joystick = (struct Joystick *) d;
Uint8 hatState = joystick->hatState;
Uint8 hatState;
if (joystick->axisState[1][AXIS_STATE_NEGATIVE])
hatState |= SDL_HAT_UP;
hatState = SDL_HAT_UP;
else if (joystick->axisState[1][AXIS_STATE_POSITIVE])
hatState |= SDL_HAT_DOWN;
if (joystick->axisState[0][AXIS_STATE_NEGATIVE])
hatState |= SDL_HAT_LEFT;
hatState = SDL_HAT_DOWN;
else if (joystick->axisState[0][AXIS_STATE_NEGATIVE])
hatState = SDL_HAT_LEFT;
else if (joystick->axisState[0][AXIS_STATE_POSITIVE])
hatState |= SDL_HAT_RIGHT;
hatState = SDL_HAT_RIGHT;
else
hatState = joystick->hatState;
SDL_JoyHatEvent e = {
.type = SDL_JOYHATMOTION,