Compare commits

...

32 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
Peter Hutterer
46af622e9d xf86-input-libinput 1.4.0
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2023-08-25 13:51:18 +10:00
Peter Hutterer
5e20d16dd4 Don't try to enable a NULL device
If there is no other libinput device in our list (and next is thus NULL),
skip the xf86AddEnabledDevice() call.

Fixes #60
2023-07-10 09:05:19 +10:00
Peter Hutterer
310db4206f Don't run past the last element in the list
If there is no (other) libinput device in the current device list, we'd
eventually end up with next == NULL, causing a segfault.

Fixes #60
2023-07-03 13:33:19 +10:00
Peter Hutterer
94a52a8488 tablet: map BTN_STYLUS3 to button 8
Buttons 4-7 are out of bounds for hysterical historical reasons.
Previously this button fell through to the default statement and
resulted in 8 + BTN_STYLUS3 - BTN_SIDE == 65 which is rather obviously
wrong.

Instead, map it explicitly to what the fourth button would be mapped to
on other devices. This will now overlap with BTN_SIDE on devices that
both BTN_STYLUS3 *and* BTN_SIDE but those devices don't appear to exist
in the real world.

Fixes #50

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2023-06-15 15:09:31 +10:00
Peter Hutterer
a4dfadee2f Initialize the left-handed property for tablet tools
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2023-06-08 14:14:37 +10:00
Peter Hutterer
141aa867a6 Change the capabilities to an enum
Slightly nicer for debugging.
2023-06-08 14:14:37 +10:00
Yinon Burgansky
57b049d376 Improve documentation of the custom acceleration profile 2023-04-26 01:33:46 +03:00
9 changed files with 931 additions and 301 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
tags
.vimdir
test/test-bezier

View File

@@ -4,7 +4,7 @@
# Please see the ci-templates documentation for details:
# 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:
- project: 'freedesktop/ci-templates'
@@ -26,10 +26,10 @@ stages:
.fedora:
variables:
FDO_DISTRIBUTION_VERSION: 33
FDO_DISTRIBUTION_PACKAGES: 'git autoconf automake libtool make xorg-x11-server-devel libudev-devel libevdev-devel libinput-devel xorg-x11-util-macros'
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 diffutils'
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:
@@ -58,7 +58,7 @@ fedora@container_build:
- _builddir/config.log
fedora:33@default-build:
fedora@default-build:
extends:
- .fedora
- .fdo.distribution-image@fedora
@@ -81,18 +81,3 @@ check-commits:
reports:
junit: results.xml
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
AC_PREREQ([2.60])
AC_INIT([xf86-input-libinput],
[1.3.0],
[1.5.0],
[https://gitlab.freedesktop.org/xorg/driver/xf86-input-libinput/issues],
[xf86-input-libinput])
AC_CONFIG_SRCDIR([Makefile.am])
@@ -89,6 +89,39 @@ AC_LINK_IFELSE(
[AC_MSG_RESULT([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
CFLAGS=$OLD_CFLAGS

View File

@@ -51,6 +51,13 @@
/* Tap button default order: BOOL, 2 values in order LRM, LMR, read-only */
#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 */
#define LIBINPUT_PROP_CALIBRATION "libinput Calibration Matrix"
@@ -222,6 +229,15 @@
*/
#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 */
#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 */
#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_ */

View File

@@ -1,6 +1,7 @@
'\" t
.\" shorthand for double quote that works everywhere.
.ds q \N'34'
.TH LIBINPUT 4 @VERSION@
.TH LIBINPUT 4 2025-06-01 "@VERSION@"
.SH NAME
libinput \- libinput-based X.Org input driver
.SH SYNOPSIS
@@ -14,74 +15,93 @@ libinput \- libinput-based X.Org input driver
.fi
.SH NOTE
This is the man page for the X input driver. If you are looking for the
library documentation, go to
.BI http://wayland.freedesktop.org/libinput/doc/
This is the man page for the X input driver.
If you are looking for the library documentation, go to
.B http://wayland.freedesktop.org/libinput/doc/
.SH DESCRIPTION
.B libinput
is an Xorg input driver based on libinput. It
therefore supports all input devices that libinput can handle, including
is an Xorg input driver based on libinput.
It therefore supports all input devices that libinput can handle, including
most mice, keyboards, tablets and touchscreens.
.PP
It is recommended that
.B libinput
devices are configured through the
.B InputClass
directive (refer to xorg.conf(5)) instead of manual
per-device configuration. Devices configured in the
xorg.conf(5) are not hot-plug capable.
directive (refer to
.BR xorg.conf (5))
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
Please refer to xorg.conf(5) 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.
Please refer to
.BR xorg.conf (5)
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
The following driver
.B Options
are supported:
.TP 7
.BI "Option \*qAccelProfile\*q \*q" string \*q
Sets the pointer acceleration profile to the given profile. Permitted values
are
.BI adaptive,
.BI flat,
.BI custom.
Not all devices support this option or all profiles. If a profile is
unsupported, the default profile for this device is used. For a description
on the profiles and their behavior, see the libinput documentation.
Sets the pointer acceleration profile to the given profile.
Permitted values are
.BR adaptive ,
.BR flat ,
.BR custom .
Not all devices support this option or all profiles.
If a profile is unsupported, the default profile for this device is used.
For a description on the profiles and their behavior,
see the libinput documentation.
.TP 7
.BI "Option \*qAccelSpeed\*q \*q" float \*q
Sets the pointer acceleration speed within the range [-1, 1].
This only applies to the flat or adaptive profile.
.BI "Option \*AccelPointsFallback\*q \*q" string \*q
Sets the points of the Fallback acceleration function, (see the libinput documentation).
The string must be a space-separated list of floating point non-negative numbers, e.g.
.TP 7
.BI "Option \*qAccelPointsFallback\*q \*q" string \*q
.TQ
.BI "Option \*qAccelPointsMotion\*q \*q" string \*q
.TQ
.BI "Option \*qAccelPointsScroll\*q \*q" string \*q
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.,
"0.0 1.0 2.4 2.5".
This only applies to the custom profile.
.BI "Option \*AccelStepFallback\*q \*q" float \*q
Sets the step between the points of the Fallback acceleration function, (see the libinput documentation).
When a step of 0.0 is provided, libinput's default Fallback acceleration function is used.
See section
.B CUSTOM ACCELERATION PROFILE
.TP 7
.BI "Option \*qAccelStepFallback\*q \*q" float \*q
.TQ
.BI "Option \*qAccelStepMotion\*q \*q" float \*q
.TQ
.BI "Option \*qAccelStepScroll\*q \*q" float \*q
Sets the step between the points of the Fallback/Motion/Scroll
acceleration functions.
When a step of 0.0 is provided,
libinput's Fallback acceleration function is used.
This only applies to the custom profile.
.BI "Option \*AccelPointsMotion\*q \*q" string \*q
Equivalent to AccelPointsFallback but applies to the Motion acceleration function.
.BI "Option \*AccelStepMotion\*q \*q" float \*q
Equivalent to AccelStepFallback but applies to the Motion acceleration function.
.BI "Option \*AccelPointsScroll\*q \*q" string \*q
Equivalent to AccelPointsFallback but applies to the Scroll acceleration function.
.BI "Option \*AccelStepScroll\*q \*q" float \*q
Equivalent to AccelStepFallback but applies to the Scroll acceleration function.
See section
.B CUSTOM ACCELERATION PROFILE
.TP 7
.BI "Option \*qButtonMapping\*q \*q" string \*q
Sets the logical button mapping for this device, see
XSetPointerMapping(3). The string must be a
space-separated list of button mappings in the order of the
.BR XSetPointerMapping (3).
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.
The default mapping is "1 2 3 ... 32". A mapping of 0
deactivates the button. Multiple buttons can have the same mapping.
The default mapping is "1 2 3 ... 32".
A mapping of 0 deactivates the button.
Multiple buttons can have the same 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
default mapping. See section
is used for all buttons.
Buttons not specified in the user's mapping use the default mapping.
See section
.B BUTTON MAPPING
for more details.
.TP 7
@@ -92,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).
.TP 7
.BI "Option \*qClickMethod\*q \*q" string \*q
Enables a click method. Permitted values are
.BI none,
.BI buttonareas,
.BI clickfinger.
Not all devices support all methods, if an option is unsupported, the
default click method for this device is used.
Enables a click method.
Permitted values are
.BR none ,
.BR buttonareas ,
.BR clickfinger .
Not all devices support all methods.
If an option is unsupported, the default click method for this device is used.
.TP 7
.BI "Option \*qDisableWhileTyping\*q \*q" bool \*q
Indicates if the touchpad should be disabled while typing on the keyboard
(this does not apply to modifier keys such as Ctrl or Alt).
.TP 7
.BI "Option \*qDevice\*q \*q" string \*q
Specifies the device through which the device can be accessed. This will
generally be of the form \*q/dev/input/eventX\*q, where X is some integer.
Specifies the device through which the device can be accessed.
This will generally be of the form \*q/dev/input/eventX\*q,
where X is some integer.
When using
.B InputClass
directives, this option is set by the server.
The mapping from device node to hardware is system-dependent. Property:
"Device Node" (read-only).
The mapping from device node to hardware is system-dependent.
Property: "Device Node" (read-only).
.TP 7
.BI "Option \*qDragLockButtons\*q \*q" "L1 B1 L2 B2 ..." \*q
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
of the same button is required.
been physically released.
To logically release a locked button,
a second click of the same button is required.
.IP
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
for details.
.IP
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
to be locked. See section
to be locked.
See section
.B BUTTON DRAG LOCK
for details.
.IP
For both meta and button pair configuration, the button numbers are
device button numbers, i.e. the
For both meta and button pair configuration,
the button numbers are device button numbers, i.e. the
.B ButtonMapping
applies after drag lock.
.TP 7
@@ -139,77 +164,96 @@ the driver forwards only high-resolution wheel scroll events from libinput.
When disabled, the driver forwards legacy wheel scroll events instead.
.TP 7
.BI "Option \*qHorizontalScrolling\*q \*q" bool \*q
Enables or disables horizontal scrolling. When disabled, this driver will
discard any horizontal scroll events from libinput. This does not disable
horizontal scroll events from libinput; it merely discards the horizontal axis
from any scroll events. Default is enabled.
Enables or disables horizontal scrolling.
When disabled,
this driver will discard any horizontal scroll events from libinput.
This does not disable horizontal scroll events from libinput;
it merely discards the horizontal axis from any scroll events.
Default is enabled.
.TP 7
.BI "Option \*qLeftHanded\*q \*q" bool \*q
Enables left-handed button orientation, i.e. swapping left and right buttons.
.TP 7
.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.
.TP 7
.BI "Option \*qNaturalScrolling\*q \*q" bool \*q
Enables or disables natural scrolling behavior.
.TP 7
.BI "Option \*qRotationAngle\*q \*q" float \*q
Sets the rotation angle of the device to the given angle, in degrees
clockwise. The angle must be between 0.0 (inclusive) and 360.0 (exclusive).
Sets the rotation angle of the device to the given angle, in degrees clockwise.
The angle must be between 0.0 (inclusive) and 360.0 (exclusive).
.TP 7
.BI "Option \*qScrollButton\*q \*q" int \*q
Designates a button as scroll button. If the
.BI ScrollMethod
Designates a button as scroll button.
If the
.B ScrollMethod
is
.BI button
.B button
and the button is logically down, x/y axis movement is converted into
scroll events.
.TP 7
.BI "Option \*qScrollButtonLock\*q \*q" bool \*q
Enables or disables the scroll button lock. If enabled, the
.BI ScrollButton
Enables or disables the scroll button lock.
If enabled, the
.B ScrollButton
is considered logically down after the first click and remains down until
the second click of that button. If disabled (the default), the
.BI ScrollButton
the second click of that button.
If disabled (the default), the
.B ScrollButton
button is considered logically down while held down and up once physically
released.
.TP 7
.BI "Option \*qScrollMethod\*q \*q" string \*q
Enables a scroll method. Permitted values are
.BI none,
.BI twofinger,
.BI edge,
.BI button.
Not all devices support all options, if an option is unsupported, the
default scroll option for this device is used.
.BR none ,
.BR twofinger ,
.BR edge ,
.BR button .
Not all devices support all options.
If an option is unsupported, the default scroll option for this device is used.
.TP 7
.BI "Option \*qScrollPixelDistance\*q \*q" int \*q
Sets the movement distance, in "pixels", required to trigger one logical
wheel click. This option only applies to the scroll methods
.BI twofinger,
.BI edge,
.BI button.
wheel click.
This option only applies to the scroll methods
.BR twofinger ,
.BR edge ,
.BR button .
See section
.B SCROLL PIXEL DISTANCE
for more details.
.TP 7
.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
mouse is connected".
Sets the send events mode to disabled, enabled,
or "disable when an external mouse is connected".
.TP 7
.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
points. The respective x/y coordinate must be in the [0.0, 1.0] range. For
more information see section
.B TABLET STYLUS PRESSURE CURVE.
points.
The respective x/y coordinate must be in the [0.0, 1.0] range.
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
.BI "Option \*qTabletToolAreaRatio\*q \*q" "w:h" \*q
Sets the area ratio for a tablet tool. The area always starts at the
origin (0/0) and expands to the largest available area with the specified
aspect ratio. Events outside this area are cropped to the area. The special
value "default" is used for the default mapping (i.e. the device-native
mapping). For more information see section
Sets the area ratio for a tablet tool.
The area always starts at the origin (0/0) and
expands to the largest available area with the specified aspect ratio.
Events outside this area are cropped to the area.
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.
.TP 7
.BI "Option \*qTapping\*q \*q" bool \*q
@@ -220,150 +264,189 @@ Set the button mapping for 1/2/3-finger taps to left/right/middle or
left/middle/right, respectively.
.TP 7
.BI "Option \*qTappingDrag\*q \*q" bool \*q
Enables or disables drag during tapping behavior ("tap-and-drag"). When
enabled, a tap followed by a finger held down causes a single button down
Enables or disables drag during tapping behavior ("tap-and-drag").
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.
Tap-and-drag requires option
.B Tapping
to be enabled.
.TP 7
.BI "Option \*qTappingDragLock\*q \*q" bool \*q
Enables or disables drag lock during tapping behavior. When enabled, a
finger up during tap-and-drag will not immediately release the button. If
the finger is set down again within the timeout, the dragging process
continues.
Enables or disables drag lock during tapping behavior.
When enabled,
a finger up during tap-and-drag will not immediately release the button.
If the finger is set down again within the timeout,
the dragging process continues.
.PP
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
libinput. On configuration failure, the default value is applied.
configuration option.
For all options, the default value is the one used by libinput.
On configuration failure, the default value is applied.
.SH SUPPORTED PROPERTIES
.B libinput
exports runtime-configurable options as properties. If a property listed
below is not available, the matching configuration option is not available
on the device. This however does not imply that the feature is not available
on the device. The following properties are provided by the
exports runtime-configurable options as properties.
If a property listed below is not available,
the matching configuration option is not available on the device.
This however does not imply that the feature is not available on the device.
The following properties are provided by the
.B libinput
driver.
.TP 7
.BI "libinput Accel Profiles Available"
2 boolean values (8 bit, 0 or 1), in order "adaptive", "flat".
.B "libinput Accel Profiles Available"
3 boolean values (8 bit, 0 or 1), in order "adaptive", "flat", "custom".
Indicates which acceleration profiles are available on this device.
.TP 7
.BI "libinput Accel Profile Enabled"
2 boolean values (8 bit, 0 or 1), in order "adaptive", "flat".
.B "libinput Accel Profile Enabled"
3 boolean values (8 bit, 0 or 1), in order "adaptive", "flat", "custom".
Indicates which acceleration profile is currently enabled on this device.
.TP 7
.BI "libinput Accel Speed"
1 32-bit float value, defines the pointer speed. Value range -1, 1
.B "libinput Accel Speed"
1 32-bit float value, defines the pointer speed.
Value range -1, 1.
This only applies to the flat or adaptive profile.
.TP 7
.BI "libinput Button Scrolling Button"
1 32-bit value. Sets the button number to use for button scrolling. This
setting is independent of the scroll method, to enable button scrolling the
.B "libinput Accel Custom Fallback Points"
.TQ
.B "libinput Accel Custom Motion Points"
.TQ
.B "libinput Accel Custom Scroll Points"
A space-separated list of 32-bit floating point non-negative numbers, e.g.
"0.0 1.0 2.4 2.5".
Sets the points of the Fallback/Motion/Scroll acceleration functions.
This only applies to the custom profile.
See section
.B CUSTOM ACCELERATION PROFILE
.TP 7
.B "libinput Accel Custom Fallback Step"
.TQ
.B "libinput Accel Custom Motion Step"
.TQ
.B "libinput Accel Custom Scroll Step"
1 32-bit float value, sets the step between the points of the
Fallback/Motion/Scroll acceleration functions.
When a step of 0.0 is provided, libinput's Fallback acceleration
function is used.
This only applies to the custom profile.
See section
.B CUSTOM ACCELERATION PROFILE
.TP 7
.B "libinput Button Scrolling Button"
1 32-bit value. Sets the button number to use for button scrolling.
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.
.TP 7
.BI "libinput Button Scrolling Button Lock Enabled"
1 boolean value. If true, the scroll button lock is enabled. This
setting is independent of the scroll method or the scroll button, to enable
.B "libinput Button Scrolling Button Lock Enabled"
1 boolean value. If true, the scroll button lock is enabled.
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 must be set.
.TP 7
.BI "libinput Calibration Matrix"
.B "libinput Calibration Matrix"
9 32-bit float values, representing a 3x3 calibration matrix, order is row
1, row 2, row 3
.TP 7
.BI "libinput Click Methods Available"
.B "libinput Click Methods Available"
2 boolean values (8 bit, 0 or 1), in order "buttonareas", "clickfinger".
Indicates which click methods are available on this device.
.TP 7
.BI "libinput Click Methods Enabled"
.B "libinput Click Methods Enabled"
2 boolean values (8 bit, 0 or 1), in order "buttonareas", "clickfinger".
Indicates which click methods are enabled on this device.
.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
button pairs. See section
button pairs.
See section
.B BUTTON DRAG LOCK
for details.
.TP 7
.BI "libinput High Resolution Wheel Scroll Enabled"
1 boolean value (8 bit, 0 or 1). Indicates whether high-resolution
wheel scroll events are enabled or not.
.B "libinput High Resolution Wheel Scroll Enabled"
1 boolean value (8 bit, 0 or 1).
Indicates whether high-resolution wheel scroll events are enabled or not.
.TP 7
.BI "libinput Horizontal Scroll Enabled"
1 boolean value (8 bit, 0 or 1). Indicates whether horizontal scrolling
events are enabled or not.
.B "libinput Horizontal Scroll Enabled"
1 boolean value (8 bit, 0 or 1).
Indicates whether horizontal scrolling events are enabled or not.
.TP 7
.BI "libinput Left Handed Enabled"
1 boolean value (8 bit, 0 or 1). Indicates if left-handed mode is enabled or
disabled.
.B "libinput Left Handed Enabled"
1 boolean value (8 bit, 0 or 1).
Indicates if left-handed mode is enabled or disabled.
.TP 7
.BI "libinput Middle Emulation Enabled"
1 boolean value (8 bit, 0 or 1). Indicates if middle emulation is enabled or
disabled.
.B "libinput Middle Emulation Enabled"
1 boolean value (8 bit, 0 or 1).
Indicates if middle emulation is enabled or disabled.
.TP 7
.BI "libinput Natural Scrolling Enabled"
1 boolean value (8 bit, 0 or 1). 1 enables natural scrolling
.B "libinput Natural Scrolling Enabled"
1 boolean value (8 bit, 0 or 1).
1 enables natural scrolling.
.TP 7
.BI "libinput Rotation Angle"
1 32-bit float value [0.0 to 360.0). Sets the rotation angle of the device,
.B "libinput Rotation Angle"
1 32-bit float value [0.0 to 360.0).
Sets the rotation angle of the device,
clockwise of its natural neutral position.
.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".
Indicates which scroll methods are available on this device.
.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".
Indicates which scroll method is currently enabled on this device.
.TP 7
.BI "libinput Scroll Pixel Distance"
.B "libinput Scroll Pixel Distance"
1 32-bit value (nonzero, with additional implementation-defined range checks).
Changes the movement distance required to trigger one logical wheel click.
.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
"disabled-on-external-mouse". Indicates which send-event modes are available
on this device.
"disabled-on-external-mouse".
Indicates which send-event modes are available on this device.
.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
"disabled-on-external-mouse". Indicates which send-event modes is currently
enabled on this device.
"disabled-on-external-mouse".
Indicates which send-event mode is currently enabled on this device.
.TP 7
.BI "libinput Tablet Tool Pressurecurve"
4 32-bit float values [0.0 to 1.0]. See section
.B "libinput Tablet Tool Pressurecurve"
4 32-bit float values [0.0 to 1.0].
See section
.B TABLET TOOL PRESSURE CURVE
.TP 7
.BI "libinput Tablet Tool Area Ratio"
2 32-bit values, corresponding to width and height. Special value 0, 0
resets to the default ratio. See section
.B "libinput Tablet Tool Area Ratio"
2 32-bit values, corresponding to width and height.
Special value 0, 0 resets to the default ratio.
See section
.B TABLET TOOL AREA RATIO
for more information.
.TP 7
.BI "libinput Tapping Enabled"
1 boolean value (8 bit, 0 or 1). 1 enables tapping
.B "libinput Tapping Enabled"
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
.BI "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.
.B "libinput Tapping Drag Lock Enabled"
1 boolean value (8 bit, 0 or 1).
1 enables drag lock during tapping.
.TP 7
.BI "libinput Tapping Drag Lock Enabled"
1 boolean value (8 bit, 0 or 1). 1 enables drag lock during tapping
.TP 7
.BI "libinput Disable While Typing Enabled"
1 boolean value (8 bit, 0 or 1). Indicates if disable while typing is
enabled or disabled.
.B "libinput Disable While Typing Enabled"
1 boolean value (8 bit, 0 or 1).
Indicates if disable while typing is enabled or disabled.
.PP
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.
.SH BUTTON MAPPING
X clients receive events with logical button numbers, where 1, 2, 3
are usually interpreted as left, middle, right and logical buttons 4, 5, 6,
7 are usually interpreted as scroll up, down, left, right. The fourth and
fifth physical buttons on a device will thus send logical buttons 8 and 9.
X clients receive events with logical button numbers,
where 1, 2, 3 are usually interpreted as left, middle, right;
and logical buttons 4, 5, 6, 7 are usually interpreted
as scroll up, down, left, right.
The fourth and fifth physical buttons on a device
will thus send logical buttons 8 and 9.
The
.B ButtonMapping
option adjusts the logical button mapping, it does not affect how a physical
@@ -381,81 +464,129 @@ option instead.
The
.B libinput
Xorg input driver does not use the button mapping after setup.
Use XSetPointerMapping(3) to modify the button mapping at
runtime.
Use
.BR XSetPointerMapping (3)
to modify the button mapping at runtime.
.SH BUTTON DRAG LOCK
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
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
that button held logically down until a subsequent click of that same
button. The meta button events themselves are discarded. A separate meta
button click is required each time a drag lock should be activated for a
button in the future.
button press of any other button.
A button click in the future will keep that button held logically down
until a subsequent click of that same button.
The meta button events themselves are discarded.
A separate meta button click is required each time a drag lock should be
activated for a button in the future.
.PP
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
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.
.TP
.PP
This feature is provided by this driver, not by libinput.
.SH TABLET TOOL PRESSURECURVE
The pressure curve affects how stylus pressure is reported. By default, the
hardware pressure is reported as-is. By setting a pressure curve, the feel
of the stylus can be adjusted to be more like e.g. a pencil or a brush.
.SH TABLET TOOL PRESSURE CURVE
The pressure curve affects how stylus pressure is reported.
By default, the hardware pressure is reported as-is.
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
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
applied to the tablet's pressure input so that the highest pressure maps to
1.0. The points must have increasing x coordinates, if x0 is larger than 0.0
all pressure values lower than x0 are equivalent to y0. If x3 is less than
1.0, all pressure values higher than x3 are equivalent to y3.
The input for a linear curve (default) is "0.0/0.0 0.0/0.0 1.0/1.0 1.0/1.0";
a slightly
depressed curve (firmer) might be "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".
.TP
of 0.0 to 1.0 between the four points provided.
This normalized range is applied to the tablet's pressure input
so that the highest pressure maps to 1.0.
The points must have increasing x coordinates, if x0 is larger than 0.0
all pressure values lower than x0 are equivalent to y0.
If x3 is less than 1.0,
all pressure values higher than x3 are equivalent to y3.
.PP
The input for a linear curve (default) is "0.0/0.0 0.0/0.0 1.0/1.0 1.0/1.0";
a slightly depressed curve (firmer) might be
"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.
.SH TABLET TOOL AREA RATIO
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
the Wacom Intuos series, the height:width ratio of the tablet may be
different to that of the monitor, causing the skew of input data.
area is mapped to the available screen area.
For external tablets like the Wacom Intuos series,
the height:width ratio of the tablet may be different to that of the monitor,
causing the skew of input data.
.PP
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
available area of the tablet to the largest available area with a ratio of
4:3. Events within this area will scale to the tablet's announced axis
range, the area ratio is thus transparent to the X server. 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.
ratio of the screen device.
For example, a ratio of 4:3 will reduce the available area of the tablet
to the largest available area with a ratio of 4:3.
Events within this area will scale to the tablet's announced axis range,
the area ratio is thus transparent to the X server.
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.
.TP
.PP
This feature is provided by this driver, not by libinput.
.SH SCROLL PIXEL DISTANCE
The X server does not support per-pixel scrolling but it does support
smooth scrolling. All scroll events however are based around a logical
unit of scrolling (traditionally corresponding to a wheel click).
smooth scrolling.
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
driver to scroll by 1/10th of a logical wheel click.
.PP
libinput provides scroll data in pixels. The \fBScrollPixelDistance\fR
option defines the amount of movement equivalent to one wheel click. For
example, a value of 50 means the user has to move a finger by 50 pixels to
libinput provides scroll data in pixels.
The \fBScrollPixelDistance\fR option defines the amount of movement equivalent
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.
.SH CUSTOM ACCELERATION PROFILE
The custom pointer acceleration profile gives users full control over the
acceleration behavior at different speeds.
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.
.PP
The custom acceleration function is defined using n points which are spaced
uniformly along the x-axis, starting from 0 and continuing in constant steps.
Thus the points defining the custom function are:
.EX
(0 * step, f[0]), (1 * step, f[1]), ..., ((n-1) * step, f[n-1])
.EE
When a velocity value does not lie exactly on those points,
a linear interpolation/extrapolation of the two closest points
will be calculated.
.PP
There are 3 custom acceleration functions,
which are used for different movement types:
.TS
tab(;) allbox;
l l l.
Movement type; Uses; supported by
Fallback; Catch-all default movement type; All devices
Motion; Used for pointer motion; All devices
Scroll; Used for scroll movement; Mouse, Touchpad
.TE
.PP
See libinput library documentation for more details:
https://wayland.freedesktop.org/libinput/doc/latest/pointer-acceleration.html#the-custom-acceleration-profile
.SH BUGS
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
usually be worked by using \fBSection \*qInputClass\*q\fR with an
appropriate \fBMatch*\fR statement in the xorg.conf(5).
node in \fI/dev/input/by-id\fR and \fI/dev/input/by-path\fR.
This can be usually be worked by using \fBSection \*qInputClass\*q\fR with an
appropriate \fBMatch*\fR statement in the
.BR xorg.conf (5).
.SH AUTHORS
Peter Hutterer
.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',
version: '1.3.0', # bump version in configure.ac
version: '1.5.0', # bump version in configure.ac
default_options: ['warning_level=2'],
meson_version: '>= 0.50.0')
@@ -57,6 +57,21 @@ if cc.has_function('libinput_config_accel_create',
dependencies: dep_libinput)
config_h.set('HAVE_LIBINPUT_CUSTOM_ACCEL', 1)
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')
if dir_headers == ''
@@ -135,6 +150,8 @@ configure_file(
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)
# Now generate config.h

View File

@@ -80,13 +80,15 @@
#define TABLET_STRIP_AXIS_MAX 4096
#define TABLET_RING_AXIS_MAX 71
#define CAP_KEYBOARD 0x1
#define CAP_POINTER 0x2
#define CAP_TOUCH 0x4
#define CAP_TABLET 0x8
#define CAP_TABLET_TOOL 0x10
#define CAP_TABLET_PAD 0x20
#define CAP_GESTURE 0x40
enum capabilities {
CAP_KEYBOARD = 0x1,
CAP_POINTER = 0x2,
CAP_TOUCH = 0x4,
CAP_TABLET = 0x8,
CAP_TABLET_TOOL = 0x10,
CAP_TABLET_PAD = 0x20,
CAP_GESTURE = 0x40,
};
#if HAVE_INPUTPROTO24
#if ABI_XINPUT_VERSION >= SET_ABI_VERSION(24, 4)
@@ -177,6 +179,9 @@ struct xf86libinput {
float matrix[9];
enum libinput_config_scroll_method scroll_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;
#if HAVE_LIBINPUT_CUSTOM_ACCEL
struct accel_points accel_points_fallback;
@@ -190,6 +195,9 @@ struct xf86libinput {
float rotation_angle;
struct bezier_control_point pressurecurve[4];
struct range {
float min, max;
} pressure_range;
struct ratio {
int x, y;
} area;
@@ -254,6 +262,7 @@ btn_linux2xorg(unsigned int b)
/* tablet button range */
case BTN_STYLUS: button = 2; break;
case BTN_STYLUS2: button = 3; break;
case BTN_STYLUS3: button = 8; break;
default:
button = 8 + b - BTN_SIDE;
break;
@@ -452,6 +461,25 @@ xf86libinput_set_pressurecurve(struct xf86libinput *driver_data,
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
xf86libinput_set_area_ratio(struct xf86libinput *driver_data,
const struct ratio *ratio)
@@ -498,8 +526,10 @@ subdevice_has_capabilities(DeviceIntPtr dev, uint32_t capabilities)
}
static int
LibinputSetProperty(DeviceIntPtr dev, Atom atom, XIPropertyValuePtr val,
BOOL checkonly);
LibinputSetProperty(DeviceIntPtr dev, Atom atom,
XIPropertyValuePtr val,
BOOL checkonly);
static void
LibinputInitProperty(DeviceIntPtr dev);
@@ -730,7 +760,7 @@ LibinputApplyConfigLeftHanded(DeviceIntPtr dev,
{
InputInfoPtr pInfo = dev->public.devicePrivate;
if (!subdevice_has_capabilities(dev, CAP_POINTER|CAP_TABLET))
if (!subdevice_has_capabilities(dev, CAP_POINTER|CAP_TABLET|CAP_TABLET_TOOL))
return;
if (libinput_device_config_left_handed_is_available(device) &&
@@ -801,6 +831,9 @@ LibinputApplyConfigClickMethod(DeviceIntPtr dev,
struct libinput_device *device)
{
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))
return;
@@ -821,6 +854,24 @@ LibinputApplyConfigClickMethod(DeviceIntPtr dev,
"Failed to set click method to %s\n",
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
@@ -876,6 +927,27 @@ LibinputApplyConfigRotation(DeviceIntPtr dev,
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
LibinputApplyConfig(DeviceIntPtr dev)
{
@@ -894,6 +966,7 @@ LibinputApplyConfig(DeviceIntPtr dev)
LibinputApplyConfigMiddleEmulation(dev, driver_data, device);
LibinputApplyConfigDisableWhileTyping(dev, driver_data, device);
LibinputApplyConfigRotation(dev, driver_data, device);
LibinputApplyConfigPressureRange(dev, driver_data, device);
}
static int
@@ -1095,35 +1168,41 @@ xf86libinput_init_pointer_absolute(InputInfoPtr pInfo)
return Success;
}
static void
xf86libinput_kbd_ctrl(DeviceIntPtr device, KeybdCtrl *ctrl)
{
#define CAPSFLAG 1
#define NUMFLAG 2
#define SCROLLFLAG 4
#define CAPSFLAG 1
#define NUMFLAG 2
#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[] = {
{ CAPSFLAG, LIBINPUT_LED_CAPS_LOCK },
{ 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)
return;
if (!device->enabled)
return;
while (bits[i].xbit) {
if (ctrl->leds & bits[i].xbit)
leds |= bits[i].code;
i++;
}
while (bits[i].xbit) {
if (ctrl->leds & bits[i].xbit)
leds |= bits[i].code;
i++;
}
libinput_device_led_update(ldevice, leds);
libinput_device_led_update(ldevice, leds);
}
static void
@@ -1317,7 +1396,10 @@ xf86libinput_init_tablet(InputInfoPtr pInfo)
int nbuttons = TABLET_NUM_BUTTONS;
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;
@@ -1435,7 +1517,10 @@ xf86libinput_init(DeviceIntPtr dev)
struct xf86libinput_device *shared_device = driver_data->shared_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;
@@ -1497,12 +1582,13 @@ swap_registered_device(InputInfoPtr pInfo)
return;
next = xf86FirstLocalDevice();
while (next == pInfo || !is_libinput_device(next))
while (next && (next == pInfo || !is_libinput_device(next)))
next = next->next;
input_lock();
xf86RemoveEnabledDevice(pInfo);
xf86AddEnabledDevice(next);
if (next)
xf86AddEnabledDevice(next);
driver_context.registered_InputInfoPtr = next;
input_unlock();
}
@@ -1645,6 +1731,14 @@ xf86libinput_handle_key(InputInfoPtr pInfo, struct libinput_event_keyboard *even
if ((driver_data->capabilities & CAP_KEYBOARD) == 0)
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;
is_press = (libinput_event_keyboard_get_key_state(event) == LIBINPUT_KEY_STATE_PRESSED);
@@ -2406,7 +2500,10 @@ xf86libinput_handle_tablet_proximity(InputInfoPtr pInfo,
if (xf86libinput_tool_queue_event(event))
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);
y = libinput_event_tablet_tool_get_y_transformed(event, TABLET_AXIS_MAX);
@@ -2650,7 +2747,7 @@ xf86libinput_read_input(InputInfoPtr pInfo)
int rc;
struct libinput_event *event;
rc = libinput_dispatch(libinput);
rc = libinput_dispatch(libinput);
if (rc == -EAGAIN)
return;
@@ -2878,6 +2975,46 @@ xf86libinput_parse_tap_buttonmap_option(InputInfoPtr pInfo,
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
xf86libinput_parse_accel_option(InputInfoPtr pInfo,
struct libinput_device *device)
@@ -3526,6 +3663,46 @@ out:
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
want_area_handling(struct xf86libinput *driver_data)
{
@@ -3598,6 +3775,9 @@ xf86libinput_parse_options(InputInfoPtr pInfo,
options->scroll_buttonlock = xf86libinput_parse_scrollbuttonlock_option(pInfo, device);
options->scroll_pixel_distance = xf86libinput_parse_scroll_pixel_distance_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->disable_while_typing = xf86libinput_parse_disablewhiletyping_option(pInfo, device);
options->rotation_angle = xf86libinput_parse_rotation_angle_option(pInfo, device);
@@ -3616,6 +3796,7 @@ xf86libinput_parse_options(InputInfoPtr pInfo,
xf86libinput_parse_pressurecurve_option(pInfo,
driver_data,
options->pressurecurve);
xf86libinput_parse_pressure_range_option(pInfo, driver_data, &options->pressure_range);
xf86libinput_parse_tablet_area_option(pInfo,
driver_data,
&options->area);
@@ -3673,6 +3854,10 @@ xf86libinput_init_driver_context(void)
/* we want all msgs, let the server filter */
libinput_log_set_priority(driver_context.libinput,
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 {
libinput_ref(driver_context.libinput);
}
@@ -4079,6 +4264,8 @@ static Atom prop_scroll_pixel_distance_default;
static Atom prop_click_methods_available;
static Atom prop_click_method_enabled;
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_default;
static Atom prop_disable_while_typing;
@@ -4090,12 +4277,16 @@ static Atom prop_mode_groups_rings;
static Atom prop_mode_groups_strips;
static Atom prop_rotation_angle;
static Atom prop_rotation_angle_default;
static Atom prop_pressure_range;
static Atom prop_pressure_range_default;
/* driver properties */
static Atom prop_draglock;
static Atom prop_horiz_scroll;
static Atom prop_pressurecurve;
static Atom prop_area_ratio;
static Atom prop_serial;
static Atom prop_tool_id;
static Atom prop_hires_scroll;
/* general properties */
@@ -4206,7 +4397,8 @@ xf86libinput_check_device(DeviceIntPtr dev,
struct libinput_device *device = driver_data->shared_device->device;
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,
"SetProperty on %u called but device is disabled.\n"
"This driver cannot change properties on a disabled device\n",
@@ -4219,9 +4411,9 @@ xf86libinput_check_device(DeviceIntPtr dev,
static inline int
LibinputSetPropertyTap(DeviceIntPtr dev,
Atom atom,
XIPropertyValuePtr val,
BOOL checkonly)
Atom atom,
XIPropertyValuePtr val,
BOOL checkonly)
{
InputInfoPtr pInfo = dev->public.devicePrivate;
struct xf86libinput *driver_data = pInfo->private;
@@ -4349,8 +4541,8 @@ LibinputSetPropertyTapButtonmap(DeviceIntPtr dev,
static inline int
LibinputSetPropertyCalibration(DeviceIntPtr dev,
Atom atom,
XIPropertyValuePtr val,
Atom atom,
XIPropertyValuePtr val,
BOOL checkonly)
{
InputInfoPtr pInfo = dev->public.devicePrivate;
@@ -4500,6 +4692,8 @@ LibinputSetPropertyAccelPoints(DeviceIntPtr dev,
accel_points = &driver_data->options.accel_points_motion;
else if (atom == prop_accel_points_scroll)
accel_points = &driver_data->options.accel_points_scroll;
else
return BadValue;
for (size_t idx = 0; idx < val->size; idx++)
accel_points->points[idx] = data[idx];
@@ -4552,9 +4746,9 @@ LibinputSetPropertyAccelStep(DeviceIntPtr dev,
static inline int
LibinputSetPropertyNaturalScroll(DeviceIntPtr dev,
Atom atom,
XIPropertyValuePtr val,
BOOL checkonly)
Atom atom,
XIPropertyValuePtr val,
BOOL checkonly)
{
InputInfoPtr pInfo = dev->public.devicePrivate;
struct xf86libinput *driver_data = pInfo->private;
@@ -4820,6 +5014,46 @@ LibinputSetPropertyClickMethod(DeviceIntPtr dev,
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
LibinputSetPropertyMiddleEmulation(DeviceIntPtr dev,
Atom atom,
@@ -4912,6 +5146,7 @@ prop_draglock_set_pairs(struct xf86libinput *driver_data,
int data[MAX_BUTTONS + 1] = {0};
int i;
int highest = 0;
const unsigned int max = MAX_BUTTONS;
if (len >= ARRAY_SIZE(data))
return BadMatch;
@@ -4922,7 +5157,7 @@ prop_draglock_set_pairs(struct xf86libinput *driver_data,
dl = (checkonly) ? &dummy : &driver_data->draglock;
for (i = 0; i < len; i += 2) {
if (pairs[i] > MAX_BUTTONS)
if (pairs[i] > max)
return BadValue;
data[pairs[i]] = pairs[i+1];
@@ -5094,6 +5329,42 @@ LibinputSetPropertyPressureCurve(DeviceIntPtr dev,
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
LibinputSetPropertyAreaRatio(DeviceIntPtr dev,
Atom atom,
@@ -5178,8 +5449,9 @@ LibinputSetPropertyHighResolutionScroll(DeviceIntPtr dev,
}
static int
LibinputSetProperty(DeviceIntPtr dev, Atom atom, XIPropertyValuePtr val,
BOOL checkonly)
LibinputSetProperty(DeviceIntPtr dev, Atom atom,
XIPropertyValuePtr val,
BOOL checkonly)
{
int rc;
@@ -5222,6 +5494,8 @@ LibinputSetProperty(DeviceIntPtr dev, Atom atom, XIPropertyValuePtr val,
rc = LibinputSetPropertyScrollButtonLock(dev, atom, val, checkonly);
else if (atom == prop_click_method_enabled)
rc = LibinputSetPropertyClickMethod(dev, atom, val, checkonly);
else if (atom == prop_clickfinger_buttonmap)
rc = LibinputSetPropertyClickfingerButtonmap(dev, atom, val, checkonly);
else if (atom == prop_middle_emulation)
rc = LibinputSetPropertyMiddleEmulation(dev, atom, val, checkonly);
else if (atom == prop_disable_while_typing)
@@ -5245,36 +5519,43 @@ LibinputSetProperty(DeviceIntPtr dev, Atom atom, XIPropertyValuePtr val,
rc = LibinputSetPropertyRotationAngle(dev, atom, val, checkonly);
else if (atom == prop_pressurecurve)
rc = LibinputSetPropertyPressureCurve(dev, atom, val, checkonly);
else if (atom == prop_pressure_range)
rc = LibinputSetPropertyPressureRange(dev, atom, val, checkonly);
else if (atom == prop_area_ratio)
rc = LibinputSetPropertyAreaRatio(dev, atom, val, checkonly);
else if (atom == prop_hires_scroll)
rc = LibinputSetPropertyHighResolutionScroll(dev, atom, val, checkonly);
else if (atom == prop_device || atom == prop_product_id ||
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 ||
else if (atom == prop_accel_default ||
atom == prop_accel_profile_default ||
atom == prop_natural_scroll_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_calibration_default ||
atom == prop_click_method_default ||
atom == prop_click_methods_available ||
atom == prop_middle_emulation_default ||
atom == prop_clickfinger_buttonmap_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_buttons ||
atom == prop_mode_groups_rings ||
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 */
else
return Success;
@@ -5726,7 +6007,7 @@ LibinputInitLeftHandedProperty(DeviceIntPtr dev,
{
BOOL left_handed = driver_data->options.left_handed;
if (!subdevice_has_capabilities(dev, CAP_POINTER|CAP_TABLET))
if (!subdevice_has_capabilities(dev, CAP_POINTER|CAP_TABLET|CAP_TABLET_TOOL))
return;
if (!libinput_device_config_left_handed_is_available(device) ||
@@ -5951,6 +6232,63 @@ LibinputInitClickMethodsProperty(DeviceIntPtr dev,
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
LibinputInitMiddleEmulationProperty(DeviceIntPtr dev,
struct xf86libinput *driver_data,
@@ -6244,6 +6582,44 @@ LibinputInitPressureCurveProperty(DeviceIntPtr dev,
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
LibinputInitTabletAreaRatioProperty(DeviceIntPtr dev,
struct xf86libinput *driver_data)
@@ -6263,6 +6639,36 @@ LibinputInitTabletAreaRatioProperty(DeviceIntPtr dev,
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
LibinputInitHighResolutionScrollProperty(DeviceIntPtr dev,
struct xf86libinput *driver_data,
@@ -6299,6 +6705,7 @@ LibinputInitProperty(DeviceIntPtr dev)
LibinputInitDisableWhileTypingProperty(dev, driver_data, device);
LibinputInitScrollMethodsProperty(dev, driver_data, device);
LibinputInitClickMethodsProperty(dev, driver_data, device);
LibinputInitClickfingerButtonmapProperty(dev, driver_data, device);
LibinputInitMiddleEmulationProperty(dev, driver_data, device);
LibinputInitRotationAngleProperty(dev, driver_data, device);
LibinputInitAccelProperty(dev, driver_data, device);
@@ -6337,6 +6744,8 @@ LibinputInitProperty(DeviceIntPtr dev)
LibinputInitHorizScrollProperty(dev, driver_data);
LibinputInitScrollPixelDistanceProperty(dev, driver_data, device);
LibinputInitPressureCurveProperty(dev, driver_data);
LibinputInitPressureRangeProperty(dev, driver_data);
LibinputInitTabletAreaRatioProperty(dev, driver_data);
LibinputInitTabletSerialProperty(dev, driver_data);
LibinputInitHighResolutionScrollProperty(dev, driver_data, device);
}

View File

@@ -233,6 +233,7 @@ test_filter_meta_passthrough(void)
int i;
rc = draglock_init_from_string(&dl, "10");
assert(rc == 0);
for (i = 0; i < 10; i++) {
button = i;
@@ -259,6 +260,7 @@ test_filter_meta_click_meta_only(void)
int button, press;
rc = draglock_init_from_string(&dl, "10");
assert(rc == 0);
button = 10;
press = 1;
@@ -283,6 +285,7 @@ test_filter_meta(void)
int i;
rc = draglock_init_from_string(&dl, "10");
assert(rc == 0);
for (i = 1; i < 10; i++) {
/* meta down */
@@ -339,6 +342,7 @@ test_filter_meta_extra_click(void)
int i;
rc = draglock_init_from_string(&dl, "10");
assert(rc == 0);
for (i = 1; i < 10; i++) {
/* meta down */
@@ -409,6 +413,7 @@ test_filter_meta_interleaved(void)
int i;
rc = draglock_init_from_string(&dl, "10");
assert(rc == 0);
for (i = 1; i < 10; i++) {
/* meta down */
@@ -467,6 +472,7 @@ test_filter_pairs(void)
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");
assert(rc == 0);
for (i = 1; i < 10; i++) {
button = i;