From c87f52568d64966cebed1cdaeef61fd729cf751b Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Thu, 24 Mar 2022 14:34:22 +0000 Subject: [PATCH] input-id: Make ID_INPUT_JOYSTICK imply ID_GAME_CONTROLLER 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 #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 (#22681). Signed-off-by: Simon McVittie --- rules.d/60-input-id.rules | 1 + 1 file changed, 1 insertion(+) diff --git a/rules.d/60-input-id.rules b/rules.d/60-input-id.rules index bb8a812d1b7a3..e2afe6ec80265 100644 --- a/rules.d/60-input-id.rules +++ b/rules.d/60-input-id.rules @@ -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"