Skip to content

Commit

Permalink
Fixed querying device info on the MOBAPAD M073
Browse files Browse the repository at this point in the history
The query packet needs to contain valid rumble data in order to be accepted by the controller.

Fixes libsdl-org#7788
  • Loading branch information
slouken committed Jun 10, 2023
1 parent 2042e9c commit 5490873
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/joystick/hidapi/SDL_hidapi_switch.c
Original file line number Diff line number Diff line change
Expand Up @@ -1250,6 +1250,10 @@ static SDL_bool HIDAPI_DriverSwitch_InitDevice(SDL_HIDAPI_Device *device)
/* Find out whether or not we can send output reports */
ctx->m_bInputOnly = SDL_IsJoystickNintendoSwitchProInputOnly(device->vendor_id, device->product_id);
if (!ctx->m_bInputOnly) {
/* Initialize rumble data, important for reading device info on the MOBAPAD M073 */
SetNeutralRumble(&ctx->m_RumblePacket.rumbleData[0]);
SetNeutralRumble(&ctx->m_RumblePacket.rumbleData[1]);

if (!BReadDeviceInfo(ctx)) {
SDL_LogDebug(SDL_LOG_CATEGORY_INPUT,
"HIDAPI_DriverSwitch_InitDevice(): Couldn't read device info");
Expand Down

0 comments on commit 5490873

Please sign in to comment.