mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 02:15:43 -04:00
input: fixes for 3D mouse axes on Linux
This commit is contained in:
parent
9fbdefe120
commit
2523bb0326
@ -424,17 +424,23 @@ init_device() {
|
|||||||
} else if (_device_class == DC_gamepad) {
|
} else if (_device_class == DC_gamepad) {
|
||||||
axis = InputDevice::C_left_trigger;
|
axis = InputDevice::C_left_trigger;
|
||||||
have_analog_triggers = true;
|
have_analog_triggers = true;
|
||||||
|
} else if (_device_class == DC_3d_mouse) {
|
||||||
|
axis = InputDevice::C_z;
|
||||||
} else {
|
} else {
|
||||||
axis = InputDevice::C_throttle;
|
axis = InputDevice::C_throttle;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ABS_RX:
|
case ABS_RX:
|
||||||
if ((quirks & QB_rstick_from_z) == 0) {
|
if (_device_class == DC_3d_mouse) {
|
||||||
|
axis = InputDevice::C_pitch;
|
||||||
|
} else if ((quirks & QB_rstick_from_z) == 0) {
|
||||||
axis = InputDevice::C_right_x;
|
axis = InputDevice::C_right_x;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ABS_RY:
|
case ABS_RY:
|
||||||
if ((quirks & QB_rstick_from_z) == 0) {
|
if (_device_class == DC_3d_mouse) {
|
||||||
|
axis = InputDevice::C_roll;
|
||||||
|
} else if ((quirks & QB_rstick_from_z) == 0) {
|
||||||
axis = InputDevice::C_right_y;
|
axis = InputDevice::C_right_y;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -513,7 +519,8 @@ init_device() {
|
|||||||
// Also reverse the yaw axis to match right-hand coordinate system.
|
// Also reverse the yaw axis to match right-hand coordinate system.
|
||||||
// Also T.Flight Hotas X throttle is reversed and can go backwards.
|
// Also T.Flight Hotas X throttle is reversed and can go backwards.
|
||||||
if (axis == C_yaw || axis == C_left_y || axis == C_right_y ||
|
if (axis == C_yaw || axis == C_left_y || axis == C_right_y ||
|
||||||
(axis == C_throttle && (quirks & QB_reversed_throttle) != 0)) {
|
(axis == C_throttle && (quirks & QB_reversed_throttle) != 0) ||
|
||||||
|
(_device_class == DC_3d_mouse && (axis == C_y || axis == C_z))) {
|
||||||
swap(absinfo.maximum, absinfo.minimum);
|
swap(absinfo.maximum, absinfo.minimum);
|
||||||
}
|
}
|
||||||
if (axis == C_throttle && (quirks & QB_centered_throttle) != 0) {
|
if (axis == C_throttle && (quirks & QB_centered_throttle) != 0) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user