Adjust L2/R2 button thresholds

This commit is contained in:
j 2024-08-23 15:24:00 +10:00
parent a7503d79a9
commit 86a64648c5
1 changed files with 5 additions and 5 deletions

View File

@ -100,13 +100,13 @@ void GameController::Axis(int id, Input::Axis axis, int value) {
state.axes[axis_id] = value;
// Derive digital buttons from the analog trigger
// Scaled value is 0 .. 255
// Rest point for L2/R2 is usually ~127 but may drift
// It may also differ across controllers
// Use some hysteresis to avoid glitches. 0->255 will also work just slightly later
// Rest point for L2/R2 is ideally 0 but may drift
// Use some hysteresis to avoid glitches
const int ON_THRESHOLD = 150;
const int OFF_THRESHOLD = 135;
const int ON_THRESHOLD = 31; // 255 / 8
const int OFF_THRESHOLD = 16; // 255 / 16 + 1
if (axis == Input::Axis::TriggerLeft) {
LOG_TRACE(Input, "TriggerLeft {}", value);