Skip to content

Commit

Permalink
webos: ignore internal emulated joypad
Browse files Browse the repository at this point in the history
At least two remote-like devices are recognized as joystick, which, when
opened, seem to break current remote-as-keyboard bindings. We filter
these out based on product/vendor ids.
  • Loading branch information
Informatic committed Apr 28, 2021
1 parent 9ed43b5 commit 4c98209
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions configuration.c
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,8 @@ static const enum joypad_driver_enum JOYPAD_DEFAULT_DRIVER = JOYPAD_XINPUT;
static const enum joypad_driver_enum JOYPAD_DEFAULT_DRIVER = JOYPAD_GX;
#elif defined(WIIU)
static const enum joypad_driver_enum JOYPAD_DEFAULT_DRIVER = JOYPAD_WIIU;
#elif defined(WEBOS)
static const enum joypad_driver_enum JOYPAD_DEFAULT_DRIVER = JOYPAD_SDL;
#elif defined(_XBOX)
static const enum joypad_driver_enum JOYPAD_DEFAULT_DRIVER = JOYPAD_XDK;
#elif defined(PS2)
Expand Down
10 changes: 10 additions & 0 deletions input/drivers_joypad/sdl_joypad.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,16 @@ static void sdl_pad_connect(unsigned id)
vendor = guid_ptr[0];
product = guid_ptr[1];
#endif
#ifdef WEBOS
if (vendor == 0x9999 && product == 0x9999) {
RARCH_WARN("[SDL_JOYPAD]: Ignoring pad #%d (vendor: %d; product: %d)\n", id, vendor, product);
if (pad->joypad)
SDL_JoystickClose(pad->joypad);

pad->joypad = NULL;
return;
}
#endif
#endif

input_autoconfigure_connect(
Expand Down

0 comments on commit 4c98209

Please sign in to comment.