mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-04-06 06:55:09 +00:00
Input: Implement anti deadzone
This commit is contained in:
parent
5b6f340a7b
commit
c15121377f
16 changed files with 261 additions and 164 deletions
|
|
@ -85,6 +85,8 @@ void evdev_joystick_handler::init_config(cfg_pad* cfg)
|
|||
cfg->pressure_intensity_button.def = ::at32(button_list, NO_BUTTON);
|
||||
|
||||
// Set default misc variables
|
||||
cfg->lstick_anti_deadzone.def = static_cast<u32>(0.13 * thumb_max); // 13%
|
||||
cfg->rstick_anti_deadzone.def = static_cast<u32>(0.13 * thumb_max); // 13%
|
||||
cfg->lstickdeadzone.def = 30; // between 0 and 255
|
||||
cfg->rstickdeadzone.def = 30; // between 0 and 255
|
||||
cfg->ltriggerthreshold.def = 0; // between 0 and 255
|
||||
|
|
@ -1210,8 +1212,8 @@ void evdev_joystick_handler::apply_input_events(const std::shared_ptr<Pad>& pad)
|
|||
u16 lx, ly, rx, ry;
|
||||
|
||||
// Normalize and apply pad squircling
|
||||
convert_stick_values(lx, ly, stick_val[0], stick_val[1], cfg->lstickdeadzone, cfg->lpadsquircling);
|
||||
convert_stick_values(rx, ry, stick_val[2], stick_val[3], cfg->rstickdeadzone, cfg->rpadsquircling);
|
||||
convert_stick_values(lx, ly, stick_val[0], stick_val[1], cfg->lstickdeadzone, cfg->lstick_anti_deadzone, cfg->lpadsquircling);
|
||||
convert_stick_values(rx, ry, stick_val[2], stick_val[3], cfg->rstickdeadzone, cfg->rstick_anti_deadzone, cfg->rpadsquircling);
|
||||
|
||||
pad->m_sticks[0].m_value = lx;
|
||||
pad->m_sticks[1].m_value = 255 - ly;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue