]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
hwdb: Make 3D mice work out-of-the-box
authorBastien Nocera <hadess@hadess.net>
Fri, 29 Nov 2024 21:20:29 +0000 (22:20 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 3 Dec 2024 18:35:53 +0000 (19:35 +0100)
According to https://en.wikipedia.org/wiki/3Dconnexion, 3D mice are:
human interface devices for manipulating and navigating
computer-generated 3D imagery. These devices are often referred to as
3D motion controllers, 3D navigation devices, 6DOF devices (six
degrees of freedom) or a 3D mouse.

Applications that want to support 3D mice on Linux are expected to
either use spacenavd and its library, or consume the HID output
directly.

This patch makes it possible for a number of applications that use 3D
mice directly to work out of the box, such as PrusaSlicer and its
derivatives.

hwdb.d/70-mouse.hwdb
hwdb.d/parse_hwdb.py
rules.d/70-uaccess.rules.in

index fcd9acd2b450a8ec30d3d316f43f1e660f84adb3..6e2a588a5d3d71b265db8807c9d71bb8f1e9cf67 100644 (file)
@@ -41,6 +41,7 @@
 #   udevadm info /dev/input/eventXX.
 #
 # Allowed properties are:
+#   ID_INPUT_3D_MOUSE
 #   ID_INPUT_TRACKBALL
 #   MOUSE_DPI
 #   MOUSE_WHEEL_CLICK_ANGLE
 #   MOUSE_WHEEL_CLICK_COUNT_HORIZONTAL
 #
 #########################################
+#         ID_INPUT_3D_MOUSE             #
+#########################################
+#
+# Specified if the device is a 3D mouse[1]. This gives access to the
+# hidraw device node to applications that consume its events directly.
+#
+# [1]: See https://en.wikipedia.org/wiki/3Dconnexion for definition
+#
+#########################################
 #         ID_INPUT_TRACKBALL            #
 #########################################
 #
@@ -143,6 +153,34 @@ mouse:*:name:*trackball*:*
 mouse:*:name:*TrackBall*:*
  ID_INPUT_TRACKBALL=1
 
+##########################################
+# 3D Connexion
+##########################################
+# From https://github.com/FreeSpacenav/spacenavd/blob/39856625a6de1e8c4b57c5938e1bf29d13cf1a9f/src/dev.c#L63
+mouse:usb:v046dpc603:name:*
+mouse:usb:v046dpc605:name:*
+mouse:usb:v046dpc606:name:*
+mouse:usb:v046dpc621:name:*
+mouse:usb:v046dpc623:name:*
+mouse:usb:v046dpc625:name:*
+mouse:usb:v046dpc626:name:*
+mouse:usb:v046dpc627:name:*
+mouse:usb:v046dpc628:name:*
+mouse:usb:v046dpc629:name:*
+mouse:usb:v046dpc62b:name:*
+mouse:usb:v046dpc640:name:*
+mouse:usb:v256fpc62e:name:*
+mouse:usb:v256fpc62f:name:*
+mouse:usb:v256fpc631:name:*
+mouse:usb:v256fpc632:name:*
+mouse:usb:v256fpc633:name:*
+mouse:usb:v256fpc635:name:*
+mouse:usb:v256fpc636:name:*
+ ID_INPUT_3D_MOUSE=1
+
+mouse:bluetooth:v256fpc63a:name:*
+ ID_INPUT_3D_MOUSE=1
+
 ##########################################
 # Apple
 ##########################################
index b2580c8dcf03e97de0178f1e8664c7543765c78c..b4de194ba456d9f129527d72da6f8f5d75f7c2c4 100755 (executable)
@@ -155,6 +155,7 @@ def property_grammar():
              ('MOUSE_WHEEL_CLICK_ANGLE_HORIZONTAL', INTEGER),
              ('MOUSE_WHEEL_CLICK_COUNT', INTEGER),
              ('MOUSE_WHEEL_CLICK_COUNT_HORIZONTAL', INTEGER),
+             ('ID_INPUT_3D_MOUSE', Or((Literal('0'), Literal('1')))),
              ('ID_AUTOSUSPEND', Or((Literal('0'), Literal('1')))),
              ('ID_AUTOSUSPEND_DELAY_MS', INTEGER),
              ('ID_AV_PRODUCTION_CONTROLLER', Or((Literal('0'), Literal('1')))),
index cf68c951775d2fe8cb289ed2eaa5e13380059d1d..0945eaf38c3fc306f602655c071473034498ba51 100644 (file)
@@ -103,4 +103,8 @@ SUBSYSTEM=="usb", ENV{ID_AV_PRODUCTION_CONTROLLER}=="1", TAG+="uaccess"
 SUBSYSTEM=="usb", ENV{ID_HARDWARE_WALLET}=="1", TAG+="uaccess"
 SUBSYSTEM=="hidraw", ENV{ID_HARDWARE_WALLET}=="1", TAG+="uaccess"
 
+# 3D mice
+# As defined in https://en.wikipedia.org/wiki/3Dconnexion
+SUBSYSTEM=="hidraw", ENV{ID_INPUT_3D_MOUSE}=="1", TAG+="uaccess"
+
 LABEL="uaccess_end"