mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-04-20 11:36:13 +00:00
Input: MMJOY prioritize button presses due to constant axis events
This commit is contained in:
parent
5810b29298
commit
dd4ccb059e
1 changed files with 15 additions and 12 deletions
|
@ -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<u16, std::string> 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],
|
||||
|
|
Loading…
Add table
Reference in a new issue