mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 19:08:55 -04:00
input: fixes for joysticks in Linux compatibility mode
This commit is contained in:
parent
2523bb0326
commit
96f6bd7fa5
@ -133,6 +133,8 @@ open_device() {
|
|||||||
}
|
}
|
||||||
} else if (handle == GamepadButton::action_a()) {
|
} else if (handle == GamepadButton::action_a()) {
|
||||||
_device_class = DC_gamepad;
|
_device_class = DC_gamepad;
|
||||||
|
} else if (handle == GamepadButton::trigger()) {
|
||||||
|
_device_class = DC_flight_stick;
|
||||||
} else if (handle == GamepadButton::ltrigger()) {
|
} else if (handle == GamepadButton::ltrigger()) {
|
||||||
_ltrigger_button = i;
|
_ltrigger_button = i;
|
||||||
} else if (handle == GamepadButton::rtrigger()) {
|
} else if (handle == GamepadButton::rtrigger()) {
|
||||||
@ -152,17 +154,21 @@ open_device() {
|
|||||||
switch (axmap[i]) {
|
switch (axmap[i]) {
|
||||||
case ABS_X:
|
case ABS_X:
|
||||||
if (_device_class == DC_gamepad) {
|
if (_device_class == DC_gamepad) {
|
||||||
axis = C_left_x;
|
axis = InputDevice::C_left_x;
|
||||||
|
} else if (_device_class == DC_flight_stick) {
|
||||||
|
axis = InputDevice::C_roll;
|
||||||
} else {
|
} else {
|
||||||
axis = C_x;
|
axis = InputDevice::C_x;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ABS_Y:
|
case ABS_Y:
|
||||||
if (_device_class == DC_gamepad) {
|
if (_device_class == DC_gamepad) {
|
||||||
axis = C_left_y;
|
axis = InputDevice::C_left_y;
|
||||||
|
} else if (_device_class == DC_flight_stick) {
|
||||||
|
axis = InputDevice::C_pitch;
|
||||||
} else {
|
} else {
|
||||||
axis = C_y;
|
axis = InputDevice::C_y;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -183,7 +189,11 @@ open_device() {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case ABS_RZ:
|
case ABS_RZ:
|
||||||
axis = C_right_trigger;
|
if (_device_class == DC_gamepad) {
|
||||||
|
axis = InputDevice::C_right_trigger;
|
||||||
|
} else {
|
||||||
|
axis = InputDevice::C_yaw;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ABS_THROTTLE:
|
case ABS_THROTTLE:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user