You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bug: Analog joystick axes with 0–65535 range are never detected by the recorder
#1330
I found and tested a possible bug in Input Remapper 2.2.1 related to analog joystick axes using a 0–65535 range.
System
Device: ASUS ROG Xbox Ally X
Distribution: Debian 13 Trixie
Kernel: 7.0.13+deb13-amd64
Input Remapper: 2.2.1
python-evdev: 1.9.1
Input device: ASUSTeK Computer Inc. N-KEY Device
Gamepad interface: /dev/input/event7
Problem
After upgrading the Linux kernel, Input Remapper could correctly record digital buttons, but it was impossible to record analog joystick movements.
Linux itself detected the joysticks correctly.
Running:
evtest /dev/input/event7
showed the following analog axes working correctly:
ABS_X
ABS_Y
ABS_RX
ABS_RY
Input Remapper also received the events correctly when running:
input-remapper-gtk -d
For example, moving the left joystick completely to the right produced:
ABS_X = 65535
However, Input Remapper continued reporting:
pressed: False
direction: 1
even when the joystick reached its maximum value.
Because pressed never became True, the Record function could not record the joystick direction.
The joystick range is approximately:
0 -------- 32768 -------- 65535
center
Suspected cause
The relevant code in:
inputremapper/gui/forward_to_ui_handler.py
contains:
ifabs(event.value-mid_point) <threshold:
For an axis ranging from 0 to 65535, event.value - mid_point represents a distance from the center, while threshold appears to represent an absolute position in the axis range.
This appears to make the comparison incorrect for positive-range axes centered around 32768.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
I found and tested a possible bug in Input Remapper 2.2.1 related to analog joystick axes using a 0–65535 range.
System
7.0.13+deb13-amd642.2.11.9.1ASUSTeK Computer Inc. N-KEY Device/dev/input/event7Problem
After upgrading the Linux kernel, Input Remapper could correctly record digital buttons, but it was impossible to record analog joystick movements.
Linux itself detected the joysticks correctly.
Running:
showed the following analog axes working correctly:
Input Remapper also received the events correctly when running:
For example, moving the left joystick completely to the right produced:
However, Input Remapper continued reporting:
even when the joystick reached its maximum value.
Because
pressednever becameTrue, the Record function could not record the joystick direction.The joystick range is approximately:
Suspected cause
The relevant code in:
contains:
For an axis ranging from 0 to 65535,
event.value - mid_pointrepresents a distance from the center, whilethresholdappears to represent an absolute position in the axis range.This appears to make the comparison incorrect for positive-range axes centered around 32768.
Tested fix
I changed:
to:
After applying this change, Input Remapper immediately started detecting and recording the joystick axes correctly.
The following inputs now work with the Record function:
Digital buttons continue to work correctly as well.
Local patch used
The installed file on Debian was:
The change was:
This fix has been tested successfully on the built-in controller of the ASUS ROG Xbox Ally X.
It may be useful to add tests for analog axes using ranges such as:
as well as asymmetric trigger ranges.
All reactions