Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

evdev: fix sony guitar hero button assignment #13377

Merged
merged 2 commits into from
Feb 9, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions rpcs3/Input/evdev_joystick_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -366,14 +366,18 @@ PadHandlerBase::connection evdev_joystick_handler::get_next_button_press(const s
std::string name;
} pressed_button{};

const bool is_xbox_360_controller = padId.find("Xbox 360") != umax;
const bool is_sony_controller = !is_xbox_360_controller && padId.find("Sony") != umax;
const bool is_sony_guitar = is_sony_controller && padId.find("Guitar") != umax;

for (const auto& [code, name] : button_list)
{
// Handle annoying useless buttons
if (code == NO_BUTTON)
continue;
if (padId.find("Xbox 360") != umax && code >= BTN_TRIGGER_HAPPY)
if (is_xbox_360_controller && code >= BTN_TRIGGER_HAPPY)
continue;
if (padId.find("Sony") != umax && (code == BTN_TL2 || code == BTN_TR2))
if (is_sony_controller && !is_sony_guitar && (code == BTN_TL2 || code == BTN_TR2))
continue;

if (!get_blacklist && std::find(m_blacklist.begin(), m_blacklist.end(), name) != m_blacklist.end())
Expand Down