summaryrefslogtreecommitdiff
path: root/rules/70-mouse.rules
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2014-11-25 21:35:16 +1000
committerDavid Herrmann <dh.herrmann@gmail.com>2014-11-27 12:30:08 +0100
commit0213a26f656d72ac83eb201f2104726fcfe60eaa (patch)
tree81197cf1b22e35c7d42884550118d54874b68b9f /rules/70-mouse.rules
parent0c124f8b2c93d2c7d6eefca3bdc59b28250fc077 (diff)
hwdb: add a new db for the DPI/frequency settings of mice
Pointer acceleration for relative input devices (mice, trackballs, etc.) applies to the deltas of the device. Alas, those deltas have no physical reference point - a delta of 10 may be caused by a large movement of a low-dpi mouse or by a minute movement of a high-dpi mouse. Which makes pointer acceleration a bit useless and high-dpi devices essentially unusable. In an ideal world, we could read the DPI from the device directly and work with that. In the world we actually live in, we need to compile this list manually. This patch introduces the database, with the usual match formats and a single property to be set on a device: MOUSE_DPI That is either a single value for most mice, or a list of values for mice that can change resolution at runtime. The exact format is detailed in the hwdb file. Note that we're explicitly overshooting the requirements we have for libinput atm. Frequency could be detected in software and we don't actually use the list of multiple resolutions (because we can't detect when they change anyway). However, we might as well collect those values from the get-go, adding/modifying what will eventually amount to hundreds of entries is a bit cumbersome. Note: we rely on the input_id builtin to tag us as mouse first, ordering of the rules is important. (David: fixed up typos and moved hwdb file into ./hwdb/)
Diffstat (limited to 'rules/70-mouse.rules')
-rw-r--r--rules/70-mouse.rules15
1 files changed, 15 insertions, 0 deletions
diff --git a/rules/70-mouse.rules b/rules/70-mouse.rules
new file mode 100644
index 0000000000..0e359e83f1
--- /dev/null
+++ b/rules/70-mouse.rules
@@ -0,0 +1,15 @@
+# do not edit this file, it will be overwritten on update
+
+ACTION=="remove", GOTO="mouse_end"
+KERNEL!="event*", GOTO="mouse_end"
+ENV{ID_INPUT_MOUSE}=="", GOTO="mouse_end"
+
+# mouse:<subsystem>:v<vid>p<pid>:name:<name>:*
+KERNELS=="input*", ENV{ID_BUS}=="usb", \
+ IMPORT{builtin}="hwdb 'mouse:$env{ID_BUS}:v$attr{id/vendor}p$attr{id/product}:name:$attr{name}:'", \
+ GOTO="mouse_end"
+KERNELS=="input*", ENV{ID_BUS}=="bluetooth", \
+ IMPORT{builtin}="hwdb 'mouse:$env{ID_BUS}:v$attr{id/vendor}p$attr{id/product}:name:$attr{name}:'", \
+ GOTO="mouse_end"
+
+LABEL="mouse_end"