Skip to content

Commit

Permalink
Qt/Input: Introduce profiles
Browse files Browse the repository at this point in the history
  • Loading branch information
Megamouse committed Dec 23, 2017
1 parent 8a3759f commit d161f2d
Show file tree
Hide file tree
Showing 17 changed files with 683 additions and 488 deletions.
2 changes: 1 addition & 1 deletion rpcs3/Emu/Io/Null/NullPadHandler.h
Expand Up @@ -17,7 +17,7 @@ class NullPadHandler final : public PadHandlerBase
return nulllist;
}

bool bindPadToDevice(std::shared_ptr<Pad> pad, const std::string& device) override
bool bindPadToDevice(std::shared_ptr<Pad> pad, const std::string& device, const std::string& profile) override
{
return true;
}
Expand Down
68 changes: 42 additions & 26 deletions rpcs3/Emu/Io/PadHandler.h
Expand Up @@ -248,36 +248,35 @@ struct Pad
}
};

struct pad_config : cfg::node
struct pad_profile final : cfg::node
{
std::string cfg_type = "";
std::string cfg_name = "";
pad_profile(cfg::node* _this, const std::string& name) : cfg::node(_this, name) {}

cfg::string ls_left { this, "Left Stick Left", "" };
cfg::string ls_down { this, "Left Stick Down", "" };
cfg::string ls_left{ this, "Left Stick Left", "" };
cfg::string ls_down{ this, "Left Stick Down", "" };
cfg::string ls_right{ this, "Left Stick Right", "" };
cfg::string ls_up { this, "Left Stick Up", "" };
cfg::string rs_left { this, "Right Stick Left", "" };
cfg::string rs_down { this, "Right Stick Down", "" };
cfg::string ls_up{ this, "Left Stick Up", "" };
cfg::string rs_left{ this, "Right Stick Left", "" };
cfg::string rs_down{ this, "Right Stick Down", "" };
cfg::string rs_right{ this, "Right Stick Right", "" };
cfg::string rs_up { this, "Right Stick Up", "" };
cfg::string start { this, "Start", "" };
cfg::string select { this, "Select", "" };
cfg::string ps { this, "PS Button", "" };
cfg::string square { this, "Square", "" };
cfg::string cross { this, "Cross", "" };
cfg::string circle { this, "Circle", "" };
cfg::string rs_up{ this, "Right Stick Up", "" };
cfg::string start{ this, "Start", "" };
cfg::string select{ this, "Select", "" };
cfg::string ps{ this, "PS Button", "" };
cfg::string square{ this, "Square", "" };
cfg::string cross{ this, "Cross", "" };
cfg::string circle{ this, "Circle", "" };
cfg::string triangle{ this, "Triangle", "" };
cfg::string left { this, "Left", "" };
cfg::string down { this, "Down", "" };
cfg::string right { this, "Right", "" };
cfg::string up { this, "Up", "" };
cfg::string r1 { this, "R1", "" };
cfg::string r2 { this, "R2", "" };
cfg::string r3 { this, "R3", "" };
cfg::string l1 { this, "L1", "" };
cfg::string l2 { this, "L2", "" };
cfg::string l3 { this, "L3", "" };
cfg::string left{ this, "Left", "" };
cfg::string down{ this, "Down", "" };
cfg::string right{ this, "Right", "" };
cfg::string up{ this, "Up", "" };
cfg::string r1{ this, "R1", "" };
cfg::string r2{ this, "R2", "" };
cfg::string r3{ this, "R3", "" };
cfg::string l1{ this, "L1", "" };
cfg::string l2{ this, "L2", "" };
cfg::string l3{ this, "L3", "" };

cfg::_int<0, 1000000> lstickdeadzone{ this, "Left Stick Deadzone", 0 };
cfg::_int<0, 1000000> rstickdeadzone{ this, "Right Stick Deadzone", 0 };
Expand All @@ -292,6 +291,23 @@ struct pad_config : cfg::node
cfg::_bool enable_vibration_motor_large{ this, "Enable Large Vibration Motor", true };
cfg::_bool enable_vibration_motor_small{ this, "Enable Small Vibration Motor", true };
cfg::_bool switch_vibration_motors{ this, "Switch Vibration Motors", false };
};

struct pad_config final : cfg::node
{
std::string cfg_type = "";
std::string cfg_name = "";

pad_profile profile_0{ this, "Profile 0" };
pad_profile profile_1{ this, "Profile 1" };
pad_profile profile_2{ this, "Profile 2" };
pad_profile profile_3{ this, "Profile 3" };
pad_profile profile_4{ this, "Profile 4" };
pad_profile profile_5{ this, "Profile 5" };
pad_profile profile_6{ this, "Profile 6" };
pad_profile profile_7{ this, "Profile 7" };
pad_profile profile_8{ this, "Profile 8" };
pad_profile profile_9{ this, "Profile 9" };

bool load()
{
Expand Down Expand Up @@ -600,7 +616,7 @@ class PadHandlerBase
//Callback called during pad_thread::ThreadFunc
virtual void ThreadProc() = 0;
//Binds a Pad to a device
virtual bool bindPadToDevice(std::shared_ptr<Pad> pad, const std::string& device) = 0;
virtual bool bindPadToDevice(std::shared_ptr<Pad> pad, const std::string& device, const std::string& profile) = 0;

private:
virtual void TranslateButtonPress(u64 keyCode, bool& pressed, u16& val, bool ignore_threshold = false) {};
Expand Down
240 changes: 132 additions & 108 deletions rpcs3/ds4_pad_handler.cpp

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions rpcs3/ds4_pad_handler.h
Expand Up @@ -109,6 +109,7 @@ class ds4_pad_handler final : public PadHandlerBase
struct DS4Device
{
hid_device* hidDevice{ nullptr };
pad_profile* profile{ nullptr };
std::string path{ "" };
bool btCon{ false };
bool hasCalibData{ false };
Expand Down Expand Up @@ -139,16 +140,17 @@ class ds4_pad_handler final : public PadHandlerBase
bool Init() override;

std::vector<std::string> ListDevices() override;
bool bindPadToDevice(std::shared_ptr<Pad> pad, const std::string& device) override;
bool bindPadToDevice(std::shared_ptr<Pad> pad, const std::string& device, const std::string& profile) override;
void ThreadProc() override;
void GetNextButtonPress(const std::string& padId, const std::function<void(u16, std::string, int[])>& buttonCallback, bool get_blacklist = false, std::vector<std::string> buttons = {}) override;
void TestVibration(const std::string& padId, u32 largeMotor, u32 smallMotor) override;

private:
bool is_init;
bool is_init = false;

std::vector<u32> blacklist;
std::vector<std::pair<std::shared_ptr<DS4Device>, std::shared_ptr<Pad>>> bindings;
std::shared_ptr<DS4Device> m_dev;

private:
std::shared_ptr<DS4Device> GetDevice(const std::string& padId);
Expand Down
188 changes: 105 additions & 83 deletions rpcs3/evdev_joystick_handler.cpp
Expand Up @@ -31,39 +31,44 @@ evdev_joystick_handler::evdev_joystick_handler()
m_pad_config.cfg_type = "evdev";
m_pad_config.cfg_name = fs::get_config_dir() + "/config_evdev.yml";

// Set default button mapping
m_pad_config.ls_left.def = rev_axis_list.at(ABS_X);
m_pad_config.ls_down.def = axis_list.at(ABS_Y);
m_pad_config.ls_right.def = axis_list.at(ABS_X);
m_pad_config.ls_up.def = rev_axis_list.at(ABS_Y);
m_pad_config.rs_left.def = rev_axis_list.at(ABS_RX);
m_pad_config.rs_down.def = axis_list.at(ABS_RY);
m_pad_config.rs_right.def = axis_list.at(ABS_RX);
m_pad_config.rs_up.def = rev_axis_list.at(ABS_RY);
m_pad_config.start.def = button_list.at(BTN_START);
m_pad_config.select.def = button_list.at(BTN_SELECT);
m_pad_config.ps.def = button_list.at(BTN_MODE);
m_pad_config.square.def = button_list.at(BTN_X);
m_pad_config.cross.def = button_list.at(BTN_A);
m_pad_config.circle.def = button_list.at(BTN_B);
m_pad_config.triangle.def = button_list.at(BTN_Y);
m_pad_config.left.def = rev_axis_list.at(ABS_HAT0X);
m_pad_config.down.def = axis_list.at(ABS_HAT0Y);
m_pad_config.right.def = axis_list.at(ABS_HAT0X);
m_pad_config.up.def = rev_axis_list.at(ABS_HAT0Y);
m_pad_config.r1.def = button_list.at(BTN_TR);
m_pad_config.r2.def = axis_list.at(ABS_RZ);
m_pad_config.r3.def = button_list.at(BTN_THUMBR);
m_pad_config.l1.def = button_list.at(BTN_TL);
m_pad_config.l2.def = axis_list.at(ABS_Z);
m_pad_config.l3.def = button_list.at(BTN_THUMBL);

// Set default misc variables
m_pad_config.lstickdeadzone.def = 30; // between 0 and 255
m_pad_config.rstickdeadzone.def = 30; // between 0 and 255
m_pad_config.ltriggerthreshold.def = 0; // between 0 and 255
m_pad_config.rtriggerthreshold.def = 0; // between 0 and 255
m_pad_config.padsquircling.def = 5000;
for (const auto& node : m_pad_config.get_nodes())
{
pad_profile* profile = static_cast<pad_profile*>(node.second);

// Set default button mapping
profile->ls_left.def = rev_axis_list.at(ABS_X);
profile->ls_down.def = axis_list.at(ABS_Y);
profile->ls_right.def = axis_list.at(ABS_X);
profile->ls_up.def = rev_axis_list.at(ABS_Y);
profile->rs_left.def = rev_axis_list.at(ABS_RX);
profile->rs_down.def = axis_list.at(ABS_RY);
profile->rs_right.def = axis_list.at(ABS_RX);
profile->rs_up.def = rev_axis_list.at(ABS_RY);
profile->start.def = button_list.at(BTN_START);
profile->select.def = button_list.at(BTN_SELECT);
profile->ps.def = button_list.at(BTN_MODE);
profile->square.def = button_list.at(BTN_X);
profile->cross.def = button_list.at(BTN_A);
profile->circle.def = button_list.at(BTN_B);
profile->triangle.def = button_list.at(BTN_Y);
profile->left.def = rev_axis_list.at(ABS_HAT0X);
profile->down.def = axis_list.at(ABS_HAT0Y);
profile->right.def = axis_list.at(ABS_HAT0X);
profile->up.def = rev_axis_list.at(ABS_HAT0Y);
profile->r1.def = button_list.at(BTN_TR);
profile->r2.def = axis_list.at(ABS_RZ);
profile->r3.def = button_list.at(BTN_THUMBR);
profile->l1.def = button_list.at(BTN_TL);
profile->l2.def = axis_list.at(ABS_Z);
profile->l3.def = button_list.at(BTN_THUMBL);

// Set default misc variables
profile->lstickdeadzone.def = 30; // between 0 and 255
profile->rstickdeadzone.def = 30; // between 0 and 255
profile->ltriggerthreshold.def = 0; // between 0 and 255
profile->rtriggerthreshold.def = 0; // between 0 and 255
profile->padsquircling.def = 5000;
}

// apply defaults
m_pad_config.from_default();
Expand Down Expand Up @@ -498,6 +503,7 @@ void evdev_joystick_handler::TranslateButtonPress(u64 keyCode, bool& pressed, u1
{
// Update the pad button values based on their type and thresholds.
// With this you can use axis or triggers as buttons or vice versa
auto profile = m_dev.profile;
u32 code = static_cast<u32>(keyCode);
auto checkButton = [&](const EvdevButton& b)
{
Expand All @@ -510,23 +516,23 @@ void evdev_joystick_handler::TranslateButtonPress(u64 keyCode, bool& pressed, u1

if (checkButton(m_dev.trigger_left))
{
pressed = value > m_pad_config.ltriggerthreshold;
value = pressed ? NormalizeTriggerInput(value, m_pad_config.ltriggerthreshold) : 0;
pressed = value > profile->ltriggerthreshold;
value = pressed ? NormalizeTriggerInput(value, profile->ltriggerthreshold) : 0;
}
else if (checkButton(m_dev.trigger_right))
{
pressed = value > m_pad_config.rtriggerthreshold;
value = pressed ? NormalizeTriggerInput(value, m_pad_config.rtriggerthreshold) : 0;
pressed = value > profile->rtriggerthreshold;
value = pressed ? NormalizeTriggerInput(value, profile->rtriggerthreshold) : 0;
}
else if (checkButtons(m_dev.axis_left))
{
pressed = value > (ignore_threshold ? 0 : m_pad_config.lstickdeadzone);
value = pressed ? NormalizeStickInput(value, m_pad_config.lstickdeadzone, ignore_threshold) : 0;
pressed = value > (ignore_threshold ? 0 : profile->lstickdeadzone);
value = pressed ? NormalizeStickInput(value, profile->lstickdeadzone, ignore_threshold) : 0;
}
else if (checkButtons(m_dev.axis_right))
{
pressed = value > (ignore_threshold ? 0 : m_pad_config.rstickdeadzone);
value = pressed ? NormalizeStickInput(value, m_pad_config.rstickdeadzone, ignore_threshold) : 0;
pressed = value > (ignore_threshold ? 0 : profile->rstickdeadzone);
value = pressed ? NormalizeStickInput(value, profile->rstickdeadzone, ignore_threshold) : 0;
}
else // normal button (should in theory also support sensitive buttons)
{
Expand Down Expand Up @@ -680,6 +686,7 @@ void evdev_joystick_handler::ThreadProc()
for (auto& device : devices)
{
m_dev = device;
auto profile = device.profile;
auto pad = device.pad;
auto axis_orientations = device.axis_orientations;
auto& dev = device.device;
Expand All @@ -704,10 +711,10 @@ void evdev_joystick_handler::ThreadProc()
padnum++;

// Handle vibration
int idx_l = m_pad_config.switch_vibration_motors ? 1 : 0;
int idx_s = m_pad_config.switch_vibration_motors ? 0 : 1;
u16 force_large = m_pad_config.enable_vibration_motor_large ? pad->m_vibrateMotors[idx_l].m_value * 257 : vibration_min;
u16 force_small = m_pad_config.enable_vibration_motor_small ? pad->m_vibrateMotors[idx_s].m_value * 257 : vibration_min;
int idx_l = profile->switch_vibration_motors ? 1 : 0;
int idx_s = profile->switch_vibration_motors ? 0 : 1;
u16 force_large = profile->enable_vibration_motor_large ? pad->m_vibrateMotors[idx_l].m_value * 257 : vibration_min;
u16 force_small = profile->enable_vibration_motor_small ? pad->m_vibrateMotors[idx_s].m_value * 257 : vibration_min;
SetRumble(&device, force_large, force_small);

// Try to query the latest event from the joystick.
Expand Down Expand Up @@ -832,13 +839,13 @@ void evdev_joystick_handler::ThreadProc()
u16 lx, ly, rx, ry;

// Normalize our two stick's axis based on the thresholds
std::tie(lx, ly) = NormalizeStickDeadzone(device.stick_val[0], device.stick_val[1], m_pad_config.lstickdeadzone);
std::tie(rx, ry) = NormalizeStickDeadzone(device.stick_val[2], device.stick_val[3], m_pad_config.rstickdeadzone);
std::tie(lx, ly) = NormalizeStickDeadzone(device.stick_val[0], device.stick_val[1], profile->lstickdeadzone);
std::tie(rx, ry) = NormalizeStickDeadzone(device.stick_val[2], device.stick_val[3], profile->rstickdeadzone);

if (m_pad_config.padsquircling != 0)
if (profile->padsquircling != 0)
{
std::tie(lx, ly) = ConvertToSquirclePoint(lx, ly, m_pad_config.padsquircling);
std::tie(rx, ry) = ConvertToSquirclePoint(rx, ry, m_pad_config.padsquircling);
std::tie(lx, ly) = ConvertToSquirclePoint(lx, ly, profile->padsquircling);
std::tie(rx, ry) = ConvertToSquirclePoint(rx, ry, profile->padsquircling);
}

pad->m_sticks[0].m_value = lx;
Expand All @@ -858,14 +865,29 @@ int evdev_joystick_handler::FindAxisDirection(const std::unordered_map<int, bool
return it->second;
};

bool evdev_joystick_handler::bindPadToDevice(std::shared_ptr<Pad> pad, const std::string& device)
bool evdev_joystick_handler::bindPadToDevice(std::shared_ptr<Pad> pad, const std::string& device, const std::string& profile)
{
Init();

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 find_key() calls in here (BUTTON_COUNT = 17)
int last_type = EV_ABS;

pad_profile* p_profile = nullptr;

for (const auto& prof : m_pad_config.get_nodes())
{
if (prof.first == profile)
{
p_profile = static_cast<pad_profile*>(prof.second);
m_dev.profile = p_profile;
break;
}
}

if (p_profile == nullptr)
return false;

auto find_key = [&](const cfg::string& name)
{
int type = EV_ABS;
Expand Down Expand Up @@ -909,38 +931,38 @@ bool evdev_joystick_handler::bindPadToDevice(std::shared_ptr<Pad> pad, const std
CELL_PAD_DEV_TYPE_STANDARD
);

pad->m_buttons.emplace_back(CELL_PAD_BTN_OFFSET_DIGITAL2, find_key(m_pad_config.triangle), CELL_PAD_CTRL_TRIANGLE);
pad->m_buttons.emplace_back(CELL_PAD_BTN_OFFSET_DIGITAL2, find_key(m_pad_config.circle), CELL_PAD_CTRL_CIRCLE);
pad->m_buttons.emplace_back(CELL_PAD_BTN_OFFSET_DIGITAL2, find_key(m_pad_config.cross), CELL_PAD_CTRL_CROSS);
pad->m_buttons.emplace_back(CELL_PAD_BTN_OFFSET_DIGITAL2, find_key(m_pad_config.square), CELL_PAD_CTRL_SQUARE);

m_dev.trigger_left = evdevbutton(m_pad_config.l2);
pad->m_buttons.emplace_back(CELL_PAD_BTN_OFFSET_DIGITAL2, m_dev.trigger_left.code, CELL_PAD_CTRL_L2);

m_dev.trigger_right = evdevbutton(m_pad_config.r2);
pad->m_buttons.emplace_back(CELL_PAD_BTN_OFFSET_DIGITAL2, m_dev.trigger_right.code, CELL_PAD_CTRL_R2);

pad->m_buttons.emplace_back(CELL_PAD_BTN_OFFSET_DIGITAL2, find_key(m_pad_config.l1), CELL_PAD_CTRL_L1);
pad->m_buttons.emplace_back(CELL_PAD_BTN_OFFSET_DIGITAL2, find_key(m_pad_config.r1), CELL_PAD_CTRL_R1);
pad->m_buttons.emplace_back(CELL_PAD_BTN_OFFSET_DIGITAL1, find_key(m_pad_config.start), CELL_PAD_CTRL_START);
pad->m_buttons.emplace_back(CELL_PAD_BTN_OFFSET_DIGITAL1, find_key(m_pad_config.select), CELL_PAD_CTRL_SELECT);
pad->m_buttons.emplace_back(CELL_PAD_BTN_OFFSET_DIGITAL1, find_key(m_pad_config.l3), CELL_PAD_CTRL_L3);
pad->m_buttons.emplace_back(CELL_PAD_BTN_OFFSET_DIGITAL1, find_key(m_pad_config.r3), CELL_PAD_CTRL_R3);
pad->m_buttons.emplace_back(CELL_PAD_BTN_OFFSET_DIGITAL2, find_key(m_pad_config.ps), 0x100/*CELL_PAD_CTRL_PS*/);// TODO: PS button support
pad->m_buttons.emplace_back(CELL_PAD_BTN_OFFSET_DIGITAL1, find_key(m_pad_config.up), CELL_PAD_CTRL_UP);
pad->m_buttons.emplace_back(CELL_PAD_BTN_OFFSET_DIGITAL1, find_key(m_pad_config.down), CELL_PAD_CTRL_DOWN);
pad->m_buttons.emplace_back(CELL_PAD_BTN_OFFSET_DIGITAL1, find_key(m_pad_config.left), CELL_PAD_CTRL_LEFT);
pad->m_buttons.emplace_back(CELL_PAD_BTN_OFFSET_DIGITAL1, find_key(m_pad_config.right), CELL_PAD_CTRL_RIGHT);
pad->m_buttons.emplace_back(CELL_PAD_BTN_OFFSET_DIGITAL2, 0, 0x0); // Reserved

m_dev.axis_left[0] = evdevbutton(m_pad_config.ls_right);
m_dev.axis_left[1] = evdevbutton(m_pad_config.ls_left);
m_dev.axis_left[2] = evdevbutton(m_pad_config.ls_up);
m_dev.axis_left[3] = evdevbutton(m_pad_config.ls_down);
m_dev.axis_right[0] = evdevbutton(m_pad_config.rs_right);
m_dev.axis_right[1] = evdevbutton(m_pad_config.rs_left);
m_dev.axis_right[2] = evdevbutton(m_pad_config.rs_up);
m_dev.axis_right[3] = evdevbutton(m_pad_config.rs_down);
pad->m_buttons.emplace_back(CELL_PAD_BTN_OFFSET_DIGITAL2, find_key(p_profile->triangle), CELL_PAD_CTRL_TRIANGLE);
pad->m_buttons.emplace_back(CELL_PAD_BTN_OFFSET_DIGITAL2, find_key(p_profile->circle), CELL_PAD_CTRL_CIRCLE);
pad->m_buttons.emplace_back(CELL_PAD_BTN_OFFSET_DIGITAL2, find_key(p_profile->cross), CELL_PAD_CTRL_CROSS);
pad->m_buttons.emplace_back(CELL_PAD_BTN_OFFSET_DIGITAL2, find_key(p_profile->square), CELL_PAD_CTRL_SQUARE);

m_dev.trigger_left = evdevbutton(p_profile->l2);
pad->m_buttons.emplace_back(CELL_PAD_BTN_OFFSET_DIGITAL2, m_dev.trigger_left.code, CELL_PAD_CTRL_L2);

m_dev.trigger_right = evdevbutton(p_profile->r2);
pad->m_buttons.emplace_back(CELL_PAD_BTN_OFFSET_DIGITAL2, m_dev.trigger_right.code, CELL_PAD_CTRL_R2);

pad->m_buttons.emplace_back(CELL_PAD_BTN_OFFSET_DIGITAL2, find_key(p_profile->l1), CELL_PAD_CTRL_L1);
pad->m_buttons.emplace_back(CELL_PAD_BTN_OFFSET_DIGITAL2, find_key(p_profile->r1), CELL_PAD_CTRL_R1);
pad->m_buttons.emplace_back(CELL_PAD_BTN_OFFSET_DIGITAL1, find_key(p_profile->start), CELL_PAD_CTRL_START);
pad->m_buttons.emplace_back(CELL_PAD_BTN_OFFSET_DIGITAL1, find_key(p_profile->select), CELL_PAD_CTRL_SELECT);
pad->m_buttons.emplace_back(CELL_PAD_BTN_OFFSET_DIGITAL1, find_key(p_profile->l3), CELL_PAD_CTRL_L3);
pad->m_buttons.emplace_back(CELL_PAD_BTN_OFFSET_DIGITAL1, find_key(p_profile->r3), CELL_PAD_CTRL_R3);
pad->m_buttons.emplace_back(CELL_PAD_BTN_OFFSET_DIGITAL2, find_key(p_profile->ps), 0x100/*CELL_PAD_CTRL_PS*/);// TODO: PS button support
pad->m_buttons.emplace_back(CELL_PAD_BTN_OFFSET_DIGITAL1, find_key(p_profile->up), CELL_PAD_CTRL_UP);
pad->m_buttons.emplace_back(CELL_PAD_BTN_OFFSET_DIGITAL1, find_key(p_profile->down), CELL_PAD_CTRL_DOWN);
pad->m_buttons.emplace_back(CELL_PAD_BTN_OFFSET_DIGITAL1, find_key(p_profile->left), CELL_PAD_CTRL_LEFT);
pad->m_buttons.emplace_back(CELL_PAD_BTN_OFFSET_DIGITAL1, find_key(p_profile->right), CELL_PAD_CTRL_RIGHT);
pad->m_buttons.emplace_back(CELL_PAD_BTN_OFFSET_DIGITAL2, 0, 0x0); // Reserved

m_dev.axis_left[0] = evdevbutton(p_profile->ls_right);
m_dev.axis_left[1] = evdevbutton(p_profile->ls_left);
m_dev.axis_left[2] = evdevbutton(p_profile->ls_up);
m_dev.axis_left[3] = evdevbutton(p_profile->ls_down);
m_dev.axis_right[0] = evdevbutton(p_profile->rs_right);
m_dev.axis_right[1] = evdevbutton(p_profile->rs_left);
m_dev.axis_right[2] = evdevbutton(p_profile->rs_up);
m_dev.axis_right[3] = evdevbutton(p_profile->rs_down);

pad->m_sticks.emplace_back(CELL_PAD_BTN_OFFSET_ANALOG_LEFT_X, m_dev.axis_left[1].code, m_dev.axis_left[0].code);
pad->m_sticks.emplace_back(CELL_PAD_BTN_OFFSET_ANALOG_LEFT_Y, m_dev.axis_left[3].code, m_dev.axis_left[2].code);
Expand Down

0 comments on commit d161f2d

Please sign in to comment.