Skip to content

Commit

Permalink
input-id: Make ID_INPUT_JOYSTICK imply ID_GAME_CONTROLLER
Browse files Browse the repository at this point in the history
ID_INPUT_JOYSTICK refers to "joysticks", which for historical reasons is
the name given by the Linux kernel and udev to most game-oriented input
devices, including flight sticks, gamepads, steering wheels and so on
(but not accelerometers or gyroscopes that have axes but no buttons,
even if they are part of a gamepad with motion controls such as a
PS3/PS4/PS5 controller).

My intention is for ID_GAME_CONTROLLER to be a generalization of this,
applying to anything that a gamer would think of as a dedicated gaming
controller, for example:

* all "joysticks", including gamepads, steering wheels and so on
* the accelerometer that provides motion controls in a PS3/PS4/PS5
  controller, which is part of the same HID device but exposed as a
  separate evdev device node by the Linux kernel (see systemd#17691)
* the EDTracker, which is an Arduino-based accelerometer designed to
  be used for head tracking by Elite:Dangerous players (see
  ValveSoftware/steam-for-linux#8443)

However, ID_GAME_CONTROLLER should not include accelerometers used to
detect the orientation of a laptop/tablet, because those are not really a
gaming device (admittedly people have sometimes hooked up older Thinkpads'
HDAPS accelerometers to control games by tilting the laptop, but that
seems like something that's reasonable to have to configure for yourself).

I've named this without the INPUT_ prefix with the intention that it
can be applied to both evdev devices and hidraw devices (systemd#22681).

Signed-off-by: Simon McVittie <[email protected]>
  • Loading branch information
smcv committed Mar 24, 2022
1 parent d011331 commit c87f525
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions rules.d/60-input-id.rules
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ ACTION=="remove", GOTO="id_input_end"

SUBSYSTEM=="input", ENV{ID_INPUT}=="", IMPORT{builtin}="input_id"
SUBSYSTEM=="input", IMPORT{builtin}="hwdb --subsystem=input --lookup-prefix=id-input:modalias:"
SUBSYSTEM=="input", ENV{ID_INPUT_JOYSTICK}=="1", ENV{ID_GAME_CONTROLLER}="1"

LABEL="id_input_end"

0 comments on commit c87f525

Please sign in to comment.