mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-03-16 16:21:02 +00:00
evdev: fix axis_orientations index
This commit is contained in:
parent
f0d51899c1
commit
1b775febcd
@ -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)
|
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);
|
const int min_direction = FindAxisDirection(axis_orientations, index);
|
||||||
m_dev->cur_dir = min_direction;
|
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)
|
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);
|
const int max_direction = FindAxisDirection(axis_orientations, index);
|
||||||
m_dev->cur_dir = max_direction;
|
m_dev->cur_dir = max_direction;
|
||||||
|
|
||||||
@ -910,7 +910,7 @@ bool evdev_joystick_handler::bindPadToDevice(std::shared_ptr<Pad> pad, const std
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
std::unordered_map<int, bool> axis_orientations;
|
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)
|
auto evdevbutton = [&](const cfg::string& name)
|
||||||
{
|
{
|
||||||
|
@ -355,8 +355,6 @@ class evdev_joystick_handler final : public PadHandlerBase
|
|||||||
clock_t last_vibration = 0;
|
clock_t last_vibration = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
const int BUTTON_COUNT = 17;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
evdev_joystick_handler();
|
evdev_joystick_handler();
|
||||||
~evdev_joystick_handler();
|
~evdev_joystick_handler();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user