Skip to content

Commit 16c3ca5

Browse files
Schwarzbaerrdb
authored andcommitted
device: Fix swapped axes on right stick for Jess Colour Rumble Pad
Closes panda3d#639
1 parent d786709 commit 16c3ca5

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

panda/src/device/evdevInputDevice.cxx

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ enum QuirkBits {
6262
// We only connect it if it is reporting any events, because when Steam is
6363
// running, the Steam controller is muted in favour of a dummy Xbox device.
6464
QB_steam_controller = 32,
65+
66+
// Axes on the right stick are swapped, using x for y and vice versa.
67+
QB_right_axes_swapped = 64,
6568
};
6669

6770
static const struct DeviceMapping {
@@ -81,7 +84,7 @@ static const struct DeviceMapping {
8184
// Steam Controller (wireless)
8285
{0x28de, 0x1142, InputDevice::DeviceClass::unknown, QB_steam_controller},
8386
// Jess Tech Colour Rumble Pad
84-
{0x0f30, 0x0111, InputDevice::DeviceClass::gamepad, 0},
87+
{0x0f30, 0x0111, InputDevice::DeviceClass::gamepad, QB_rstick_from_z | QB_right_axes_swapped},
8588
// SPEED Link SL-6535-SBK-01
8689
{0x0079, 0x0006, InputDevice::DeviceClass::gamepad, 0},
8790
// 8bitdo N30 Pro Controller
@@ -488,7 +491,11 @@ init_device() {
488491
break;
489492
case ABS_Z:
490493
if (quirks & QB_rstick_from_z) {
491-
axis = InputDevice::Axis::right_x;
494+
if (quirks & QB_right_axes_swapped) {
495+
axis = InputDevice::Axis::right_y;
496+
} else {
497+
axis = InputDevice::Axis::right_x;
498+
}
492499
} else if (_device_class == DeviceClass::gamepad) {
493500
axis = InputDevice::Axis::left_trigger;
494501
have_analog_triggers = true;
@@ -514,7 +521,11 @@ init_device() {
514521
break;
515522
case ABS_RZ:
516523
if (quirks & QB_rstick_from_z) {
517-
axis = InputDevice::Axis::right_y;
524+
if (quirks & QB_right_axes_swapped) {
525+
axis = InputDevice::Axis::right_x;
526+
} else {
527+
axis = InputDevice::Axis::right_y;
528+
}
518529
} else if (_device_class == DeviceClass::gamepad) {
519530
axis = InputDevice::Axis::right_trigger;
520531
have_analog_triggers = true;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy