[systemd-devel] [PATCH v2 1/4] udev: Add rules and hwdb files for setting pointingstick properties
Peter Hutterer
peter.hutterer at who-t.net
Mon Apr 6 21:48:05 PDT 2015
On Fri, Apr 03, 2015 at 04:11:57PM +0200, Hans de Goede wrote:
> There is quite a wide spread in the delta events generated by pointingsticks,
> some generate deltas of 1-2 under normal use, while others generate deltas
> from 1-20.
>
> This commit adds a set of rules + a hwdb file which allows specifying a
> per model POINTINGSTICK_CONST_ACCEL value which can be used by the userspace
> input stack to normalize the deltas so that all pointingsticks get the same
> speed/feeling ootb.
>
> The hwdb matching is modelled after 60-keyboard.rules, rather then after
s/then/than/
Cheers,
Peter
> 70-mouse.rules, as pointingsticks are typically (but not always) found
> integrated into laptops and the keyboard matching rules are a better match
> to this.
> ---
> hwdb/70-pointingstick.hwdb | 59 ++++++++++++++++++++++++++++++++++++++++++++
> rules/70-mouse.rules | 1 +
> rules/70-pointingstick.rules | 16 ++++++++++++
> 3 files changed, 76 insertions(+)
> create mode 100644 hwdb/70-pointingstick.hwdb
> create mode 100644 rules/70-pointingstick.rules
>
> diff --git a/hwdb/70-pointingstick.hwdb b/hwdb/70-pointingstick.hwdb
> new file mode 100644
> index 0000000..a893da6
> --- /dev/null
> +++ b/hwdb/70-pointingstick.hwdb
> @@ -0,0 +1,59 @@
> +# This file is part of systemd.
> +#
> +# Pointingstick const-accel configuration, to make different brand / model
> +# laptop pointingsticks have the same speed / feel, and per model adjustment
> +# of the IBM TrackPoint driver's sensitivty setting
> +#
> +# The lookup keys are composed in:
> +# 70-pointingstick.rules
> +#
> +# Note: The format of the "pointingstick:" prefix match key is a
> +# contract between the rules file and the hardware data, it might
> +# change in later revisions to support more or better matches, it
> +# is not necessarily expected to be a stable ABI.
> +#
> +# Supported hardware matches are:
> +# - Generic input devices match:
> +# pointingstick:input:bZZZZvYYYYpXXXXeWWWW-VVVV
> +# This matches on the kernel modalias of the input-device, mainly:
> +# ZZZZ is the bus-id (see /usr/include/linux/input.h BUS_*), YYYY, XXXX and
> +# WWW are the 4-digit hex uppercase vendor, product and version ID and VVVV
> +# is an arbitrary length input-modalias describing the device capabilities.
> +#
> +# - Input driver device name and DMI data match:
> +# pointingstick:name:<input device name>:dmi:bvn*:bvr*:bd*:svn<vendor>:pn*
> +# <input device name> is the name device specified by the driver,
> +# <vendor> is the firmware-provided string from the kernel DMI modalias.
> +#
> +# To add local entries, create a new file
> +# /etc/udev/hwdb.d/71-pointingstick-local.hwdb
> +# and add your rules there. To load the new rules execute (as root):
> +# udevadm hwdb --update
> +# udevadm trigger /dev/input/eventXX
> +# where /dev/input/eventXX is the pointingstick in question. If in
> +# doubt, simply use /dev/input/event* to reload all input rules.
> +#
> +# If your changes are generally applicable, open a bug report on
> +# http://bugs.freedesktop.org/enter_bug.cgi?product=systemd
> +# and include your new rules, a description of the device, and the
> +# output of
> +# udevadm info /dev/input/eventXX
> +# (or /dev/input/event*).
> +#
> +# Allowed properties are:
> +# POINTINGSTICK_CONST_ACCEL
> +#
> +#########################################
> +# POINTINGSTICK_CONST_ACCEL #
> +#########################################
> +#
> +# Trackpoint const accel settings are specified as
> +# POINTINGSTICK_CONST_ACCEL=<accel>
> +#
> +# Where <accel> is a floating point number, using a '.' seperator, specifying
> +# by how much to multiply deltas generated by the pointingstick to get
> +# normalized deltas.
> +#
> +
> +#
> +# Sort by by brand, model
> diff --git a/rules/70-mouse.rules b/rules/70-mouse.rules
> index 3ea743a..4f1e32d 100644
> --- a/rules/70-mouse.rules
> +++ b/rules/70-mouse.rules
> @@ -3,6 +3,7 @@
> ACTION=="remove", GOTO="mouse_end"
> KERNEL!="event*", GOTO="mouse_end"
> ENV{ID_INPUT_MOUSE}=="", GOTO="mouse_end"
> +ENV{ID_INPUT_POINTINGSTICK}=="1", GOTO="mouse_end"
>
> # mouse:<subsystem>:v<vid>p<pid>:name:<name>:*
> KERNELS=="input*", ENV{ID_BUS}=="usb", \
> diff --git a/rules/70-pointingstick.rules b/rules/70-pointingstick.rules
> new file mode 100644
> index 0000000..5a853f3
> --- /dev/null
> +++ b/rules/70-pointingstick.rules
> @@ -0,0 +1,16 @@
> +# do not edit this file, it will be overwritten on update
> +
> +ACTION=="remove", GOTO="pointingstick_end"
> +KERNEL!="event*", GOTO="pointingstick_end"
> +ENV{ID_INPUT_POINTINGSTICK}=="", GOTO="pointingstick_end"
> +
> +# skip later rules when we find something for this input device
> +IMPORT{builtin}="hwdb --subsystem=input --lookup-prefix=pointingstick:", \
> + GOTO="pointingstick_end"
> +
> +# device matching the input device name and the machine's DMI data
> +KERNELS=="input*", \
> + IMPORT{builtin}="hwdb 'pointingstick:name:$attr{device/name}:$attr{[dmi/id]modalias}'", \
> + GOTO="pointingstick_end"
> +
> +LABEL="pointingstick_end"
> --
> 2.3.4
>
> _______________________________________________
> systemd-devel mailing list
> systemd-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/systemd-devel
>
More information about the systemd-devel
mailing list