mirror of https://github.com/mgba-emu/mgba.git
Qt: Return active axis values as signs, to ensure sets are consistent
This commit is contained in:
parent
0ae81e6e8f
commit
e80cf92eee
|
@ -136,7 +136,7 @@ QSet<QPair<int, int32_t>> InputController::activeGamepadAxes() {
|
||||||
for (i = 0; i < numButtons; ++i) {
|
for (i = 0; i < numButtons; ++i) {
|
||||||
int32_t axis = SDL_JoystickGetAxis(joystick, i);
|
int32_t axis = SDL_JoystickGetAxis(joystick, i);
|
||||||
if (axis >= AXIS_THRESHOLD || axis <= -AXIS_THRESHOLD) {
|
if (axis >= AXIS_THRESHOLD || axis <= -AXIS_THRESHOLD) {
|
||||||
activeAxes.insert(qMakePair(i, axis));
|
activeAxes.insert(qMakePair(i, axis > 0 ? 1 : -1));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return activeAxes;
|
return activeAxes;
|
||||||
|
|
Loading…
Reference in New Issue