From dd4ccb059e8d1a9f96a38f2988a5846129a0d473 Mon Sep 17 00:00:00 2001 From: Unknown Date: Wed, 29 Nov 2017 10:20:28 +0100 Subject: [PATCH] Input: MMJOY prioritize button presses due to constant axis events --- rpcs3/mm_joystick_handler.cpp | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/rpcs3/mm_joystick_handler.cpp b/rpcs3/mm_joystick_handler.cpp index fd10041935..12b0e70b98 100644 --- a/rpcs3/mm_joystick_handler.cpp +++ b/rpcs3/mm_joystick_handler.cpp @@ -312,18 +312,7 @@ void mm_joystick_handler::GetNextButtonPress(const std::string& padId, const std // Return the new value if the button was pressed (aka. its value was bigger than 0 or the defined threshold) // Use a pair to get all the legally pressed buttons and use the one with highest value (prioritize first) std::pair pressed_button = { 0, "" }; - for (const auto& button : button_list) - { - u16 value = data[button.first]; - if (value > 0 && value > pressed_button.first) - pressed_button = { value, button.second }; - } - for (const auto& button : pov_list) - { - u16 value = data[button.first]; - if (value > 0 && value > pressed_button.first) - pressed_button = { value, button.second }; - } + for (const auto& button : axis_list) { u32 keycode = button.first; @@ -341,6 +330,20 @@ void mm_joystick_handler::GetNextButtonPress(const std::string& padId, const std } } + for (const auto& button : pov_list) + { + u16 value = data[button.first]; + if (value > 0 && value > pressed_button.first) + pressed_button = { value, button.second }; + } + + for (const auto& button : button_list) + { + u16 value = data[button.first]; + if (value > 0 && value > pressed_button.first) + pressed_button = { value, button.second }; + } + int preview_values[6] = { data[mmjoy_axis::joy_z_neg],