1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-22 10:42:36 +01:00

evdev: fix axis_orientations index

This commit is contained in:
Megamouse 2021-08-09 13:30:20 +02:00
parent f0d51899c1
commit 1b775febcd
2 changed files with 3 additions and 5 deletions

View File

@ -802,7 +802,7 @@ void evdev_joystick_handler::get_mapping(const std::shared_ptr<PadDevice>& devic
if (!m_is_button_or_trigger && evt.type == EV_ABS)
{
const int index = BUTTON_COUNT + (idx * 2) + 1;
const int index = pad->m_buttons.size() + (idx * 2) + 1;
const int min_direction = FindAxisDirection(axis_orientations, index);
m_dev->cur_dir = min_direction;
@ -828,7 +828,7 @@ void evdev_joystick_handler::get_mapping(const std::shared_ptr<PadDevice>& devic
if (!m_is_button_or_trigger && evt.type == EV_ABS)
{
const int index = BUTTON_COUNT + (idx * 2);
const int index = pad->m_buttons.size() + (idx * 2);
const int max_direction = FindAxisDirection(axis_orientations, index);
m_dev->cur_dir = max_direction;
@ -910,7 +910,7 @@ bool evdev_joystick_handler::bindPadToDevice(std::shared_ptr<Pad> pad, const std
return false;
std::unordered_map<int, bool> axis_orientations;
int i = 0; // increment to know the axis location (17-24). Be careful if you ever add more evdevbutton() calls in here (BUTTON_COUNT = 17)
int i = 0; // increment to know the axis location
auto evdevbutton = [&](const cfg::string& name)
{

View File

@ -355,8 +355,6 @@ class evdev_joystick_handler final : public PadHandlerBase
clock_t last_vibration = 0;
};
const int BUTTON_COUNT = 17;
public:
evdev_joystick_handler();
~evdev_joystick_handler();