src/joystick/hidapi/SDL_hidapi_ps4.c
changeset 12790 5196f7a4d659
parent 12787 0411f841b035
child 12896 b91647e1a977
     1.1 --- a/src/joystick/hidapi/SDL_hidapi_ps4.c	Sat Jun 08 14:29:05 2019 -0700
     1.2 +++ b/src/joystick/hidapi/SDL_hidapi_ps4.c	Sat Jun 08 14:32:19 2019 -0700
     1.3 @@ -360,7 +360,7 @@
     1.4      HIDAPI_DriverPS4_Rumble(context, joystick, 0, 0, 0);
     1.5  
     1.6      /* Initialize the joystick capabilities */
     1.7 -    joystick->nbuttons = SDL_CONTROLLER_BUTTON_MAX;
     1.8 +    joystick->nbuttons = 16;
     1.9      joystick->naxes = SDL_CONTROLLER_AXIS_MAX;
    1.10      joystick->epowerlevel = SDL_JOYSTICK_POWER_WIRED;
    1.11  
    1.12 @@ -515,6 +515,7 @@
    1.13          Uint8 data = (packet->rgucButtonsHatAndCounter[2] & 0x03);
    1.14  
    1.15          SDL_PrivateJoystickButton(joystick, SDL_CONTROLLER_BUTTON_GUIDE, (data & 0x01) ? SDL_PRESSED : SDL_RELEASED);
    1.16 +        SDL_PrivateJoystickButton(joystick, 15, (data & 0x02) ? SDL_PRESSED : SDL_RELEASED);
    1.17      }
    1.18  
    1.19      axis = ((int)packet->ucTriggerLeft * 257) - 32768;