diff --git a/src/gamepad.cpp b/src/gamepad.cpp index ea818a5b..c1100260 100644 --- a/src/gamepad.cpp +++ b/src/gamepad.cpp @@ -22,7 +22,7 @@ void GamepadInputDevice::step() { ccs.resize(numAxes); for (int i = 0; i < numAxes; i++) { // Allow CC value to go negative, but clamp at -127 instead of -128 for symmetry - int8_t cc = clamp((int) (axes[i] * 127), -127, 127); + int8_t cc = clamp((int) roundf(axes[i] * 127), -127, 127); if (cc != ccs[i]) { ccs[i] = cc;