Compare commits

...

25 Commits

Author SHA1 Message Date
Peter Hutterer
ac862672e4 Add support for the libinput plugin system
This is hardcoded to be enabled from the default paths (/usr/share and
/etc) without any extra paths. If there is a need we can add xorg.conf
options later but for now it will do.

Part-of: <https://gitlab.freedesktop.org/xorg/driver/xf86-input-libinput/-/merge_requests/73>
2025-11-05 09:25:10 +10:00
Peter Hutterer
c169537717 CI: drop the merge request check
Effectively obsolete and now broken, see
https://gitlab.freedesktop.org/freedesktop/ci-templates/-/issues/81

Part-of: <https://gitlab.freedesktop.org/xorg/driver/xf86-input-libinput/-/merge_requests/75>
2025-10-24 14:54:57 +10:00
Peter Hutterer
79b62f322a CI: bump to latest ci-templates and latest Fedora
Part-of: <https://gitlab.freedesktop.org/xorg/driver/xf86-input-libinput/-/merge_requests/74>
2025-10-24 11:22:54 +10:00
Peter Hutterer
6612ab7e97 meson.build: add dep_libinput as dependency for the KANA check
So meson can find the libinput.h header if libinput is in a nonstandard
path.

Fixes: 0bcb60e744 ("Add support for LIBINPUT_LED_COMPOSE/LIBINPUT_LED_KANA")
Part-of: <https://gitlab.freedesktop.org/xorg/driver/xf86-input-libinput/-/merge_requests/72>
2025-10-23 09:31:45 +10:00
Peter Hutterer
709d0b0a9a meson.build: install the libinput-properties.h file
Patch provided by Brice De Bruyne

Closes #67

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Part-of: <https://gitlab.freedesktop.org/xorg/driver/xf86-input-libinput/-/merge_requests/71>
2025-06-24 15:33:33 +10:00
Alan Coopersmith
9c64c0236c Improve man page formatting
More closely follow common style as described on
https://man7.org/linux/man-pages/man7/man-pages.7.html
and fix warnings raised by `mandoc -T lint` and `groff -rCHECKSTYLE=10`

Part-of: <https://gitlab.freedesktop.org/xorg/driver/xf86-input-libinput/-/merge_requests/70>
2025-06-01 09:32:20 -07:00
Enrico Weigelt, metux IT consult
c674db53d9 fix unused variable click_methods
This variable is only used under certain (build-time) conditions,
so need needs to be defined/assigned under those.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/driver/xf86-input-libinput/-/merge_requests/65>
2025-04-16 23:16:53 +00:00
Enrico Weigelt, metux IT consult
8a63e97e0c ci: fix missing diffutils
> checking if gcc supports -fno-rtti -fno-exceptions... /builds/metux/xf86-input-libinput/_builddir/../configure: line 8891: diff: command not found

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/driver/xf86-input-libinput/-/merge_requests/67>
2025-04-16 15:41:43 +02:00
Peter Hutterer
c712930ef4 xf86-input-libinput 1.5.0
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2024-10-15 14:06:00 +10:00
Peter Hutterer
db7cfbe5c2 test: fix some scan-build warnings
e.g.
../../../test/test-draglock.c:262:2: warning: Value stored to 'rc' is never read [deadcode.DeadStores]
  262 |         rc = draglock_init_from_string(&dl, "10");
2024-10-15 13:58:18 +10:00
Peter Hutterer
cb80d7f82d Map some specific high keycodes into the FK20-23 range
These mappings have been part of xkeyboard-config for over a decade and
the likely reason they were introduced is that the corresponding evdev
keycode is > 255.

Let's forcibly remap those in the driver here so the rest of the system
can switch to the real keycodes instead of having to map them to the
whatever X expects.

See https://github.com/systemd/systemd/pull/34325/

Part-of: <https://gitlab.freedesktop.org/xorg/driver/xf86-input-libinput/-/merge_requests/62>
2024-10-09 23:25:17 +00:00
Peter Hutterer
7c5635cd6f Silence a compiler warning
../src/xf86libinput.c: In function ‘prop_draglock_set_pairs’:
../src/xf86libinput.c:5153:30: warning: comparison is always false due to limited range of data type [-Wtype-limits]
 5153 |                 if (pairs[i] > MAX_BUTTONS)

MAX_BUTTONS is defined by the server so let's use a temporary local
variable to silence the compiler.

Part-of: <https://gitlab.freedesktop.org/xorg/driver/xf86-input-libinput/-/merge_requests/61>
2024-10-09 14:02:44 +10:00
Peter Hutterer
b396ba3697 Prevent theoretical null-pointer dereference
Cannot happen since we don't enter this function if the atom isn't one
of the three checked above but the static analyzer doesn't know that.

Part-of: <https://gitlab.freedesktop.org/xorg/driver/xf86-input-libinput/-/merge_requests/60>
2024-09-13 03:06:20 +00:00
Martin Rys
0bcb60e744 Add support for LIBINPUT_LED_COMPOSE/LIBINPUT_LED_KANA
Added in libinput 1.26

Part-of: <https://gitlab.freedesktop.org/xorg/driver/xf86-input-libinput/-/merge_requests/58>
2024-09-12 09:31:01 +10:00
Peter Hutterer
3a33984cce Fix a bunch of whitespace issues
xf86libinput_kbd_ctrl() in particular was a copy/paste with 4-space
indentation, the rest is mostly space->tab replacement.

As pointed out in !58

Part-of: <https://gitlab.freedesktop.org/xorg/driver/xf86-input-libinput/-/merge_requests/59>
2024-09-06 10:14:31 +10:00
Peter Hutterer
bb41cc730c Add support for clickfinger button maps 2024-07-19 11:44:49 +10:00
Peter Hutterer
72c8eb25f8 Implement tablet tool pressure range support 2024-06-10 09:27:57 +00:00
Peter Hutterer
74335c6fd6 Revert "fix int type mismatches in printf()-like calls"
This now warns on 64-bit machines:
../src/xf86libinput.c:542:61: warning: format ‘%lu’ expects argument
of type ‘long unsigned int’, but argument 4 has type ‘CARD32’ {aka ‘unsigned int’} [-Wformat=]

Given they vastly outnumber 32-bit machines now, let's go back to the
old one that only warns on 32 bit until we fix the actual source types
to use uint32_t and similar.

This reverts commit a7d2994256.
2024-06-07 11:14:17 +10:00
Enrico Weigelt, metux IT consult
b791b30b1f update .gitignore
"test/test-bezier" was yet missing

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-02-21 13:21:09 +01:00
Enrico Weigelt, metux IT consult
a7d2994256 fix int type mismatches in printf()-like calls
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-02-21 13:21:09 +01:00
Enrico Weigelt, metux IT consult
c6b4d2732f replace BUG_() macros by xf86IDrvMsg() calls
Latest master moved the BUG_() macros out of os.h, and it's more appropriate
to use xf86IDrvMsg() in those cases (like we're already doing in other places)
anyways.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2024-02-21 13:19:47 +01:00
Peter Hutterer
6ed6814489 gitlab CI: update to latest templates and current fedora 2024-02-20 08:24:15 +10:00
Peter Hutterer
a24f467576 Add editorconfig file 2024-02-20 08:22:16 +10:00
Peter Hutterer
b254d491e2 Add a property for the tablet tool serial and hw ID
The driver encodes the serial in the device name but that's not reliable
enough. Expose both serial and tool id (optional) as a property so
clients can read them and adjust their behavior accordingly.

Fixes #16
2023-11-10 08:17:46 +10:00
Peter Hutterer
0dc42f0e4e Sort the read-only properties 2023-11-10 08:16:59 +10:00
9 changed files with 853 additions and 288 deletions

17
.editorconfig Normal file
View File

@@ -0,0 +1,17 @@
# https://editorconfig.org/
root = true
[*]
charset = utf-8
end_of_line = lf
trim_trailing_whitespace = true
insert_final_newline = true
[*.{c,h}]
indent_size = 8
indent_style = tab
[{meson.build,meson_options.txt}]
indent_size = 8
indent_style = tab

1
.gitignore vendored
View File

@@ -84,3 +84,4 @@ core
test-driver test-driver
tags tags
.vimdir .vimdir
test/test-bezier

View File

@@ -4,7 +4,7 @@
# Please see the ci-templates documentation for details: # Please see the ci-templates documentation for details:
# https://freedesktop.pages.freedesktop.org/ci-templates/ # https://freedesktop.pages.freedesktop.org/ci-templates/
.templates_sha: &template_sha c5626190ec14b475271288dda7a7dae8dbe0cd76 # see https://docs.gitlab.com/ee/ci/yaml/#includefile .templates_sha: &template_sha fb9d50ccb3cbbb4c6dc5f9ef53a0ad3cb0d8a177
include: include:
- project: 'freedesktop/ci-templates' - project: 'freedesktop/ci-templates'
@@ -26,10 +26,10 @@ stages:
.fedora: .fedora:
variables: variables:
FDO_DISTRIBUTION_VERSION: 33 FDO_DISTRIBUTION_VERSION: 43
FDO_DISTRIBUTION_PACKAGES: 'git autoconf automake libtool make xorg-x11-server-devel libudev-devel libevdev-devel libinput-devel xorg-x11-util-macros' FDO_DISTRIBUTION_PACKAGES: 'git autoconf automake libtool make xorg-x11-server-devel libudev-devel libevdev-devel libinput-devel xorg-x11-util-macros diffutils'
FDO_DISTRIBUTION_EXEC: 'env FDO_CI_CONCURRENT=${FDO_CI_CONCURRENT} bash .gitlab-ci/fedora-install.sh' FDO_DISTRIBUTION_EXEC: 'env FDO_CI_CONCURRENT=${FDO_CI_CONCURRENT} bash .gitlab-ci/fedora-install.sh'
FDO_DISTRIBUTION_TAG: '2021-09-15.0' FDO_DISTRIBUTION_TAG: '2025-10-24.0'
fedora@container_build: fedora@container_build:
@@ -58,7 +58,7 @@ fedora@container_build:
- _builddir/config.log - _builddir/config.log
fedora:33@default-build: fedora@default-build:
extends: extends:
- .fedora - .fedora
- .fdo.distribution-image@fedora - .fdo.distribution-image@fedora
@@ -81,18 +81,3 @@ check-commits:
reports: reports:
junit: results.xml junit: results.xml
allow_failure: true allow_failure: true
#
# Verify that the merge request has the allow-collaboration checkbox ticked
#
check-merge-request:
extends:
- .fdo.ci-fairy
stage: test
script:
- ci-fairy check-merge-request --require-allow-collaboration --junit-xml=results.xml
artifacts:
when: on_failure
reports:
junit: results.xml
allow_failure: true

View File

@@ -23,7 +23,7 @@
# Initialize Autoconf # Initialize Autoconf
AC_PREREQ([2.60]) AC_PREREQ([2.60])
AC_INIT([xf86-input-libinput], AC_INIT([xf86-input-libinput],
[1.4.0], [1.5.0],
[https://gitlab.freedesktop.org/xorg/driver/xf86-input-libinput/issues], [https://gitlab.freedesktop.org/xorg/driver/xf86-input-libinput/issues],
[xf86-input-libinput]) [xf86-input-libinput])
AC_CONFIG_SRCDIR([Makefile.am]) AC_CONFIG_SRCDIR([Makefile.am])
@@ -89,6 +89,39 @@ AC_LINK_IFELSE(
[AC_MSG_RESULT([no]) [AC_MSG_RESULT([no])
[libinput_have_custom_accel=no]]) [libinput_have_custom_accel=no]])
AC_MSG_CHECKING([if libinput_tablet_tool_config_pressure_range_set is available])
AC_LINK_IFELSE(
[AC_LANG_PROGRAM([[#include <libinput.h>]],
[[libinput_tablet_tool_config_pressure_range_set(0)]])],
[AC_MSG_RESULT([yes])
AC_DEFINE(HAVE_LIBINPUT_PRESURE_RANGE, [1],
[libinput_tablet_tool_config_pressure_range_set() is available])
[libinput_have_pressure_range=yes]],
[AC_MSG_RESULT([no])
[libinput_have_pressure_range=no]])
AC_MSG_CHECKING([if libinput_device_config_click_set_clickfinger_button_map is available])
AC_LINK_IFELSE(
[AC_LANG_PROGRAM([[#include <libinput.h>]],
[[libinput_device_config_click_set_clickfinger_button_map(NULL, 0)]])],
[AC_MSG_RESULT([yes])
AC_DEFINE(HAVE_LIBINPUT_CLICKFINGER_BUTTON_MAP, [1],
[libinput_device_config_click_set_clickfinger_button_map() is available])
[libinput_have_clickfinger_button_map=yes]],
[AC_MSG_RESULT([no])
[libinput_have_clickfinger_button_map=no]])
AC_MSG_CHECKING([if libinput_plugin_system_load is available])
AC_LINK_IFELSE(
[AC_LANG_PROGRAM([[#include <libinput.h>]],
[[libinput_plugin_system_load_plugins(NULL, 0)]])],
[AC_MSG_RESULT([yes])
AC_DEFINE(HAVE_LIBINPUT_PLUGINS, [1],
[libinput_plugin_system_load_plugins() is available])
[libinput_have_plugin_system=yes]],
[AC_MSG_RESULT([no])
[libinput_have_plugin_system=no]])
LIBS=$OLD_LIBS LIBS=$OLD_LIBS
CFLAGS=$OLD_CFLAGS CFLAGS=$OLD_CFLAGS

View File

@@ -51,6 +51,13 @@
/* Tap button default order: BOOL, 2 values in order LRM, LMR, read-only */ /* Tap button default order: BOOL, 2 values in order LRM, LMR, read-only */
#define LIBINPUT_PROP_TAP_BUTTONMAP_DEFAULT "libinput Tapping Button Mapping Default" #define LIBINPUT_PROP_TAP_BUTTONMAP_DEFAULT "libinput Tapping Button Mapping Default"
/* Clickfinger button order: BOOL, 2 values in order LRM, LMR, only one may be set
at any time */
#define LIBINPUT_PROP_CLICKFINGER_BUTTONMAP "libinput Clickfinger Button Mapping Enabled"
/* Clickfinger button default order: BOOL, 2 values in order LRM, LMR, read-only */
#define LIBINPUT_PROP_CLICKFINGER_BUTTONMAP_DEFAULT "libinput Clickfinger Button Mapping Default"
/* Calibration matrix: FLOAT, 9 values of a 3x3 matrix, in rows */ /* Calibration matrix: FLOAT, 9 values of a 3x3 matrix, in rows */
#define LIBINPUT_PROP_CALIBRATION "libinput Calibration Matrix" #define LIBINPUT_PROP_CALIBRATION "libinput Calibration Matrix"
@@ -222,6 +229,15 @@
*/ */
#define LIBINPUT_PROP_TABLET_TOOL_PRESSURECURVE "libinput Tablet Tool Pressurecurve" #define LIBINPUT_PROP_TABLET_TOOL_PRESSURECURVE "libinput Tablet Tool Pressurecurve"
/* Tablet tool pressure range: float, 2 values, 32 bit
* Value range is [0.0, 1.0] for min and max physical pressure to map to the logical range
* Default value: 0.0 1.0
*/
#define LIBINPUT_PROP_TABLET_TOOL_PRESSURE_RANGE "libinput Tablet Tool Pressure Range"
/* Tablet tool pressure range: float, 2 values, 32 bit, read-only */
#define LIBINPUT_PROP_TABLET_TOOL_PRESSURE_RANGE_DEFAULT "libinput Tablet Tool Pressure Range Default"
/* Tablet tool area ratio: CARD32, 2 values, w and h */ /* Tablet tool area ratio: CARD32, 2 values, w and h */
#define LIBINPUT_PROP_TABLET_TOOL_AREA_RATIO "libinput Tablet Tool Area Ratio" #define LIBINPUT_PROP_TABLET_TOOL_AREA_RATIO "libinput Tablet Tool Area Ratio"
@@ -229,4 +245,19 @@
* If disabled, high-resolution wheel scroll events are discarded */ * If disabled, high-resolution wheel scroll events are discarded */
#define LIBINPUT_PROP_HIRES_WHEEL_SCROLL_ENABLED "libinput High Resolution Wheel Scroll Enabled" #define LIBINPUT_PROP_HIRES_WHEEL_SCROLL_ENABLED "libinput High Resolution Wheel Scroll Enabled"
/* The tablet tool unique serial number: CARD32, 1 value, constant for the
* lifetime of the device.
*
* If this property exists and is zero, the tool does not have a unique serial
* number.
*/
#define LIBINPUT_PROP_TABLET_TOOL_SERIAL "libinput Tablet Tool Serial"
/* The tablet tool hardware ID: CARD32, 1 value, constant for the lifetime of the device.
*
* This property only exists if the device has a known tool ID.
* See libinput_tablet_tool_get_tool_id() in the libinput documentation for details.
*/
#define LIBINPUT_PROP_TABLET_TOOL_ID "libinput Tablet Tool ID"
#endif /* _LIBINPUT_PROPERTIES_H_ */ #endif /* _LIBINPUT_PROPERTIES_H_ */

View File

@@ -1,6 +1,7 @@
'\" t
.\" shorthand for double quote that works everywhere. .\" shorthand for double quote that works everywhere.
.ds q \N'34' .ds q \N'34'
.TH LIBINPUT 4 @VERSION@ .TH LIBINPUT 4 2025-06-01 "@VERSION@"
.SH NAME .SH NAME
libinput \- libinput-based X.Org input driver libinput \- libinput-based X.Org input driver
.SH SYNOPSIS .SH SYNOPSIS
@@ -14,42 +15,50 @@ libinput \- libinput-based X.Org input driver
.fi .fi
.SH NOTE .SH NOTE
This is the man page for the X input driver. If you are looking for the This is the man page for the X input driver.
library documentation, go to If you are looking for the library documentation, go to
.BI http://wayland.freedesktop.org/libinput/doc/ .B http://wayland.freedesktop.org/libinput/doc/
.SH DESCRIPTION .SH DESCRIPTION
.B libinput .B libinput
is an Xorg input driver based on libinput. It is an Xorg input driver based on libinput.
therefore supports all input devices that libinput can handle, including It therefore supports all input devices that libinput can handle, including
most mice, keyboards, tablets and touchscreens. most mice, keyboards, tablets and touchscreens.
.PP .PP
It is recommended that It is recommended that
.B libinput .B libinput
devices are configured through the devices are configured through the
.B InputClass .B InputClass
directive (refer to xorg.conf(5)) instead of manual directive (refer to
per-device configuration. Devices configured in the .BR xorg.conf (5))
xorg.conf(5) are not hot-plug capable. instead of manual per-device configuration.
Devices configured using the
.B InputDevice
directive in the
.BR xorg.conf (5)
file are not hot-plug capable.
.SH CONFIGURATION DETAILS .SH CONFIGURATION DETAILS
Please refer to xorg.conf(5) for general configuration Please refer to
details and for options that can be used with all input drivers. This .BR xorg.conf (5)
section only covers configuration details specific to this driver. for general configuration details
and for options that can be used with all input drivers.
This section only covers configuration details specific to this driver.
.PP .PP
The following driver The following driver
.B Options .B Options
are supported: are supported:
.TP 7 .TP 7
.BI "Option \*qAccelProfile\*q \*q" string \*q .BI "Option \*qAccelProfile\*q \*q" string \*q
Sets the pointer acceleration profile to the given profile. Permitted values Sets the pointer acceleration profile to the given profile.
are Permitted values are
.BI adaptive, .BR adaptive ,
.BI flat, .BR flat ,
.BI custom. .BR custom .
Not all devices support this option or all profiles. If a profile is Not all devices support this option or all profiles.
unsupported, the default profile for this device is used. For a description If a profile is unsupported, the default profile for this device is used.
on the profiles and their behavior, see the libinput documentation. For a description on the profiles and their behavior,
see the libinput documentation.
.TP 7 .TP 7
.BI "Option \*qAccelSpeed\*q \*q" float \*q .BI "Option \*qAccelSpeed\*q \*q" float \*q
Sets the pointer acceleration speed within the range [-1, 1]. Sets the pointer acceleration speed within the range [-1, 1].
@@ -61,7 +70,8 @@ This only applies to the flat or adaptive profile.
.TQ .TQ
.BI "Option \*qAccelPointsScroll\*q \*q" string \*q .BI "Option \*qAccelPointsScroll\*q \*q" string \*q
Sets the points of the Fallback/Motion/Scroll acceleration functions. Sets the points of the Fallback/Motion/Scroll acceleration functions.
The string must be a space-separated list of floating point non-negative numbers, e.g. The string must be a space-separated list of
floating point non-negative numbers, e.g.,
"0.0 1.0 2.4 2.5". "0.0 1.0 2.4 2.5".
This only applies to the custom profile. This only applies to the custom profile.
See section See section
@@ -72,22 +82,26 @@ See section
.BI "Option \*qAccelStepMotion\*q \*q" float \*q .BI "Option \*qAccelStepMotion\*q \*q" float \*q
.TQ .TQ
.BI "Option \*qAccelStepScroll\*q \*q" float \*q .BI "Option \*qAccelStepScroll\*q \*q" float \*q
Sets the step between the points of the Fallback/Motion/Scroll acceleration functions. Sets the step between the points of the Fallback/Motion/Scroll
When a step of 0.0 is provided, libinput's Fallback acceleration function is used. acceleration functions.
When a step of 0.0 is provided,
libinput's Fallback acceleration function is used.
This only applies to the custom profile. This only applies to the custom profile.
See section See section
.B CUSTOM ACCELERATION PROFILE .B CUSTOM ACCELERATION PROFILE
.TP 7 .TP 7
.BI "Option \*qButtonMapping\*q \*q" string \*q .BI "Option \*qButtonMapping\*q \*q" string \*q
Sets the logical button mapping for this device, see Sets the logical button mapping for this device, see
XSetPointerMapping(3). The string must be a .BR XSetPointerMapping (3).
space-separated list of button mappings in the order of the The string must be a space-separated list of button mappings in the order of the
logical buttons on the device, starting with button 1. logical buttons on the device, starting with button 1.
The default mapping is "1 2 3 ... 32". A mapping of 0 The default mapping is "1 2 3 ... 32".
deactivates the button. Multiple buttons can have the same mapping. A mapping of 0 deactivates the button.
Multiple buttons can have the same mapping.
Invalid mapping strings are discarded and the default mapping Invalid mapping strings are discarded and the default mapping
is used for all buttons. Buttons not specified in the user's mapping use the is used for all buttons.
default mapping. See section Buttons not specified in the user's mapping use the default mapping.
See section
.B BUTTON MAPPING .B BUTTON MAPPING
for more details. for more details.
.TP 7 .TP 7
@@ -98,44 +112,49 @@ Sets the calibration matrix to the 3x3 matrix where the first row is (abc),
the second row is (def) and the third row is (ghi). the second row is (def) and the third row is (ghi).
.TP 7 .TP 7
.BI "Option \*qClickMethod\*q \*q" string \*q .BI "Option \*qClickMethod\*q \*q" string \*q
Enables a click method. Permitted values are Enables a click method.
.BI none, Permitted values are
.BI buttonareas, .BR none ,
.BI clickfinger. .BR buttonareas ,
Not all devices support all methods, if an option is unsupported, the .BR clickfinger .
default click method for this device is used. Not all devices support all methods.
If an option is unsupported, the default click method for this device is used.
.TP 7 .TP 7
.BI "Option \*qDisableWhileTyping\*q \*q" bool \*q .BI "Option \*qDisableWhileTyping\*q \*q" bool \*q
Indicates if the touchpad should be disabled while typing on the keyboard Indicates if the touchpad should be disabled while typing on the keyboard
(this does not apply to modifier keys such as Ctrl or Alt). (this does not apply to modifier keys such as Ctrl or Alt).
.TP 7 .TP 7
.BI "Option \*qDevice\*q \*q" string \*q .BI "Option \*qDevice\*q \*q" string \*q
Specifies the device through which the device can be accessed. This will Specifies the device through which the device can be accessed.
generally be of the form \*q/dev/input/eventX\*q, where X is some integer. This will generally be of the form \*q/dev/input/eventX\*q,
where X is some integer.
When using When using
.B InputClass .B InputClass
directives, this option is set by the server. directives, this option is set by the server.
The mapping from device node to hardware is system-dependent. Property: The mapping from device node to hardware is system-dependent.
"Device Node" (read-only). Property: "Device Node" (read-only).
.TP 7 .TP 7
.BI "Option \*qDragLockButtons\*q \*q" "L1 B1 L2 B2 ..." \*q .BI "Option \*qDragLockButtons\*q \*q" "L1 B1 L2 B2 ..." \*q
Sets "drag lock buttons" that simulate a button logically down even when it has Sets "drag lock buttons" that simulate a button logically down even when it has
been physically released. To logically release a locked button, a second click been physically released.
of the same button is required. To logically release a locked button,
a second click of the same button is required.
.IP .IP
If the option is a single button number, that button acts as the If the option is a single button number, that button acts as the
"meta" locking button for the next button number. See section "meta" locking button for the next button number.
See section
.B BUTTON DRAG LOCK .B BUTTON DRAG LOCK
for details. for details.
.IP .IP
If the option is a list of button number pairs, the first number of each If the option is a list of button number pairs, the first number of each
number pair is the lock button, the second number the logical button number number pair is the lock button, the second number the logical button number
to be locked. See section to be locked.
See section
.B BUTTON DRAG LOCK .B BUTTON DRAG LOCK
for details. for details.
.IP .IP
For both meta and button pair configuration, the button numbers are For both meta and button pair configuration,
device button numbers, i.e. the the button numbers are device button numbers, i.e. the
.B ButtonMapping .B ButtonMapping
applies after drag lock. applies after drag lock.
.TP 7 .TP 7
@@ -145,77 +164,96 @@ the driver forwards only high-resolution wheel scroll events from libinput.
When disabled, the driver forwards legacy wheel scroll events instead. When disabled, the driver forwards legacy wheel scroll events instead.
.TP 7 .TP 7
.BI "Option \*qHorizontalScrolling\*q \*q" bool \*q .BI "Option \*qHorizontalScrolling\*q \*q" bool \*q
Enables or disables horizontal scrolling. When disabled, this driver will Enables or disables horizontal scrolling.
discard any horizontal scroll events from libinput. This does not disable When disabled,
horizontal scroll events from libinput; it merely discards the horizontal axis this driver will discard any horizontal scroll events from libinput.
from any scroll events. Default is enabled. This does not disable horizontal scroll events from libinput;
it merely discards the horizontal axis from any scroll events.
Default is enabled.
.TP 7 .TP 7
.BI "Option \*qLeftHanded\*q \*q" bool \*q .BI "Option \*qLeftHanded\*q \*q" bool \*q
Enables left-handed button orientation, i.e. swapping left and right buttons. Enables left-handed button orientation, i.e. swapping left and right buttons.
.TP 7 .TP 7
.BI "Option \*qMiddleEmulation\*q \*q" bool \*q .BI "Option \*qMiddleEmulation\*q \*q" bool \*q
Enables middle button emulation. When enabled, pressing the left and right Enables middle button emulation.
When enabled, pressing the left and right
buttons simultaneously produces a middle mouse button click. buttons simultaneously produces a middle mouse button click.
.TP 7 .TP 7
.BI "Option \*qNaturalScrolling\*q \*q" bool \*q .BI "Option \*qNaturalScrolling\*q \*q" bool \*q
Enables or disables natural scrolling behavior. Enables or disables natural scrolling behavior.
.TP 7 .TP 7
.BI "Option \*qRotationAngle\*q \*q" float \*q .BI "Option \*qRotationAngle\*q \*q" float \*q
Sets the rotation angle of the device to the given angle, in degrees Sets the rotation angle of the device to the given angle, in degrees clockwise.
clockwise. The angle must be between 0.0 (inclusive) and 360.0 (exclusive). The angle must be between 0.0 (inclusive) and 360.0 (exclusive).
.TP 7 .TP 7
.BI "Option \*qScrollButton\*q \*q" int \*q .BI "Option \*qScrollButton\*q \*q" int \*q
Designates a button as scroll button. If the Designates a button as scroll button.
.BI ScrollMethod If the
.B ScrollMethod
is is
.BI button .B button
and the button is logically down, x/y axis movement is converted into and the button is logically down, x/y axis movement is converted into
scroll events. scroll events.
.TP 7 .TP 7
.BI "Option \*qScrollButtonLock\*q \*q" bool \*q .BI "Option \*qScrollButtonLock\*q \*q" bool \*q
Enables or disables the scroll button lock. If enabled, the Enables or disables the scroll button lock.
.BI ScrollButton If enabled, the
.B ScrollButton
is considered logically down after the first click and remains down until is considered logically down after the first click and remains down until
the second click of that button. If disabled (the default), the the second click of that button.
.BI ScrollButton If disabled (the default), the
.B ScrollButton
button is considered logically down while held down and up once physically button is considered logically down while held down and up once physically
released. released.
.TP 7 .TP 7
.BI "Option \*qScrollMethod\*q \*q" string \*q .BI "Option \*qScrollMethod\*q \*q" string \*q
Enables a scroll method. Permitted values are Enables a scroll method. Permitted values are
.BI none, .BR none ,
.BI twofinger, .BR twofinger ,
.BI edge, .BR edge ,
.BI button. .BR button .
Not all devices support all options, if an option is unsupported, the Not all devices support all options.
default scroll option for this device is used. If an option is unsupported, the default scroll option for this device is used.
.TP 7 .TP 7
.BI "Option \*qScrollPixelDistance\*q \*q" int \*q .BI "Option \*qScrollPixelDistance\*q \*q" int \*q
Sets the movement distance, in "pixels", required to trigger one logical Sets the movement distance, in "pixels", required to trigger one logical
wheel click. This option only applies to the scroll methods wheel click.
.BI twofinger, This option only applies to the scroll methods
.BI edge, .BR twofinger ,
.BI button. .BR edge ,
.BR button .
See section See section
.B SCROLL PIXEL DISTANCE .B SCROLL PIXEL DISTANCE
for more details. for more details.
.TP 7 .TP 7
.BI "Option \*qSendEventsMode\*q \*q" (disabled|enabled|disabled-on-external-mouse) \*q .BI "Option \*qSendEventsMode\*q \*q" (disabled|enabled|disabled-on-external-mouse) \*q
Sets the send events mode to disabled, enabled, or "disable when an external Sets the send events mode to disabled, enabled,
mouse is connected". or "disable when an external mouse is connected".
.TP 7 .TP 7
.BI "Option \*qTabletToolPressureCurve\*q \*q" "x0/y0 x1/y1 x2/y2 x3/y3" \*q .BI "Option \*qTabletToolPressureCurve\*q \*q" "x0/y0 x1/y1 x2/y2 x3/y3" \*q
Set the pressure curve for a tablet stylus to the bezier formed by the four Set the pressure curve for a tablet stylus to the bezier formed by the four
points. The respective x/y coordinate must be in the [0.0, 1.0] range. For points.
more information see section The respective x/y coordinate must be in the [0.0, 1.0] range.
.B TABLET STYLUS PRESSURE CURVE. For more information see section
.B TABLET TOOL PRESSURE CURVE.
.TP 7
.BI "Option \*qTabletToolPressureRange\*q \*q" "min max" \*q
Set the pressure range for a tablet stylus to the given subset of the physical
range.
The min/max values must be in the [0.0, 1.0] range.
For example, a min of 0.3 means the tablet will send 0 pressure for anything
equal or below 30% of the physical pressure range and a max of 0.7 means
the tablet sends its maximum pressure value for any pressure equal or higher to
70% of the physical pressure range.
.TP 7 .TP 7
.BI "Option \*qTabletToolAreaRatio\*q \*q" "w:h" \*q .BI "Option \*qTabletToolAreaRatio\*q \*q" "w:h" \*q
Sets the area ratio for a tablet tool. The area always starts at the Sets the area ratio for a tablet tool.
origin (0/0) and expands to the largest available area with the specified The area always starts at the origin (0/0) and
aspect ratio. Events outside this area are cropped to the area. The special expands to the largest available area with the specified aspect ratio.
value "default" is used for the default mapping (i.e. the device-native Events outside this area are cropped to the area.
mapping). For more information see section The special value "default" is used for the default mapping
(i.e. the device-native mapping).
For more information see section
.B TABLET TOOL AREA RATIO. .B TABLET TOOL AREA RATIO.
.TP 7 .TP 7
.BI "Option \*qTapping\*q \*q" bool \*q .BI "Option \*qTapping\*q \*q" bool \*q
@@ -226,49 +264,53 @@ Set the button mapping for 1/2/3-finger taps to left/right/middle or
left/middle/right, respectively. left/middle/right, respectively.
.TP 7 .TP 7
.BI "Option \*qTappingDrag\*q \*q" bool \*q .BI "Option \*qTappingDrag\*q \*q" bool \*q
Enables or disables drag during tapping behavior ("tap-and-drag"). When Enables or disables drag during tapping behavior ("tap-and-drag").
enabled, a tap followed by a finger held down causes a single button down When enabled, a tap followed by a finger held down causes a single button down
only, all motions of that finger thus translate into dragging motion. only, all motions of that finger thus translate into dragging motion.
Tap-and-drag requires option Tap-and-drag requires option
.B Tapping .B Tapping
to be enabled. to be enabled.
.TP 7 .TP 7
.BI "Option \*qTappingDragLock\*q \*q" bool \*q .BI "Option \*qTappingDragLock\*q \*q" bool \*q
Enables or disables drag lock during tapping behavior. When enabled, a Enables or disables drag lock during tapping behavior.
finger up during tap-and-drag will not immediately release the button. If When enabled,
the finger is set down again within the timeout, the dragging process a finger up during tap-and-drag will not immediately release the button.
continues. If the finger is set down again within the timeout,
the dragging process continues.
.PP .PP
For all options, the options are only parsed if the device supports that For all options, the options are only parsed if the device supports that
configuration option. For all options, the default value is the one used by configuration option.
libinput. On configuration failure, the default value is applied. For all options, the default value is the one used by libinput.
On configuration failure, the default value is applied.
.SH SUPPORTED PROPERTIES .SH SUPPORTED PROPERTIES
.B libinput .B libinput
exports runtime-configurable options as properties. If a property listed exports runtime-configurable options as properties.
below is not available, the matching configuration option is not available If a property listed below is not available,
on the device. This however does not imply that the feature is not available the matching configuration option is not available on the device.
on the device. The following properties are provided by the This however does not imply that the feature is not available on the device.
The following properties are provided by the
.B libinput .B libinput
driver. driver.
.TP 7 .TP 7
.BI "libinput Accel Profiles Available" .B "libinput Accel Profiles Available"
3 boolean values (8 bit, 0 or 1), in order "adaptive", "flat", "custom". 3 boolean values (8 bit, 0 or 1), in order "adaptive", "flat", "custom".
Indicates which acceleration profiles are available on this device. Indicates which acceleration profiles are available on this device.
.TP 7 .TP 7
.BI "libinput Accel Profile Enabled" .B "libinput Accel Profile Enabled"
3 boolean values (8 bit, 0 or 1), in order "adaptive", "flat", "custom". 3 boolean values (8 bit, 0 or 1), in order "adaptive", "flat", "custom".
Indicates which acceleration profile is currently enabled on this device. Indicates which acceleration profile is currently enabled on this device.
.TP 7 .TP 7
.BI "libinput Accel Speed" .B "libinput Accel Speed"
1 32-bit float value, defines the pointer speed. Value range -1, 1. 1 32-bit float value, defines the pointer speed.
Value range -1, 1.
This only applies to the flat or adaptive profile. This only applies to the flat or adaptive profile.
.TP 7 .TP 7
.BI "libinput Accel Custom Fallback Points" .B "libinput Accel Custom Fallback Points"
.TQ .TQ
.BI "libinput Accel Custom Motion Points" .B "libinput Accel Custom Motion Points"
.TQ .TQ
.BI "libinput Accel Custom Scroll Points" .B "libinput Accel Custom Scroll Points"
A space-separated list of 32-bit floating point non-negative numbers, e.g. A space-separated list of 32-bit floating point non-negative numbers, e.g.
"0.0 1.0 2.4 2.5". "0.0 1.0 2.4 2.5".
Sets the points of the Fallback/Motion/Scroll acceleration functions. Sets the points of the Fallback/Motion/Scroll acceleration functions.
@@ -276,11 +318,11 @@ This only applies to the custom profile.
See section See section
.B CUSTOM ACCELERATION PROFILE .B CUSTOM ACCELERATION PROFILE
.TP 7 .TP 7
.BI "libinput Accel Custom Fallback Step" .B "libinput Accel Custom Fallback Step"
.TQ .TQ
.BI "libinput Accel Custom Motion Step" .B "libinput Accel Custom Motion Step"
.TQ .TQ
.BI "libinput Accel Custom Scroll Step" .B "libinput Accel Custom Scroll Step"
1 32-bit float value, sets the step between the points of the 1 32-bit float value, sets the step between the points of the
Fallback/Motion/Scroll acceleration functions. Fallback/Motion/Scroll acceleration functions.
When a step of 0.0 is provided, libinput's Fallback acceleration When a step of 0.0 is provided, libinput's Fallback acceleration
@@ -289,113 +331,122 @@ This only applies to the custom profile.
See section See section
.B CUSTOM ACCELERATION PROFILE .B CUSTOM ACCELERATION PROFILE
.TP 7 .TP 7
.BI "libinput Button Scrolling Button" .B "libinput Button Scrolling Button"
1 32-bit value. Sets the button number to use for button scrolling. This 1 32-bit value. Sets the button number to use for button scrolling.
setting is independent of the scroll method, to enable button scrolling the This setting is independent of the scroll method, to enable button scrolling the
method must be set to button-scrolling and a valid button must be set. method must be set to button-scrolling and a valid button must be set.
.TP 7 .TP 7
.BI "libinput Button Scrolling Button Lock Enabled" .B "libinput Button Scrolling Button Lock Enabled"
1 boolean value. If true, the scroll button lock is enabled. This 1 boolean value. If true, the scroll button lock is enabled.
setting is independent of the scroll method or the scroll button, to enable This setting is independent of the scroll method or the scroll button, to enable
button scrolling the method must be set to button-scrolling and a valid button scrolling the method must be set to button-scrolling and a valid
button must be set. button must be set.
.TP 7 .TP 7
.BI "libinput Calibration Matrix" .B "libinput Calibration Matrix"
9 32-bit float values, representing a 3x3 calibration matrix, order is row 9 32-bit float values, representing a 3x3 calibration matrix, order is row
1, row 2, row 3 1, row 2, row 3
.TP 7 .TP 7
.BI "libinput Click Methods Available" .B "libinput Click Methods Available"
2 boolean values (8 bit, 0 or 1), in order "buttonareas", "clickfinger". 2 boolean values (8 bit, 0 or 1), in order "buttonareas", "clickfinger".
Indicates which click methods are available on this device. Indicates which click methods are available on this device.
.TP 7 .TP 7
.BI "libinput Click Methods Enabled" .B "libinput Click Methods Enabled"
2 boolean values (8 bit, 0 or 1), in order "buttonareas", "clickfinger". 2 boolean values (8 bit, 0 or 1), in order "buttonareas", "clickfinger".
Indicates which click methods are enabled on this device. Indicates which click methods are enabled on this device.
.TP 7 .TP 7
.BI "libinput Drag Lock Buttons" .B "libinput Drag Lock Buttons"
Either one 8-bit value specifying the meta drag lock button, or a list of Either one 8-bit value specifying the meta drag lock button, or a list of
button pairs. See section button pairs.
See section
.B BUTTON DRAG LOCK .B BUTTON DRAG LOCK
for details. for details.
.TP 7 .TP 7
.BI "libinput High Resolution Wheel Scroll Enabled" .B "libinput High Resolution Wheel Scroll Enabled"
1 boolean value (8 bit, 0 or 1). Indicates whether high-resolution 1 boolean value (8 bit, 0 or 1).
wheel scroll events are enabled or not. Indicates whether high-resolution wheel scroll events are enabled or not.
.TP 7 .TP 7
.BI "libinput Horizontal Scroll Enabled" .B "libinput Horizontal Scroll Enabled"
1 boolean value (8 bit, 0 or 1). Indicates whether horizontal scrolling 1 boolean value (8 bit, 0 or 1).
events are enabled or not. Indicates whether horizontal scrolling events are enabled or not.
.TP 7 .TP 7
.BI "libinput Left Handed Enabled" .B "libinput Left Handed Enabled"
1 boolean value (8 bit, 0 or 1). Indicates if left-handed mode is enabled or 1 boolean value (8 bit, 0 or 1).
disabled. Indicates if left-handed mode is enabled or disabled.
.TP 7 .TP 7
.BI "libinput Middle Emulation Enabled" .B "libinput Middle Emulation Enabled"
1 boolean value (8 bit, 0 or 1). Indicates if middle emulation is enabled or 1 boolean value (8 bit, 0 or 1).
disabled. Indicates if middle emulation is enabled or disabled.
.TP 7 .TP 7
.BI "libinput Natural Scrolling Enabled" .B "libinput Natural Scrolling Enabled"
1 boolean value (8 bit, 0 or 1). 1 enables natural scrolling 1 boolean value (8 bit, 0 or 1).
1 enables natural scrolling.
.TP 7 .TP 7
.BI "libinput Rotation Angle" .B "libinput Rotation Angle"
1 32-bit float value [0.0 to 360.0). Sets the rotation angle of the device, 1 32-bit float value [0.0 to 360.0).
Sets the rotation angle of the device,
clockwise of its natural neutral position. clockwise of its natural neutral position.
.TP 7 .TP 7
.BI "libinput Scroll Methods Available" .B "libinput Scroll Methods Available"
3 boolean values (8 bit, 0 or 1), in order "two-finger", "edge", "button". 3 boolean values (8 bit, 0 or 1), in order "two-finger", "edge", "button".
Indicates which scroll methods are available on this device. Indicates which scroll methods are available on this device.
.TP 7 .TP 7
.BI "libinput Scroll Method Enabled" .B "libinput Scroll Method Enabled"
3 boolean values (8 bit, 0 or 1), in order "two-finger", "edge", "button". 3 boolean values (8 bit, 0 or 1), in order "two-finger", "edge", "button".
Indicates which scroll method is currently enabled on this device. Indicates which scroll method is currently enabled on this device.
.TP 7 .TP 7
.BI "libinput Scroll Pixel Distance" .B "libinput Scroll Pixel Distance"
1 32-bit value (nonzero, with additional implementation-defined range checks). 1 32-bit value (nonzero, with additional implementation-defined range checks).
Changes the movement distance required to trigger one logical wheel click. Changes the movement distance required to trigger one logical wheel click.
.TP 7 .TP 7
.BI "libinput Send Events Modes Available" .B "libinput Send Events Modes Available"
2 boolean values (8 bit, 0 or 1), in order "disabled" and 2 boolean values (8 bit, 0 or 1), in order "disabled" and
"disabled-on-external-mouse". Indicates which send-event modes are available "disabled-on-external-mouse".
on this device. Indicates which send-event modes are available on this device.
.TP 7 .TP 7
.BI "libinput Send Events Mode Enabled" .B "libinput Send Events Mode Enabled"
2 boolean values (8 bit, 0 or 1), in order "disabled" and 2 boolean values (8 bit, 0 or 1), in order "disabled" and
"disabled-on-external-mouse". Indicates which send-event modes is currently "disabled-on-external-mouse".
enabled on this device. Indicates which send-event mode is currently enabled on this device.
.TP 7 .TP 7
.BI "libinput Tablet Tool Pressurecurve" .B "libinput Tablet Tool Pressurecurve"
4 32-bit float values [0.0 to 1.0]. See section 4 32-bit float values [0.0 to 1.0].
See section
.B TABLET TOOL PRESSURE CURVE .B TABLET TOOL PRESSURE CURVE
.TP 7 .TP 7
.BI "libinput Tablet Tool Area Ratio" .B "libinput Tablet Tool Area Ratio"
2 32-bit values, corresponding to width and height. Special value 0, 0 2 32-bit values, corresponding to width and height.
resets to the default ratio. See section Special value 0, 0 resets to the default ratio.
See section
.B TABLET TOOL AREA RATIO .B TABLET TOOL AREA RATIO
for more information. for more information.
.TP 7 .TP 7
.BI "libinput Tapping Enabled" .B "libinput Tapping Enabled"
1 boolean value (8 bit, 0 or 1). 1 enables tapping 1 boolean value (8 bit, 0 or 1).
1 enables tapping.
.TP 7.
.B "libinput Tapping Button Mapping Enabled"
2 boolean value (8 bit, 0 or 1), in order "lrm" and "lmr".
Indicates which button mapping is currently enabled on this device.
.TP 7 .TP 7
.BI "libinput Tapping Button Mapping Enabled" .B "libinput Tapping Drag Lock Enabled"
2 boolean value (8 bit, 0 or 1), in order "lrm" and "lmr". Indicates which 1 boolean value (8 bit, 0 or 1).
button mapping is currently enabled on this device. 1 enables drag lock during tapping.
.TP 7 .TP 7
.BI "libinput Tapping Drag Lock Enabled" .B "libinput Disable While Typing Enabled"
1 boolean value (8 bit, 0 or 1). 1 enables drag lock during tapping 1 boolean value (8 bit, 0 or 1).
.TP 7 Indicates if disable while typing is enabled or disabled.
.BI "libinput Disable While Typing Enabled"
1 boolean value (8 bit, 0 or 1). Indicates if disable while typing is
enabled or disabled.
.PP .PP
Most properties have a Most properties have a
.BI "libinput <property name> Default" .B "libinput <property name> Default"
equivalent that indicates the default value for this setting on this device. equivalent that indicates the default value for this setting on this device.
.SH BUTTON MAPPING .SH BUTTON MAPPING
X clients receive events with logical button numbers, where 1, 2, 3 X clients receive events with logical button numbers,
are usually interpreted as left, middle, right and logical buttons 4, 5, 6, where 1, 2, 3 are usually interpreted as left, middle, right;
7 are usually interpreted as scroll up, down, left, right. The fourth and and logical buttons 4, 5, 6, 7 are usually interpreted
fifth physical buttons on a device will thus send logical buttons 8 and 9. as scroll up, down, left, right.
The fourth and fifth physical buttons on a device
will thus send logical buttons 8 and 9.
The The
.B ButtonMapping .B ButtonMapping
option adjusts the logical button mapping, it does not affect how a physical option adjusts the logical button mapping, it does not affect how a physical
@@ -413,79 +464,92 @@ option instead.
The The
.B libinput .B libinput
Xorg input driver does not use the button mapping after setup. Xorg input driver does not use the button mapping after setup.
Use XSetPointerMapping(3) to modify the button mapping at Use
runtime. .BR XSetPointerMapping (3)
to modify the button mapping at runtime.
.SH BUTTON DRAG LOCK .SH BUTTON DRAG LOCK
Button drag lock holds a button logically down even when the button itself Button drag lock holds a button logically down even when the button itself
has been physically released since. Button drag lock comes in two modes. has been physically released since.
Button drag lock comes in two modes.
.PP .PP
If in "meta" mode, a meta button click activates drag lock for the next If in "meta" mode, a meta button click activates drag lock for the next
button press of any other button. A button click in the future will keep button press of any other button.
that button held logically down until a subsequent click of that same A button click in the future will keep that button held logically down
button. The meta button events themselves are discarded. A separate meta until a subsequent click of that same button.
button click is required each time a drag lock should be activated for a The meta button events themselves are discarded.
button in the future. A separate meta button click is required each time a drag lock should be
activated for a button in the future.
.PP .PP
If in "pairs" mode, each button can be assigned a target locking button. If in "pairs" mode, each button can be assigned a target locking button.
On button click, the target lock button is held logically down until the On button click, the target lock button is held logically down until the
next click of the same button. The button events themselves are discarded next click of the same button.
The button events themselves are discarded
and only the target button events are sent. and only the target button events are sent.
.TP .PP
This feature is provided by this driver, not by libinput. This feature is provided by this driver, not by libinput.
.SH TABLET TOOL PRESSURECURVE .SH TABLET TOOL PRESSURE CURVE
The pressure curve affects how stylus pressure is reported. By default, the The pressure curve affects how stylus pressure is reported.
hardware pressure is reported as-is. By setting a pressure curve, the feel By default, the hardware pressure is reported as-is.
of the stylus can be adjusted to be more like e.g. a pencil or a brush. By setting a pressure curve, the feel of the stylus can be adjusted
to be more like e.g. a pencil or a brush.
.PP .PP
The pressure curve is a cubic Bezier curve, drawn within a normalized range The pressure curve is a cubic Bezier curve, drawn within a normalized range
of 0.0 to 1.0 between the four points provided. This normalized range is of 0.0 to 1.0 between the four points provided.
applied to the tablet's pressure input so that the highest pressure maps to This normalized range is applied to the tablet's pressure input
1.0. The points must have increasing x coordinates, if x0 is larger than 0.0 so that the highest pressure maps to 1.0.
all pressure values lower than x0 are equivalent to y0. If x3 is less than The points must have increasing x coordinates, if x0 is larger than 0.0
1.0, all pressure values higher than x3 are equivalent to y3. all pressure values lower than x0 are equivalent to y0.
If x3 is less than 1.0,
The input for a linear curve (default) is "0.0/0.0 0.0/0.0 1.0/1.0 1.0/1.0"; all pressure values higher than x3 are equivalent to y3.
a slightly .PP
depressed curve (firmer) might be "0.0/0.0 0.05/0.0 1.0/0.95 1.0/1.0"; a slightly raised The input for a linear curve (default) is "0.0/0.0 0.0/0.0 1.0/1.0 1.0/1.0";
curve (softer) might be "0.0/0.0 0.0/0.05 0.95/1.0 1.0/1.0". a slightly depressed curve (firmer) might be
.TP "0.0/0.0 0.05/0.0 1.0/0.95 1.0/1.0";
a slightly raised curve (softer) might be "0.0/0.0 0.0/0.05 0.95/1.0 1.0/1.0".
.PP
This feature is provided by this driver, not by libinput. This feature is provided by this driver, not by libinput.
.SH TABLET TOOL AREA RATIO .SH TABLET TOOL AREA RATIO
By default, a tablet tool can access the whole sensor area and the tablet By default, a tablet tool can access the whole sensor area and the tablet
area is mapped to the available screen area. For external tablets like area is mapped to the available screen area.
the Wacom Intuos series, the height:width ratio of the tablet may be For external tablets like the Wacom Intuos series,
different to that of the monitor, causing the skew of input data. the height:width ratio of the tablet may be different to that of the monitor,
causing the skew of input data.
.PP .PP
To avoid this skew of input data, an area ratio may be set to match the To avoid this skew of input data, an area ratio may be set to match the
ratio of the screen device. For example, a ratio of 4:3 will reduce the ratio of the screen device.
available area of the tablet to the largest available area with a ratio of For example, a ratio of 4:3 will reduce the available area of the tablet
4:3. Events within this area will scale to the tablet's announced axis to the largest available area with a ratio of 4:3.
range, the area ratio is thus transparent to the X server. Any events Events within this area will scale to the tablet's announced axis range,
outside this area will send events equal to the maximum value of that axis. the area ratio is thus transparent to the X server.
The area always starts at the device's origin in it's current rotation, i.e. Any events outside this area will send events equal to the maximum value of
that axis.
The area always starts at the device's origin in it's current rotation, i.e.,
it takes left-handed-ness into account. it takes left-handed-ness into account.
.TP .PP
This feature is provided by this driver, not by libinput. This feature is provided by this driver, not by libinput.
.SH SCROLL PIXEL DISTANCE .SH SCROLL PIXEL DISTANCE
The X server does not support per-pixel scrolling but it does support The X server does not support per-pixel scrolling but it does support
smooth scrolling. All scroll events however are based around a logical smooth scrolling.
unit of scrolling (traditionally corresponding to a wheel click). All scroll events however are based around a logical unit of scrolling
(traditionally corresponding to a wheel click).
It is thus not possible to scroll by 10 pixels, but it is possible for a It is thus not possible to scroll by 10 pixels, but it is possible for a
driver to scroll by 1/10th of a logical wheel click. driver to scroll by 1/10th of a logical wheel click.
.PP .PP
libinput provides scroll data in pixels. The \fBScrollPixelDistance\fR libinput provides scroll data in pixels.
option defines the amount of movement equivalent to one wheel click. For The \fBScrollPixelDistance\fR option defines the amount of movement equivalent
example, a value of 50 means the user has to move a finger by 50 pixels to to one wheel click.
For example, a value of 50 means the user has to move a finger by 50 pixels to
generate one logical click event and each pixel is 1/50th of a wheel click. generate one logical click event and each pixel is 1/50th of a wheel click.
.SH CUSTOM ACCELERATION PROFILE .SH CUSTOM ACCELERATION PROFILE
The custom pointer acceleration profile gives users full control over the The custom pointer acceleration profile gives users full control over the
acceleration behavior at different speeds. libinput exposes an acceleration acceleration behavior at different speeds.
function f(x) where the x-axis is the device speed in device units per millisecond libinput exposes an acceleration function \fIf(x)\fP
where the x-axis is the device speed in device units per millisecond
and the y-axis is the pointer speed. and the y-axis is the pointer speed.
.PP .PP
The custom acceleration function is defined using n points which are spaced The custom acceleration function is defined using n points which are spaced
@@ -495,9 +559,11 @@ Thus the points defining the custom function are:
(0 * step, f[0]), (1 * step, f[1]), ..., ((n-1) * step, f[n-1]) (0 * step, f[0]), (1 * step, f[1]), ..., ((n-1) * step, f[n-1])
.EE .EE
When a velocity value does not lie exactly on those points, When a velocity value does not lie exactly on those points,
a linear interpolation/extrapolation of the two closest points will be calculated. a linear interpolation/extrapolation of the two closest points
will be calculated.
.PP .PP
There are 3 custom acceleration function, which are used for different movement types: There are 3 custom acceleration functions,
which are used for different movement types:
.TS .TS
tab(;) allbox; tab(;) allbox;
l l l. l l l.
@@ -507,16 +573,20 @@ Motion; Used for pointer motion; All devices
Scroll; Used for scroll movement; Mouse, Touchpad Scroll; Used for scroll movement; Mouse, Touchpad
.TE .TE
.PP .PP
See libinput library documentation of more details: See libinput library documentation for more details:
https://wayland.freedesktop.org/libinput/doc/latest/pointer-acceleration.html#the-custom-acceleration-profile https://wayland.freedesktop.org/libinput/doc/latest/pointer-acceleration.html#the-custom-acceleration-profile
.SH BUGS .SH BUGS
This driver does not work with \fBOption \*qDevice\*q\fR set to an event This driver does not work with \fBOption \*qDevice\*q\fR set to an event
node in \fI/dev/input/by-id\fR and \fI/dev/input/by-path\fR. This can be node in \fI/dev/input/by-id\fR and \fI/dev/input/by-path\fR.
usually be worked by using \fBSection \*qInputClass\*q\fR with an This can be usually be worked by using \fBSection \*qInputClass\*q\fR with an
appropriate \fBMatch*\fR statement in the xorg.conf(5). appropriate \fBMatch*\fR statement in the
.BR xorg.conf (5).
.SH AUTHORS .SH AUTHORS
Peter Hutterer Peter Hutterer
.SH "SEE ALSO" .SH "SEE ALSO"
Xorg(1), xorg.conf(5), Xserver(1), X(7) .BR Xorg (1),
.BR xorg.conf (5),
.BR Xserver (1),
.BR X (7)

View File

@@ -1,5 +1,5 @@
project('xf86-input-libinput', 'c', project('xf86-input-libinput', 'c',
version: '1.4.0', # bump version in configure.ac version: '1.5.0', # bump version in configure.ac
default_options: ['warning_level=2'], default_options: ['warning_level=2'],
meson_version: '>= 0.50.0') meson_version: '>= 0.50.0')
@@ -57,6 +57,21 @@ if cc.has_function('libinput_config_accel_create',
dependencies: dep_libinput) dependencies: dep_libinput)
config_h.set('HAVE_LIBINPUT_CUSTOM_ACCEL', 1) config_h.set('HAVE_LIBINPUT_CUSTOM_ACCEL', 1)
endif endif
if cc.has_function('libinput_tablet_tool_config_pressure_range_set',
dependencies: dep_libinput)
config_h.set('HAVE_LIBINPUT_PRESSURE_RANGE', 1)
endif
if cc.has_function('libinput_device_config_click_set_clickfinger_button_map',
dependencies: dep_libinput)
config_h.set('HAVE_LIBINPUT_CLICKFINGER_BUTTON_MAP', 1)
endif
if cc.has_header_symbol('libinput.h', 'LIBINPUT_LED_COMPOSE',
dependencies: dep_libinput)
config_h.set('HAVE_LIBINPUT_COMPOSE_AND_KANA', 1)
endif
if cc.has_function('libinput_plugin_system_load_plugins', dependencies: dep_libinput)
config_h.set('HAVE_LIBINPUT_PLUGINS', 1)
endif
dir_headers = get_option('sdkdir') dir_headers = get_option('sdkdir')
if dir_headers == '' if dir_headers == ''
@@ -135,6 +150,8 @@ configure_file(
install_dir: dir_man4 install_dir: dir_man4
) )
install_headers('include/libinput-properties.h', install_dir: dir_headers)
install_data('conf/40-libinput.conf', install_dir: dir_xorg_conf) install_data('conf/40-libinput.conf', install_dir: dir_xorg_conf)
# Now generate config.h # Now generate config.h

View File

@@ -179,6 +179,9 @@ struct xf86libinput {
float matrix[9]; float matrix[9];
enum libinput_config_scroll_method scroll_method; enum libinput_config_scroll_method scroll_method;
enum libinput_config_click_method click_method; enum libinput_config_click_method click_method;
#if HAVE_LIBINPUT_CLICKFINGER_BUTTON_MAP
enum libinput_config_clickfinger_button_map clickfinger_button_map;
#endif
enum libinput_config_accel_profile accel_profile; enum libinput_config_accel_profile accel_profile;
#if HAVE_LIBINPUT_CUSTOM_ACCEL #if HAVE_LIBINPUT_CUSTOM_ACCEL
struct accel_points accel_points_fallback; struct accel_points accel_points_fallback;
@@ -192,6 +195,9 @@ struct xf86libinput {
float rotation_angle; float rotation_angle;
struct bezier_control_point pressurecurve[4]; struct bezier_control_point pressurecurve[4];
struct range {
float min, max;
} pressure_range;
struct ratio { struct ratio {
int x, y; int x, y;
} area; } area;
@@ -455,6 +461,25 @@ xf86libinput_set_pressurecurve(struct xf86libinput *driver_data,
driver_data->pressurecurve.sz); driver_data->pressurecurve.sz);
} }
static inline bool
xf86libinput_set_pressure_range(struct xf86libinput *driver_data,
const struct range *range)
{
#if HAVE_LIBINPUT_PRESSURE_RANGE
struct libinput_tablet_tool *tool = driver_data->tablet_tool;
if (!tool)
return FALSE;
return libinput_tablet_tool_config_pressure_range_is_available(tool) &&
libinput_tablet_tool_config_pressure_range_set(tool,
range->min,
range->max) == LIBINPUT_CONFIG_STATUS_SUCCESS;
#else
return FALSE;
#endif
}
static inline void static inline void
xf86libinput_set_area_ratio(struct xf86libinput *driver_data, xf86libinput_set_area_ratio(struct xf86libinput *driver_data,
const struct ratio *ratio) const struct ratio *ratio)
@@ -501,8 +526,10 @@ subdevice_has_capabilities(DeviceIntPtr dev, uint32_t capabilities)
} }
static int static int
LibinputSetProperty(DeviceIntPtr dev, Atom atom, XIPropertyValuePtr val, LibinputSetProperty(DeviceIntPtr dev, Atom atom,
BOOL checkonly); XIPropertyValuePtr val,
BOOL checkonly);
static void static void
LibinputInitProperty(DeviceIntPtr dev); LibinputInitProperty(DeviceIntPtr dev);
@@ -804,6 +831,9 @@ LibinputApplyConfigClickMethod(DeviceIntPtr dev,
struct libinput_device *device) struct libinput_device *device)
{ {
InputInfoPtr pInfo = dev->public.devicePrivate; InputInfoPtr pInfo = dev->public.devicePrivate;
#if HAVE_LIBINPUT_CLICKFINGER_BUTTON_MAP
uint32_t click_methods = libinput_device_config_click_get_methods(device);
#endif
if (!subdevice_has_capabilities(dev, CAP_POINTER)) if (!subdevice_has_capabilities(dev, CAP_POINTER))
return; return;
@@ -824,6 +854,24 @@ LibinputApplyConfigClickMethod(DeviceIntPtr dev,
"Failed to set click method to %s\n", "Failed to set click method to %s\n",
method); method);
} }
#if HAVE_LIBINPUT_CLICKFINGER_BUTTON_MAP
if (click_methods & LIBINPUT_CONFIG_CLICK_METHOD_CLICKFINGER &&
libinput_device_config_click_set_clickfinger_button_map(device,
driver_data->options.clickfinger_button_map) != LIBINPUT_CONFIG_STATUS_SUCCESS) {
const char *map;
switch (driver_data->options.clickfinger_button_map) {
case LIBINPUT_CONFIG_CLICKFINGER_MAP_LRM: map = "LRM"; break;
case LIBINPUT_CONFIG_CLICKFINGER_MAP_LMR: map = "LMR"; break;
default:
map = "unknown"; break;
}
xf86IDrvMsg(pInfo, X_ERROR,
"Failed to set clickfinger button map to %s\n",
map);
}
#endif
} }
static void static void
@@ -879,6 +927,27 @@ LibinputApplyConfigRotation(DeviceIntPtr dev,
driver_data->options.rotation_angle); driver_data->options.rotation_angle);
} }
static void
LibinputApplyConfigPressureRange(DeviceIntPtr dev,
struct xf86libinput *driver_data,
struct libinput_device *device)
{
#if HAVE_LIBINPUT_PRESSURE_RANGE
InputInfoPtr pInfo = dev->public.devicePrivate;
struct libinput_tablet_tool *tool = driver_data->tablet_tool;
struct range *range = &driver_data->options.pressure_range;
if (!subdevice_has_capabilities(dev, CAP_TABLET_TOOL))
return;
if (tool && libinput_tablet_tool_config_pressure_range_is_available(tool) &&
libinput_tablet_tool_config_pressure_range_set(tool, range->min, range->max) != LIBINPUT_CONFIG_STATUS_SUCCESS)
xf86IDrvMsg(pInfo, X_ERROR,
"Failed to set PressureRange to %.2f..%.2f\n",
range->min, range->max);
#endif
}
static inline void static inline void
LibinputApplyConfig(DeviceIntPtr dev) LibinputApplyConfig(DeviceIntPtr dev)
{ {
@@ -897,6 +966,7 @@ LibinputApplyConfig(DeviceIntPtr dev)
LibinputApplyConfigMiddleEmulation(dev, driver_data, device); LibinputApplyConfigMiddleEmulation(dev, driver_data, device);
LibinputApplyConfigDisableWhileTyping(dev, driver_data, device); LibinputApplyConfigDisableWhileTyping(dev, driver_data, device);
LibinputApplyConfigRotation(dev, driver_data, device); LibinputApplyConfigRotation(dev, driver_data, device);
LibinputApplyConfigPressureRange(dev, driver_data, device);
} }
static int static int
@@ -1098,35 +1168,41 @@ xf86libinput_init_pointer_absolute(InputInfoPtr pInfo)
return Success; return Success;
} }
static void static void
xf86libinput_kbd_ctrl(DeviceIntPtr device, KeybdCtrl *ctrl) xf86libinput_kbd_ctrl(DeviceIntPtr device, KeybdCtrl *ctrl)
{ {
#define CAPSFLAG 1 #define CAPSFLAG 1
#define NUMFLAG 2 #define NUMFLAG 2
#define SCROLLFLAG 4 #define SCROLLFLAG 4
#define COMPOSEFLAG 8
#define KANAFLAG 16
static struct { int xbit, code; } bits[] = {
{ CAPSFLAG, LIBINPUT_LED_CAPS_LOCK },
{ NUMFLAG, LIBINPUT_LED_NUM_LOCK },
{ SCROLLFLAG, LIBINPUT_LED_SCROLL_LOCK },
#ifdef HAVE_LIBINPUT_COMPOSE_AND_KANA
{ COMPOSEFLAG, LIBINPUT_LED_COMPOSE },
{ KANAFLAG, LIBINPUT_LED_KANA },
#endif
{ 0, 0 },
};
int i = 0;
enum libinput_led leds = 0;
InputInfoPtr pInfo = device->public.devicePrivate;
struct xf86libinput *driver_data = pInfo->private;
struct libinput_device *ldevice = driver_data->shared_device->device;
static struct { int xbit, code; } bits[] = { if (!device->enabled)
{ CAPSFLAG, LIBINPUT_LED_CAPS_LOCK }, return;
{ NUMFLAG, LIBINPUT_LED_NUM_LOCK },
{ SCROLLFLAG, LIBINPUT_LED_SCROLL_LOCK },
{ 0, 0 },
};
int i = 0;
enum libinput_led leds = 0;
InputInfoPtr pInfo = device->public.devicePrivate;
struct xf86libinput *driver_data = pInfo->private;
struct libinput_device *ldevice = driver_data->shared_device->device;
if (!device->enabled) while (bits[i].xbit) {
return; if (ctrl->leds & bits[i].xbit)
leds |= bits[i].code;
i++;
}
while (bits[i].xbit) { libinput_device_led_update(ldevice, leds);
if (ctrl->leds & bits[i].xbit)
leds |= bits[i].code;
i++;
}
libinput_device_led_update(ldevice, leds);
} }
static void static void
@@ -1320,7 +1396,10 @@ xf86libinput_init_tablet(InputInfoPtr pInfo)
int nbuttons = TABLET_NUM_BUTTONS; int nbuttons = TABLET_NUM_BUTTONS;
int naxes = 2; int naxes = 2;
BUG_RETURN(driver_data->tablet_tool == NULL); if (driver_data->tablet_tool == NULL) {
xf86IDrvMsg(pInfo, X_WARNING, "BUG: tablet_tool is NULL\n");
return;
}
tool = driver_data->tablet_tool; tool = driver_data->tablet_tool;
@@ -1438,7 +1517,10 @@ xf86libinput_init(DeviceIntPtr dev)
struct xf86libinput_device *shared_device = driver_data->shared_device; struct xf86libinput_device *shared_device = driver_data->shared_device;
struct libinput_device *device = shared_device->device; struct libinput_device *device = shared_device->device;
BUG_RETURN_VAL(device == NULL, !Success); if (device == NULL) {
xf86IDrvMsg(pInfo, X_WARNING, "BUG: xf86libinput_init() device is NULL\n");
return !Success;
}
dev->public.on = FALSE; dev->public.on = FALSE;
@@ -1649,6 +1731,14 @@ xf86libinput_handle_key(InputInfoPtr pInfo, struct libinput_event_keyboard *even
if ((driver_data->capabilities & CAP_KEYBOARD) == 0) if ((driver_data->capabilities & CAP_KEYBOARD) == 0)
return; return;
/* keycodes > 256 that have a historical mapping in xkeyboard-config */
switch (key) {
case KEY_TOUCHPAD_TOGGLE: key = KEY_F21; break;
case KEY_TOUCHPAD_ON: key = KEY_F22; break;
case KEY_TOUCHPAD_OFF: key = KEY_F23; break;
case KEY_MICMUTE: key = KEY_F20; break;
}
key += XORG_KEYCODE_OFFSET; key += XORG_KEYCODE_OFFSET;
is_press = (libinput_event_keyboard_get_key_state(event) == LIBINPUT_KEY_STATE_PRESSED); is_press = (libinput_event_keyboard_get_key_state(event) == LIBINPUT_KEY_STATE_PRESSED);
@@ -2410,7 +2500,10 @@ xf86libinput_handle_tablet_proximity(InputInfoPtr pInfo,
if (xf86libinput_tool_queue_event(event)) if (xf86libinput_tool_queue_event(event))
return EVENT_QUEUED; return EVENT_QUEUED;
BUG_RETURN_VAL(pDev == NULL, EVENT_HANDLED); if (pDev == NULL) {
xf86IDrvMsg(pInfo, X_WARNING, "BUG: xf86libinput_handle_tablet_proximity() pDev is NULL\n");
return EVENT_HANDLED;
}
x = libinput_event_tablet_tool_get_x_transformed(event, TABLET_AXIS_MAX); x = libinput_event_tablet_tool_get_x_transformed(event, TABLET_AXIS_MAX);
y = libinput_event_tablet_tool_get_y_transformed(event, TABLET_AXIS_MAX); y = libinput_event_tablet_tool_get_y_transformed(event, TABLET_AXIS_MAX);
@@ -2654,7 +2747,7 @@ xf86libinput_read_input(InputInfoPtr pInfo)
int rc; int rc;
struct libinput_event *event; struct libinput_event *event;
rc = libinput_dispatch(libinput); rc = libinput_dispatch(libinput);
if (rc == -EAGAIN) if (rc == -EAGAIN)
return; return;
@@ -2882,6 +2975,46 @@ xf86libinput_parse_tap_buttonmap_option(InputInfoPtr pInfo,
return map; return map;
} }
#if HAVE_LIBINPUT_CLICKFINGER_BUTTON_MAP
static inline enum libinput_config_clickfinger_button_map
xf86libinput_parse_clickfinger_map_option(InputInfoPtr pInfo,
struct libinput_device *device)
{
uint32_t click_methods = libinput_device_config_click_get_methods(device);
enum libinput_config_clickfinger_button_map map;
char *str;
map = libinput_device_config_click_get_clickfinger_button_map(device);
if ((click_methods & LIBINPUT_CONFIG_CLICK_METHOD_CLICKFINGER) == 0)
return map;
str = xf86SetStrOption(pInfo->options,
"ClickfingerButtonMap",
NULL);
if (str) {
if (streq(str, "lmr"))
map = LIBINPUT_CONFIG_CLICKFINGER_MAP_LMR;
else if (streq(str, "lrm"))
map = LIBINPUT_CONFIG_CLICKFINGER_MAP_LRM;
else
xf86IDrvMsg(pInfo, X_ERROR,
"Invalid ClickfingerButtonMap: %s\n",
str);
free(str);
}
if (libinput_device_config_click_set_clickfinger_button_map(device, map) !=
LIBINPUT_CONFIG_STATUS_SUCCESS) {
xf86IDrvMsg(pInfo, X_ERROR,
"Failed to set Clickfinger Button Map to %d\n",
map);
map = libinput_device_config_click_get_clickfinger_button_map(device);
}
return map;
}
#endif
static inline double static inline double
xf86libinput_parse_accel_option(InputInfoPtr pInfo, xf86libinput_parse_accel_option(InputInfoPtr pInfo,
struct libinput_device *device) struct libinput_device *device)
@@ -3530,6 +3663,46 @@ out:
xf86libinput_set_pressurecurve(driver_data, controls); xf86libinput_set_pressurecurve(driver_data, controls);
} }
static void
xf86libinput_parse_pressure_range_option(InputInfoPtr pInfo,
struct xf86libinput *driver_data,
struct range *range)
{
#if HAVE_LIBINPUT_PRESSURE_RANGE
struct libinput_tablet_tool *tool = driver_data->tablet_tool;
float min, max;
char *str;
int rc;
range->min = 0.0;
range->max = 1.0;
if ((driver_data->capabilities & CAP_TABLET_TOOL) == 0)
return;
if (!tool || !libinput_tablet_tool_config_pressure_range_is_available(tool))
return;
str = xf86SetStrOption(pInfo->options,
"TabletToolPressureRange",
NULL);
if (!str)
return;
rc = sscanf(str, "%f %f", &min, &max);
if (rc != 2)
goto out;
if (min < 0.0 || max > 1.0 || min >= max)
goto out;
range->min = min;
range->max = max;
out:
free(str);
#endif
}
static inline bool static inline bool
want_area_handling(struct xf86libinput *driver_data) want_area_handling(struct xf86libinput *driver_data)
{ {
@@ -3602,6 +3775,9 @@ xf86libinput_parse_options(InputInfoPtr pInfo,
options->scroll_buttonlock = xf86libinput_parse_scrollbuttonlock_option(pInfo, device); options->scroll_buttonlock = xf86libinput_parse_scrollbuttonlock_option(pInfo, device);
options->scroll_pixel_distance = xf86libinput_parse_scroll_pixel_distance_option(pInfo, device); options->scroll_pixel_distance = xf86libinput_parse_scroll_pixel_distance_option(pInfo, device);
options->click_method = xf86libinput_parse_clickmethod_option(pInfo, device); options->click_method = xf86libinput_parse_clickmethod_option(pInfo, device);
#if HAVE_LIBINPUT_CLICKFINGER_BUTTON_MAP
options->clickfinger_button_map = xf86libinput_parse_clickfinger_map_option(pInfo, device);
#endif
options->middle_emulation = xf86libinput_parse_middleemulation_option(pInfo, device); options->middle_emulation = xf86libinput_parse_middleemulation_option(pInfo, device);
options->disable_while_typing = xf86libinput_parse_disablewhiletyping_option(pInfo, device); options->disable_while_typing = xf86libinput_parse_disablewhiletyping_option(pInfo, device);
options->rotation_angle = xf86libinput_parse_rotation_angle_option(pInfo, device); options->rotation_angle = xf86libinput_parse_rotation_angle_option(pInfo, device);
@@ -3620,6 +3796,7 @@ xf86libinput_parse_options(InputInfoPtr pInfo,
xf86libinput_parse_pressurecurve_option(pInfo, xf86libinput_parse_pressurecurve_option(pInfo,
driver_data, driver_data,
options->pressurecurve); options->pressurecurve);
xf86libinput_parse_pressure_range_option(pInfo, driver_data, &options->pressure_range);
xf86libinput_parse_tablet_area_option(pInfo, xf86libinput_parse_tablet_area_option(pInfo,
driver_data, driver_data,
&options->area); &options->area);
@@ -3677,6 +3854,10 @@ xf86libinput_init_driver_context(void)
/* we want all msgs, let the server filter */ /* we want all msgs, let the server filter */
libinput_log_set_priority(driver_context.libinput, libinput_log_set_priority(driver_context.libinput,
LIBINPUT_LOG_PRIORITY_DEBUG); LIBINPUT_LOG_PRIORITY_DEBUG);
#if HAVE_LIBINPUT_PLUGINS
libinput_plugin_system_append_default_paths(driver_context.libinput);
libinput_plugin_system_load_plugins(driver_context.libinput, LIBINPUT_PLUGIN_SYSTEM_FLAG_NONE);
#endif
} else { } else {
libinput_ref(driver_context.libinput); libinput_ref(driver_context.libinput);
} }
@@ -4083,6 +4264,8 @@ static Atom prop_scroll_pixel_distance_default;
static Atom prop_click_methods_available; static Atom prop_click_methods_available;
static Atom prop_click_method_enabled; static Atom prop_click_method_enabled;
static Atom prop_click_method_default; static Atom prop_click_method_default;
static Atom prop_clickfinger_buttonmap;
static Atom prop_clickfinger_buttonmap_default;
static Atom prop_middle_emulation; static Atom prop_middle_emulation;
static Atom prop_middle_emulation_default; static Atom prop_middle_emulation_default;
static Atom prop_disable_while_typing; static Atom prop_disable_while_typing;
@@ -4094,12 +4277,16 @@ static Atom prop_mode_groups_rings;
static Atom prop_mode_groups_strips; static Atom prop_mode_groups_strips;
static Atom prop_rotation_angle; static Atom prop_rotation_angle;
static Atom prop_rotation_angle_default; static Atom prop_rotation_angle_default;
static Atom prop_pressure_range;
static Atom prop_pressure_range_default;
/* driver properties */ /* driver properties */
static Atom prop_draglock; static Atom prop_draglock;
static Atom prop_horiz_scroll; static Atom prop_horiz_scroll;
static Atom prop_pressurecurve; static Atom prop_pressurecurve;
static Atom prop_area_ratio; static Atom prop_area_ratio;
static Atom prop_serial;
static Atom prop_tool_id;
static Atom prop_hires_scroll; static Atom prop_hires_scroll;
/* general properties */ /* general properties */
@@ -4210,7 +4397,8 @@ xf86libinput_check_device(DeviceIntPtr dev,
struct libinput_device *device = driver_data->shared_device->device; struct libinput_device *device = driver_data->shared_device->device;
if (device == NULL) { if (device == NULL) {
BUG_WARN(dev->public.on); if (dev->public.on)
xf86IDrvMsg(pInfo, X_WARNING, "BUG: xf86libinput_check_device() device is on\n");
xf86IDrvMsg(pInfo, X_INFO, xf86IDrvMsg(pInfo, X_INFO,
"SetProperty on %u called but device is disabled.\n" "SetProperty on %u called but device is disabled.\n"
"This driver cannot change properties on a disabled device\n", "This driver cannot change properties on a disabled device\n",
@@ -4223,9 +4411,9 @@ xf86libinput_check_device(DeviceIntPtr dev,
static inline int static inline int
LibinputSetPropertyTap(DeviceIntPtr dev, LibinputSetPropertyTap(DeviceIntPtr dev,
Atom atom, Atom atom,
XIPropertyValuePtr val, XIPropertyValuePtr val,
BOOL checkonly) BOOL checkonly)
{ {
InputInfoPtr pInfo = dev->public.devicePrivate; InputInfoPtr pInfo = dev->public.devicePrivate;
struct xf86libinput *driver_data = pInfo->private; struct xf86libinput *driver_data = pInfo->private;
@@ -4353,8 +4541,8 @@ LibinputSetPropertyTapButtonmap(DeviceIntPtr dev,
static inline int static inline int
LibinputSetPropertyCalibration(DeviceIntPtr dev, LibinputSetPropertyCalibration(DeviceIntPtr dev,
Atom atom, Atom atom,
XIPropertyValuePtr val, XIPropertyValuePtr val,
BOOL checkonly) BOOL checkonly)
{ {
InputInfoPtr pInfo = dev->public.devicePrivate; InputInfoPtr pInfo = dev->public.devicePrivate;
@@ -4504,6 +4692,8 @@ LibinputSetPropertyAccelPoints(DeviceIntPtr dev,
accel_points = &driver_data->options.accel_points_motion; accel_points = &driver_data->options.accel_points_motion;
else if (atom == prop_accel_points_scroll) else if (atom == prop_accel_points_scroll)
accel_points = &driver_data->options.accel_points_scroll; accel_points = &driver_data->options.accel_points_scroll;
else
return BadValue;
for (size_t idx = 0; idx < val->size; idx++) for (size_t idx = 0; idx < val->size; idx++)
accel_points->points[idx] = data[idx]; accel_points->points[idx] = data[idx];
@@ -4556,9 +4746,9 @@ LibinputSetPropertyAccelStep(DeviceIntPtr dev,
static inline int static inline int
LibinputSetPropertyNaturalScroll(DeviceIntPtr dev, LibinputSetPropertyNaturalScroll(DeviceIntPtr dev,
Atom atom, Atom atom,
XIPropertyValuePtr val, XIPropertyValuePtr val,
BOOL checkonly) BOOL checkonly)
{ {
InputInfoPtr pInfo = dev->public.devicePrivate; InputInfoPtr pInfo = dev->public.devicePrivate;
struct xf86libinput *driver_data = pInfo->private; struct xf86libinput *driver_data = pInfo->private;
@@ -4824,6 +5014,46 @@ LibinputSetPropertyClickMethod(DeviceIntPtr dev,
return Success; return Success;
} }
static inline int
LibinputSetPropertyClickfingerButtonmap(DeviceIntPtr dev,
Atom atom,
XIPropertyValuePtr val,
BOOL checkonly)
{
#if HAVE_LIBINPUT_CLICKFINGER_BUTTON_MAP
InputInfoPtr pInfo = dev->public.devicePrivate;
struct xf86libinput *driver_data = pInfo->private;
BOOL* data;
enum libinput_config_clickfinger_button_map map;
if (val->format != 8 || val->size != 2 || val->type != XA_INTEGER)
return BadMatch;
data = (BOOL*)val->data;
if (checkonly) {
if ((data[0] && data[1]) || (!data[0] && !data[1]))
return BadValue;
if (!xf86libinput_check_device(dev, atom))
return BadMatch;
}
if (data[0])
map = LIBINPUT_CONFIG_CLICKFINGER_MAP_LRM;
else if (data[1])
map = LIBINPUT_CONFIG_CLICKFINGER_MAP_LMR;
else
return BadValue;
if (!checkonly)
driver_data->options.clickfinger_button_map = map;
#endif
return Success;
}
static inline int static inline int
LibinputSetPropertyMiddleEmulation(DeviceIntPtr dev, LibinputSetPropertyMiddleEmulation(DeviceIntPtr dev,
Atom atom, Atom atom,
@@ -4916,6 +5146,7 @@ prop_draglock_set_pairs(struct xf86libinput *driver_data,
int data[MAX_BUTTONS + 1] = {0}; int data[MAX_BUTTONS + 1] = {0};
int i; int i;
int highest = 0; int highest = 0;
const unsigned int max = MAX_BUTTONS;
if (len >= ARRAY_SIZE(data)) if (len >= ARRAY_SIZE(data))
return BadMatch; return BadMatch;
@@ -4926,7 +5157,7 @@ prop_draglock_set_pairs(struct xf86libinput *driver_data,
dl = (checkonly) ? &dummy : &driver_data->draglock; dl = (checkonly) ? &dummy : &driver_data->draglock;
for (i = 0; i < len; i += 2) { for (i = 0; i < len; i += 2) {
if (pairs[i] > MAX_BUTTONS) if (pairs[i] > max)
return BadValue; return BadValue;
data[pairs[i]] = pairs[i+1]; data[pairs[i]] = pairs[i+1];
@@ -5098,6 +5329,42 @@ LibinputSetPropertyPressureCurve(DeviceIntPtr dev,
return Success; return Success;
} }
static inline int
LibinputSetPropertyPressureRange(DeviceIntPtr dev,
Atom atom,
XIPropertyValuePtr val,
BOOL checkonly)
{
InputInfoPtr pInfo = dev->public.devicePrivate;
struct xf86libinput *driver_data = pInfo->private;
float *vals;
struct range range = { 0.0, 1.0 };
if (val->format != 32 || val->size != 2 || val->type != prop_float)
return BadMatch;
vals = val->data;
range.min = vals[0];
range.max = vals[1];
if (checkonly) {
if (range.min < 0.0 || range.max > 1.0 || range.min >= range.max)
return BadValue;
/* Disallow reducing the range to less than 20% of the range, mostly
* to avoid footguns */
if (range.max - range.min < 0.2)
return BadValue;
if (!xf86libinput_check_device(dev, atom))
return BadMatch;
} else {
driver_data->options.pressure_range = range;
}
return Success;
}
static inline int static inline int
LibinputSetPropertyAreaRatio(DeviceIntPtr dev, LibinputSetPropertyAreaRatio(DeviceIntPtr dev,
Atom atom, Atom atom,
@@ -5182,8 +5449,9 @@ LibinputSetPropertyHighResolutionScroll(DeviceIntPtr dev,
} }
static int static int
LibinputSetProperty(DeviceIntPtr dev, Atom atom, XIPropertyValuePtr val, LibinputSetProperty(DeviceIntPtr dev, Atom atom,
BOOL checkonly) XIPropertyValuePtr val,
BOOL checkonly)
{ {
int rc; int rc;
@@ -5226,6 +5494,8 @@ LibinputSetProperty(DeviceIntPtr dev, Atom atom, XIPropertyValuePtr val,
rc = LibinputSetPropertyScrollButtonLock(dev, atom, val, checkonly); rc = LibinputSetPropertyScrollButtonLock(dev, atom, val, checkonly);
else if (atom == prop_click_method_enabled) else if (atom == prop_click_method_enabled)
rc = LibinputSetPropertyClickMethod(dev, atom, val, checkonly); rc = LibinputSetPropertyClickMethod(dev, atom, val, checkonly);
else if (atom == prop_clickfinger_buttonmap)
rc = LibinputSetPropertyClickfingerButtonmap(dev, atom, val, checkonly);
else if (atom == prop_middle_emulation) else if (atom == prop_middle_emulation)
rc = LibinputSetPropertyMiddleEmulation(dev, atom, val, checkonly); rc = LibinputSetPropertyMiddleEmulation(dev, atom, val, checkonly);
else if (atom == prop_disable_while_typing) else if (atom == prop_disable_while_typing)
@@ -5249,36 +5519,43 @@ LibinputSetProperty(DeviceIntPtr dev, Atom atom, XIPropertyValuePtr val,
rc = LibinputSetPropertyRotationAngle(dev, atom, val, checkonly); rc = LibinputSetPropertyRotationAngle(dev, atom, val, checkonly);
else if (atom == prop_pressurecurve) else if (atom == prop_pressurecurve)
rc = LibinputSetPropertyPressureCurve(dev, atom, val, checkonly); rc = LibinputSetPropertyPressureCurve(dev, atom, val, checkonly);
else if (atom == prop_pressure_range)
rc = LibinputSetPropertyPressureRange(dev, atom, val, checkonly);
else if (atom == prop_area_ratio) else if (atom == prop_area_ratio)
rc = LibinputSetPropertyAreaRatio(dev, atom, val, checkonly); rc = LibinputSetPropertyAreaRatio(dev, atom, val, checkonly);
else if (atom == prop_hires_scroll) else if (atom == prop_hires_scroll)
rc = LibinputSetPropertyHighResolutionScroll(dev, atom, val, checkonly); rc = LibinputSetPropertyHighResolutionScroll(dev, atom, val, checkonly);
else if (atom == prop_device || atom == prop_product_id || else if (atom == prop_accel_default ||
atom == prop_tap_default ||
atom == prop_tap_drag_default ||
atom == prop_tap_drag_lock_default ||
atom == prop_tap_buttonmap_default ||
atom == prop_calibration_default ||
atom == prop_accel_default ||
atom == prop_accel_profile_default || atom == prop_accel_profile_default ||
atom == prop_natural_scroll_default || atom == prop_calibration_default ||
atom == prop_sendevents_default ||
atom == prop_sendevents_available ||
atom == prop_left_handed_default ||
atom == prop_scroll_method_default ||
atom == prop_scroll_methods_available ||
atom == prop_scroll_button_default ||
atom == prop_scroll_buttonlock_default ||
atom == prop_scroll_pixel_distance_default ||
atom == prop_click_method_default || atom == prop_click_method_default ||
atom == prop_click_methods_available || atom == prop_click_methods_available ||
atom == prop_middle_emulation_default || atom == prop_clickfinger_buttonmap_default ||
atom == prop_disable_while_typing_default || atom == prop_disable_while_typing_default ||
atom == prop_left_handed_default ||
atom == prop_middle_emulation_default ||
atom == prop_mode_groups_available || atom == prop_mode_groups_available ||
atom == prop_mode_groups_buttons || atom == prop_mode_groups_buttons ||
atom == prop_mode_groups_rings || atom == prop_mode_groups_rings ||
atom == prop_mode_groups_strips || atom == prop_mode_groups_strips ||
atom == prop_rotation_angle_default) atom == prop_natural_scroll_default ||
atom == prop_product_id ||
atom == prop_pressure_range_default ||
atom == prop_rotation_angle_default ||
atom == prop_scroll_button_default ||
atom == prop_scroll_buttonlock_default ||
atom == prop_scroll_method_default ||
atom == prop_scroll_methods_available ||
atom == prop_scroll_pixel_distance_default ||
atom == prop_sendevents_available ||
atom == prop_sendevents_default ||
atom == prop_serial ||
atom == prop_tap_buttonmap_default ||
atom == prop_tap_default ||
atom == prop_tap_drag_default ||
atom == prop_tap_drag_lock_default ||
atom == prop_tool_id ||
atom == prop_device)
return BadAccess; /* read-only */ return BadAccess; /* read-only */
else else
return Success; return Success;
@@ -5955,6 +6232,63 @@ LibinputInitClickMethodsProperty(DeviceIntPtr dev,
methods); methods);
} }
static void
LibinputInitClickfingerButtonmapProperty(DeviceIntPtr dev,
struct xf86libinput *driver_data,
struct libinput_device *device)
{
#if HAVE_LIBINPUT_CLICKFINGER_BUTTON_MAP
enum libinput_config_clickfinger_button_map map;
BOOL data[2] = {0};
if (!subdevice_has_capabilities(dev, CAP_POINTER))
return;
uint32_t click_methods = libinput_device_config_click_get_methods(device);
if ((click_methods & LIBINPUT_CONFIG_CLICK_METHOD_CLICKFINGER) == 0)
return;
map = driver_data->options.clickfinger_button_map;
switch (map) {
case LIBINPUT_CONFIG_CLICKFINGER_MAP_LRM:
data[0] = 1;
break;
case LIBINPUT_CONFIG_CLICKFINGER_MAP_LMR:
data[1] = 1;
break;
default:
break;
}
prop_clickfinger_buttonmap = LibinputMakeProperty(dev,
LIBINPUT_PROP_CLICKFINGER_BUTTONMAP,
XA_INTEGER, 8,
2, data);
if (!prop_clickfinger_buttonmap)
return;
map = libinput_device_config_click_get_default_clickfinger_button_map(device);
memset(data, 0, sizeof(data));
switch (map) {
case LIBINPUT_CONFIG_CLICKFINGER_MAP_LRM:
data[0] = 1;
break;
case LIBINPUT_CONFIG_CLICKFINGER_MAP_LMR:
data[1] = 1;
break;
default:
break;
}
prop_clickfinger_buttonmap_default = LibinputMakeProperty(dev,
LIBINPUT_PROP_CLICKFINGER_BUTTONMAP_DEFAULT,
XA_INTEGER, 8,
2, data);
#endif
}
static void static void
LibinputInitMiddleEmulationProperty(DeviceIntPtr dev, LibinputInitMiddleEmulationProperty(DeviceIntPtr dev,
struct xf86libinput *driver_data, struct xf86libinput *driver_data,
@@ -6248,6 +6582,44 @@ LibinputInitPressureCurveProperty(DeviceIntPtr dev,
8, data); 8, data);
} }
static void
LibinputInitPressureRangeProperty(DeviceIntPtr dev,
struct xf86libinput *driver_data)
{
#if HAVE_LIBINPUT_PRESSURE_RANGE
struct libinput_tablet_tool *tool = driver_data->tablet_tool;
const struct range *range = &driver_data->options.pressure_range;
float data[2] = {
range->min,
range->max,
};
if ((driver_data->capabilities & CAP_TABLET_TOOL) == 0)
return;
if (!tool || !libinput_tablet_tool_config_pressure_range_is_available(tool))
return;
prop_pressure_range = LibinputMakeProperty(dev,
LIBINPUT_PROP_TABLET_TOOL_PRESSURE_RANGE,
prop_float, 32,
2, &data);
if (!prop_pressure_range)
return;
data[0] = libinput_tablet_tool_config_pressure_range_get_default_minimum(tool);
data[1] = libinput_tablet_tool_config_pressure_range_get_default_maximum(tool);
prop_pressure_range_default = LibinputMakeProperty(dev,
LIBINPUT_PROP_TABLET_TOOL_PRESSURE_RANGE_DEFAULT,
prop_float, 32,
2, &data);
if (!prop_pressure_range_default)
return;
#endif
}
static void static void
LibinputInitTabletAreaRatioProperty(DeviceIntPtr dev, LibinputInitTabletAreaRatioProperty(DeviceIntPtr dev,
struct xf86libinput *driver_data) struct xf86libinput *driver_data)
@@ -6267,6 +6639,36 @@ LibinputInitTabletAreaRatioProperty(DeviceIntPtr dev,
2, data); 2, data);
} }
static void
LibinputInitTabletSerialProperty(DeviceIntPtr dev,
struct xf86libinput *driver_data)
{
struct libinput_tablet_tool *tool = driver_data->tablet_tool;
uint32_t serial, tool_id;
if ((driver_data->capabilities & CAP_TABLET_TOOL) == 0)
return;
if (!tool)
return;
/* Serial prop is always created to indicate when we don't have a serial */
serial = libinput_tablet_tool_get_serial(tool);
prop_serial = LibinputMakeProperty(dev,
LIBINPUT_PROP_TABLET_TOOL_SERIAL,
XA_CARDINAL, 32,
1, &serial);
/* The tool ID prop is only created if we have a known tool id */
tool_id = libinput_tablet_tool_get_tool_id(tool);
if (tool_id) {
prop_tool_id = LibinputMakeProperty(dev,
LIBINPUT_PROP_TABLET_TOOL_ID,
XA_CARDINAL, 32,
1, &tool_id);
}
}
static void static void
LibinputInitHighResolutionScrollProperty(DeviceIntPtr dev, LibinputInitHighResolutionScrollProperty(DeviceIntPtr dev,
struct xf86libinput *driver_data, struct xf86libinput *driver_data,
@@ -6303,6 +6705,7 @@ LibinputInitProperty(DeviceIntPtr dev)
LibinputInitDisableWhileTypingProperty(dev, driver_data, device); LibinputInitDisableWhileTypingProperty(dev, driver_data, device);
LibinputInitScrollMethodsProperty(dev, driver_data, device); LibinputInitScrollMethodsProperty(dev, driver_data, device);
LibinputInitClickMethodsProperty(dev, driver_data, device); LibinputInitClickMethodsProperty(dev, driver_data, device);
LibinputInitClickfingerButtonmapProperty(dev, driver_data, device);
LibinputInitMiddleEmulationProperty(dev, driver_data, device); LibinputInitMiddleEmulationProperty(dev, driver_data, device);
LibinputInitRotationAngleProperty(dev, driver_data, device); LibinputInitRotationAngleProperty(dev, driver_data, device);
LibinputInitAccelProperty(dev, driver_data, device); LibinputInitAccelProperty(dev, driver_data, device);
@@ -6341,6 +6744,8 @@ LibinputInitProperty(DeviceIntPtr dev)
LibinputInitHorizScrollProperty(dev, driver_data); LibinputInitHorizScrollProperty(dev, driver_data);
LibinputInitScrollPixelDistanceProperty(dev, driver_data, device); LibinputInitScrollPixelDistanceProperty(dev, driver_data, device);
LibinputInitPressureCurveProperty(dev, driver_data); LibinputInitPressureCurveProperty(dev, driver_data);
LibinputInitPressureRangeProperty(dev, driver_data);
LibinputInitTabletAreaRatioProperty(dev, driver_data); LibinputInitTabletAreaRatioProperty(dev, driver_data);
LibinputInitTabletSerialProperty(dev, driver_data);
LibinputInitHighResolutionScrollProperty(dev, driver_data, device); LibinputInitHighResolutionScrollProperty(dev, driver_data, device);
} }

View File

@@ -233,6 +233,7 @@ test_filter_meta_passthrough(void)
int i; int i;
rc = draglock_init_from_string(&dl, "10"); rc = draglock_init_from_string(&dl, "10");
assert(rc == 0);
for (i = 0; i < 10; i++) { for (i = 0; i < 10; i++) {
button = i; button = i;
@@ -259,6 +260,7 @@ test_filter_meta_click_meta_only(void)
int button, press; int button, press;
rc = draglock_init_from_string(&dl, "10"); rc = draglock_init_from_string(&dl, "10");
assert(rc == 0);
button = 10; button = 10;
press = 1; press = 1;
@@ -283,6 +285,7 @@ test_filter_meta(void)
int i; int i;
rc = draglock_init_from_string(&dl, "10"); rc = draglock_init_from_string(&dl, "10");
assert(rc == 0);
for (i = 1; i < 10; i++) { for (i = 1; i < 10; i++) {
/* meta down */ /* meta down */
@@ -339,6 +342,7 @@ test_filter_meta_extra_click(void)
int i; int i;
rc = draglock_init_from_string(&dl, "10"); rc = draglock_init_from_string(&dl, "10");
assert(rc == 0);
for (i = 1; i < 10; i++) { for (i = 1; i < 10; i++) {
/* meta down */ /* meta down */
@@ -409,6 +413,7 @@ test_filter_meta_interleaved(void)
int i; int i;
rc = draglock_init_from_string(&dl, "10"); rc = draglock_init_from_string(&dl, "10");
assert(rc == 0);
for (i = 1; i < 10; i++) { for (i = 1; i < 10; i++) {
/* meta down */ /* meta down */
@@ -467,6 +472,7 @@ test_filter_pairs(void)
int i; int i;
rc = draglock_init_from_string(&dl, "1 11 2 0 3 13 4 0 5 15 6 0 7 17 8 0 9 19"); rc = draglock_init_from_string(&dl, "1 11 2 0 3 13 4 0 5 15 6 0 7 17 8 0 9 19");
assert(rc == 0);
for (i = 1; i < 10; i++) { for (i = 1; i < 10; i++) {
button = i; button = i;