diff --git a/rpcs3/evdev_joystick_handler.cpp b/rpcs3/evdev_joystick_handler.cpp index 02dbf3a090..f73d81358c 100644 --- a/rpcs3/evdev_joystick_handler.cpp +++ b/rpcs3/evdev_joystick_handler.cpp @@ -552,8 +552,11 @@ int evdev_joystick_handler::GetButtonInfo(const input_event& evt, const EvdevDev m_is_button_or_trigger = true; // get the button value and return its code - if (code < BTN_MISC) + if (button_list.find(code) == button_list.end()) + { + LOG_ERROR(GENERAL, "Evdev button %s (%d) is unknown. Please add it to the button list.", libevdev_event_code_get_name(EV_KEY, code), code); return -1; + } value = val > 0 ? 255 : 0; return code; diff --git a/rpcs3/evdev_joystick_handler.h b/rpcs3/evdev_joystick_handler.h index f8b23e9b26..dc842b2345 100644 --- a/rpcs3/evdev_joystick_handler.h +++ b/rpcs3/evdev_joystick_handler.h @@ -81,6 +81,9 @@ class evdev_joystick_handler final : public PadHandlerBase // Unique button names for the config files and our pad settings dialog const std::unordered_map button_list = { + // Xbox One S Controller returns some buttons as key when connected through bluetooth + { KEY_BACK , "Back Key" }, + { KEY_HOMEPAGE , "Homepage Key"}, //{ BTN_MISC , "Misc" }, same as BTN_0 { BTN_0 , "0" }, { BTN_1 , "1" }, @@ -198,10 +201,7 @@ class evdev_joystick_handler final : public PadHandlerBase { BTN_TRIGGER_HAPPY37 , "Happy 37" }, { BTN_TRIGGER_HAPPY38 , "Happy 38" }, { BTN_TRIGGER_HAPPY39 , "Happy 39" }, - { BTN_TRIGGER_HAPPY40 , "Happy 40" }, - // Xbox One S Controller returns some buttons as key when connected through bluetooth - { KEY_BACK , "Back Key" }, - { KEY_HOMEPAGE , "Homepage Key"}, + { BTN_TRIGGER_HAPPY40 , "Happy 40" } }; // Unique positive axis names for the config files and our pad settings dialog