Qt: Return active axis values as signs, to ensure sets are consistent

This commit is contained in:
Jeffrey Pfau 2014-12-18 01:20:08 -08:00
parent 0ae81e6e8f
commit e80cf92eee
1 changed files with 1 additions and 1 deletions

View File

@ -136,7 +136,7 @@ QSet<QPair<int, int32_t>> InputController::activeGamepadAxes() {
for (i = 0; i < numButtons; ++i) {
int32_t axis = SDL_JoystickGetAxis(joystick, i);
if (axis >= AXIS_THRESHOLD || axis <= -AXIS_THRESHOLD) {
activeAxes.insert(qMakePair(i, axis));
activeAxes.insert(qMakePair(i, axis > 0 ? 1 : -1));
}
}
return activeAxes;