mirror of
https://github.com/X11Libre/xf86-input-libinput.git
synced 2026-04-14 10:54:17 +00:00
Compare commits
98 Commits
xf86-input
...
tracking/x
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ac862672e4 | ||
|
|
c169537717 | ||
|
|
79b62f322a | ||
|
|
6612ab7e97 | ||
|
|
709d0b0a9a | ||
|
|
9c64c0236c | ||
|
|
c674db53d9 | ||
|
|
8a63e97e0c | ||
|
|
c712930ef4 | ||
|
|
db7cfbe5c2 | ||
|
|
cb80d7f82d | ||
|
|
7c5635cd6f | ||
|
|
b396ba3697 | ||
|
|
0bcb60e744 | ||
|
|
3a33984cce | ||
|
|
bb41cc730c | ||
|
|
72c8eb25f8 | ||
|
|
74335c6fd6 | ||
|
|
b791b30b1f | ||
|
|
a7d2994256 | ||
|
|
c6b4d2732f | ||
|
|
6ed6814489 | ||
|
|
a24f467576 | ||
|
|
b254d491e2 | ||
|
|
0dc42f0e4e | ||
|
|
46af622e9d | ||
|
|
5e20d16dd4 | ||
|
|
310db4206f | ||
|
|
94a52a8488 | ||
|
|
a4dfadee2f | ||
|
|
141aa867a6 | ||
|
|
57b049d376 | ||
|
|
8cf533df3a | ||
|
|
484b6a7f3f | ||
|
|
e87c7bfcc2 | ||
|
|
f94a8edb0e | ||
|
|
ca02afd8d2 | ||
|
|
252bc4ba0d | ||
|
|
925903018f | ||
|
|
dfc5e20426 | ||
|
|
2ee183a6cd | ||
|
|
efa999e377 | ||
|
|
7b4a870b23 | ||
|
|
30500626fe | ||
|
|
62f267a952 | ||
|
|
c1f07edafa | ||
|
|
a3d38b0f40 | ||
|
|
e3a75f34f8 | ||
|
|
830f7c3b1b | ||
|
|
4ab7873366 | ||
|
|
b3e65904db | ||
|
|
75cc87518b | ||
|
|
3951ce739d | ||
|
|
cbdd9efaab | ||
|
|
4c54f4d0d2 | ||
|
|
8331214771 | ||
|
|
8588a19f63 | ||
|
|
beb94333e1 | ||
|
|
ca9042c7f0 | ||
|
|
bf8dc2e2ed | ||
|
|
ecd845c307 | ||
|
|
0d9184cb76 | ||
|
|
9bb9e635df | ||
|
|
cc10918bdc | ||
|
|
69888cef81 | ||
|
|
6c1c53d296 | ||
|
|
34f14fdf12 | ||
|
|
92047e5d99 | ||
|
|
b8d3c29f59 | ||
|
|
2bbc4727a1 | ||
|
|
39be944991 | ||
|
|
bd2aaa246d | ||
|
|
99773d7bda | ||
|
|
3afb6244e3 | ||
|
|
f279108ffd | ||
|
|
583ed5acdc | ||
|
|
e8e5d1a6b5 | ||
|
|
639b21d78a | ||
|
|
e52daf203b | ||
|
|
400bf493d1 | ||
|
|
27a88897be | ||
|
|
d5867e5db6 | ||
|
|
1ef2ed874e | ||
|
|
3c9052d886 | ||
|
|
39b0bb4585 | ||
|
|
8923d18d25 | ||
|
|
055481187d | ||
|
|
5a925eaa84 | ||
|
|
e7eafa199e | ||
|
|
d13ab268bd | ||
|
|
347c78387e | ||
|
|
b63f7994dc | ||
|
|
04f42d6e0f | ||
|
|
5d341d1d6c | ||
|
|
4985de5ef3 | ||
|
|
e26fc3c66c | ||
|
|
a759610292 | ||
|
|
21ff2ca7d1 |
17
.editorconfig
Normal file
17
.editorconfig
Normal 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
|
||||||
5
.gitignore
vendored
5
.gitignore
vendored
@@ -71,11 +71,11 @@ core
|
|||||||
*.tar.bz2
|
*.tar.bz2
|
||||||
*.tar.gz
|
*.tar.gz
|
||||||
#
|
#
|
||||||
# Add & Override patterns for xf86-input-libinput
|
# Add & Override patterns for xf86-input-libinput
|
||||||
#
|
#
|
||||||
# Edit the following section as needed
|
# Edit the following section as needed
|
||||||
# For example, !report.pc overrides *.pc. See 'man gitignore'
|
# For example, !report.pc overrides *.pc. See 'man gitignore'
|
||||||
#
|
#
|
||||||
*.log
|
*.log
|
||||||
*.trs
|
*.trs
|
||||||
*.swp
|
*.swp
|
||||||
@@ -84,3 +84,4 @@ core
|
|||||||
test-driver
|
test-driver
|
||||||
tags
|
tags
|
||||||
.vimdir
|
.vimdir
|
||||||
|
test/test-bezier
|
||||||
|
|||||||
83
.gitlab-ci.yml
Normal file
83
.gitlab-ci.yml
Normal file
@@ -0,0 +1,83 @@
|
|||||||
|
# vim: set expandtab shiftwidth=2 tabstop=8 textwidth=0 filetype=yaml:
|
||||||
|
#
|
||||||
|
# This CI uses the freedesktop.org ci-templates.
|
||||||
|
# Please see the ci-templates documentation for details:
|
||||||
|
# https://freedesktop.pages.freedesktop.org/ci-templates/
|
||||||
|
|
||||||
|
.templates_sha: &template_sha fb9d50ccb3cbbb4c6dc5f9ef53a0ad3cb0d8a177
|
||||||
|
|
||||||
|
include:
|
||||||
|
- project: 'freedesktop/ci-templates'
|
||||||
|
ref: *template_sha
|
||||||
|
file: '/templates/fedora.yml'
|
||||||
|
- project: 'freedesktop/ci-templates'
|
||||||
|
ref: *template_sha
|
||||||
|
file: '/templates/ci-fairy.yml'
|
||||||
|
- template: Security/SAST.gitlab-ci.yml
|
||||||
|
|
||||||
|
variables:
|
||||||
|
FDO_UPSTREAM_REPO: xorg/driver/xf86-input-libinput
|
||||||
|
|
||||||
|
|
||||||
|
stages:
|
||||||
|
- containers
|
||||||
|
- build
|
||||||
|
- test
|
||||||
|
|
||||||
|
.fedora:
|
||||||
|
variables:
|
||||||
|
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: '2025-10-24.0'
|
||||||
|
|
||||||
|
|
||||||
|
fedora@container_build:
|
||||||
|
extends:
|
||||||
|
- .fedora
|
||||||
|
- .fdo.container-build@fedora
|
||||||
|
stage: containers
|
||||||
|
variables:
|
||||||
|
GIT_STRATEGY: none
|
||||||
|
|
||||||
|
|
||||||
|
.default_build:
|
||||||
|
stage: build
|
||||||
|
script:
|
||||||
|
- mkdir _builddir _inst
|
||||||
|
- pushd _builddir > /dev/null
|
||||||
|
- ../autogen.sh --prefix=$(realpath ../_inst) --disable-silent-rules
|
||||||
|
- make && make check
|
||||||
|
- make install
|
||||||
|
- popd > /dev/null
|
||||||
|
artifacts:
|
||||||
|
name: "automake-logs-$CI_JOB_NAME"
|
||||||
|
when: always
|
||||||
|
expire_in: 1 week
|
||||||
|
paths:
|
||||||
|
- _builddir/config.log
|
||||||
|
|
||||||
|
|
||||||
|
fedora@default-build:
|
||||||
|
extends:
|
||||||
|
- .fedora
|
||||||
|
- .fdo.distribution-image@fedora
|
||||||
|
- .default_build
|
||||||
|
|
||||||
|
#
|
||||||
|
# Verify that commit messages are as expected
|
||||||
|
#
|
||||||
|
check-commits:
|
||||||
|
extends:
|
||||||
|
- .fdo.ci-fairy
|
||||||
|
stage: test
|
||||||
|
script:
|
||||||
|
- ci-fairy check-commits --junit-xml=results.xml
|
||||||
|
except:
|
||||||
|
- master@xorg/driver/xf86-input-libinput
|
||||||
|
variables:
|
||||||
|
GIT_DEPTH: 100
|
||||||
|
artifacts:
|
||||||
|
reports:
|
||||||
|
junit: results.xml
|
||||||
|
allow_failure: true
|
||||||
9
.gitlab-ci/fedora-install.sh
Executable file
9
.gitlab-ci/fedora-install.sh
Executable file
@@ -0,0 +1,9 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# we require at least inputproto >= 2.3.99.1 which has been released in xorgproto 2021.5
|
||||||
|
git clone https://gitlab.freedesktop.org/xorg/proto/xorgproto.git --depth 1 --branch=xorgproto-2021.5
|
||||||
|
pushd xorgproto
|
||||||
|
./autogen.sh
|
||||||
|
make -j${FDO_CI_CONCURRENT:-4} install
|
||||||
|
popd
|
||||||
|
rm -rf xorgproto
|
||||||
36
COPYING
36
COPYING
@@ -1,20 +1,20 @@
|
|||||||
Copyright © 2014 Red Hat, Inc.
|
SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
Permission to use, copy, modify, distribute, and sell this software
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
and its documentation for any purpose is hereby granted without
|
of this software and associated documentation files (the "Software"), to
|
||||||
fee, provided that the above copyright notice appear in all copies
|
deal in the Software without restriction, including without limitation the
|
||||||
and that both that copyright notice and this permission notice
|
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||||
appear in supporting documentation, and that the name of the authors
|
sell copies of the Software, and to permit persons to whom the Software is
|
||||||
not be used in advertising or publicity pertaining to distribution of the
|
furnished to do so, subject to the following conditions:
|
||||||
software without specific, written prior permission. The authors make no
|
|
||||||
representations about the suitability of this software for any
|
|
||||||
purpose. It is provided "as is" without express or implied
|
|
||||||
warranty.
|
|
||||||
|
|
||||||
THE AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
The above copyright notice and this permission notice (including the next
|
||||||
INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
|
paragraph) shall be included in all copies or substantial portions of the
|
||||||
NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
Software.
|
||||||
CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
|
|
||||||
OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||||
|
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||||
|
IN THE SOFTWARE.
|
||||||
|
|||||||
14
README.md
14
README.md
@@ -2,7 +2,7 @@ xf86-input-libinput - a libinput-based X driver
|
|||||||
===============================================
|
===============================================
|
||||||
|
|
||||||
The official repository for this driver is
|
The official repository for this driver is
|
||||||
http://cgit.freedesktop.org/xorg/driver/xf86-input-libinput/
|
https://gitlab.freedesktop.org/xorg/driver/xf86-input-libinput
|
||||||
|
|
||||||
This is an X driver based on libinput. It is a thin wrapper around libinput,
|
This is an X driver based on libinput. It is a thin wrapper around libinput,
|
||||||
so while it does provide all features that libinput supports it does little
|
so while it does provide all features that libinput supports it does little
|
||||||
@@ -20,10 +20,10 @@ xorg-x11-server-devel package or similar) and libinput (check your
|
|||||||
distribution for libinput-devel or similar).
|
distribution for libinput-devel or similar).
|
||||||
|
|
||||||
To get libinput from source, see:
|
To get libinput from source, see:
|
||||||
http://www.freedesktop.org/wiki/Software/libinput/
|
https://www.freedesktop.org/wiki/Software/libinput/
|
||||||
|
|
||||||
To build the X server from source:
|
To build the X server from source:
|
||||||
http://www.x.org/wiki/Building_the_X_Window_System/
|
https://www.x.org/wiki/Building_the_X_Window_System/
|
||||||
|
|
||||||
Building
|
Building
|
||||||
--------
|
--------
|
||||||
@@ -48,8 +48,8 @@ This will assign this driver to *all* devices. Use with caution.
|
|||||||
Bugs
|
Bugs
|
||||||
----
|
----
|
||||||
|
|
||||||
Bugs in libinput go to the "libinput" component of wayland:
|
Bugs in libinput go to the Issues section of the libinput gitlab project:
|
||||||
https://bugs.freedesktop.org/enter_bug.cgi?product=Wayland
|
https://gitlab.freedesktop.org/libinput/libinput/issues
|
||||||
|
|
||||||
Bugs in this driver go to the "Input/libinput" component of xorg:
|
Bugs in this driver go to the Issues section of its gitlab project:
|
||||||
https://bugs.freedesktop.org/enter_bug.cgi?product=xorg
|
https://gitlab.freedesktop.org/xorg/driver/xf86-input-libinput/issues
|
||||||
|
|||||||
@@ -1,4 +1,21 @@
|
|||||||
# Match on all types of devices but joysticks
|
# Match on all types of devices but joysticks
|
||||||
|
#
|
||||||
|
# If you want to configure your devices, do not copy this file.
|
||||||
|
# Instead, use a config snippet that contains something like this:
|
||||||
|
#
|
||||||
|
# Section "InputClass"
|
||||||
|
# Identifier "something or other"
|
||||||
|
# MatchDriver "libinput"
|
||||||
|
#
|
||||||
|
# MatchIsTouchpad "on"
|
||||||
|
# ... other Match directives ...
|
||||||
|
# Option "someoption" "value"
|
||||||
|
# EndSection
|
||||||
|
#
|
||||||
|
# This applies the option any libinput device also matched by the other
|
||||||
|
# directives. See the xorg.conf(5) man page for more info on
|
||||||
|
# matching devices.
|
||||||
|
|
||||||
Section "InputClass"
|
Section "InputClass"
|
||||||
Identifier "libinput pointer catchall"
|
Identifier "libinput pointer catchall"
|
||||||
MatchIsPointer "on"
|
MatchIsPointer "on"
|
||||||
|
|||||||
85
configure.ac
85
configure.ac
@@ -23,44 +23,105 @@
|
|||||||
# Initialize Autoconf
|
# Initialize Autoconf
|
||||||
AC_PREREQ([2.60])
|
AC_PREREQ([2.60])
|
||||||
AC_INIT([xf86-input-libinput],
|
AC_INIT([xf86-input-libinput],
|
||||||
[0.28.0],
|
[1.5.0],
|
||||||
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
|
[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])
|
||||||
AC_CONFIG_HEADERS([config.h])
|
AC_CONFIG_HEADERS([config.h])
|
||||||
AC_CONFIG_AUX_DIR(.)
|
AC_CONFIG_AUX_DIR(.)
|
||||||
|
|
||||||
# Initialize Automake
|
# Initialize Automake
|
||||||
AM_INIT_AUTOMAKE([foreign dist-bzip2])
|
AM_INIT_AUTOMAKE([foreign dist-xz])
|
||||||
|
|
||||||
# Initialize libtool
|
# Initialize libtool
|
||||||
AC_DISABLE_STATIC
|
AC_DISABLE_STATIC
|
||||||
LT_INIT
|
LT_INIT
|
||||||
|
|
||||||
# Initialize X.Org macros 1.8 or later for MAN_SUBSTS set by XORG_MANPAGE_SECTIONS
|
# Initialize X.Org macros 1.8 or later for MAN_SUBSTS set by XORG_MANPAGE_SECTIONS
|
||||||
m4_ifndef([XORG_MACROS_VERSION],
|
m4_ifndef([XORG_MACROS_VERSION],
|
||||||
[m4_fatal([must install xorg-macros 1.8 or later before running autoconf/autogen])])
|
[m4_fatal([must install xorg-macros 1.8 or later before running autoconf/autogen])])
|
||||||
XORG_MACROS_VERSION(1.8)
|
XORG_MACROS_VERSION(1.8)
|
||||||
XORG_DEFAULT_OPTIONS
|
XORG_DEFAULT_OPTIONS
|
||||||
|
|
||||||
# Obtain compiler/linker options from server and required extensions
|
# Obtain compiler/linker options from server and required extensions
|
||||||
PKG_CHECK_MODULES(XORG, [xorg-server >= 1.10] xproto [inputproto >= 2.2])
|
PKG_CHECK_MODULES(XORG, [xorg-server >= 1.19] xproto [inputproto >= 2.2])
|
||||||
PKG_CHECK_MODULES(LIBINPUT, [libinput >= 1.4.901])
|
PKG_CHECK_MODULES(LIBINPUT, [libinput >= 1.11.0])
|
||||||
|
|
||||||
|
PKG_CHECK_MODULES(INPUTPROTO24, [inputproto >= 2.3.99.1],
|
||||||
|
[AC_DEFINE(HAVE_INPUTPROTO24, [1], [inputproto 2.4 is available])],
|
||||||
|
[:])
|
||||||
|
|
||||||
OLD_LIBS=$LIBS
|
OLD_LIBS=$LIBS
|
||||||
OLD_CFLAGS=$CFLAGS
|
OLD_CFLAGS=$CFLAGS
|
||||||
LIBS="$LIBS $LIBINPUT_LIBS"
|
LIBS="$LIBS $LIBINPUT_LIBS"
|
||||||
CFLAGS="$CFLAGS $LIBINPUT_CFLAGS"
|
CFLAGS="$CFLAGS $LIBINPUT_CFLAGS"
|
||||||
AC_MSG_CHECKING([if libinput_device_touch_get_touch_count is available])
|
|
||||||
|
AC_MSG_CHECKING([if libinput_device_config_scroll_get_button_lock is available])
|
||||||
AC_LINK_IFELSE(
|
AC_LINK_IFELSE(
|
||||||
[AC_LANG_PROGRAM([[#include <libinput.h>]],
|
[AC_LANG_PROGRAM([[#include <libinput.h>]],
|
||||||
[[libinput_device_touch_get_touch_count(NULL)]])],
|
[[libinput_device_config_scroll_get_button_lock(NULL)]])],
|
||||||
[AC_MSG_RESULT([yes])
|
[AC_MSG_RESULT([yes])
|
||||||
AC_DEFINE(HAVE_LIBINPUT_TOUCH_COUNT, [1],
|
AC_DEFINE(HAVE_LIBINPUT_SCROLL_BUTTON_LOCK, [1],
|
||||||
[libinput_device_touch_get_touch_count() is available])
|
[libinput_device_config_scroll_get_button_lock() is available])
|
||||||
[libinput_have_touch_count=yes]],
|
[libinput_have_scroll_button_lock=yes]],
|
||||||
[AC_MSG_RESULT([no])
|
[AC_MSG_RESULT([no])
|
||||||
[libinput_have_touch_count=no]])
|
[libinput_have_scroll_button_lock=no]])
|
||||||
|
|
||||||
|
AC_MSG_CHECKING([if libinput_event_pointer_get_scroll_value_v120 is available])
|
||||||
|
AC_LINK_IFELSE(
|
||||||
|
[AC_LANG_PROGRAM([[#include <libinput.h>]],
|
||||||
|
[[libinput_event_pointer_get_scroll_value_v120(NULL, 0)]])],
|
||||||
|
[AC_MSG_RESULT([yes])
|
||||||
|
AC_DEFINE(HAVE_LIBINPUT_AXIS_VALUE_V120, [1],
|
||||||
|
[libinput_event_pointer_get_scroll_value_v120() is available])
|
||||||
|
[libinput_have_axis_value_v120=yes]],
|
||||||
|
[AC_MSG_RESULT([no])
|
||||||
|
[libinput_have_axis_value_v120=no]])
|
||||||
|
|
||||||
|
AC_MSG_CHECKING([if libinput_config_accel_create is available])
|
||||||
|
AC_LINK_IFELSE(
|
||||||
|
[AC_LANG_PROGRAM([[#include <libinput.h>]],
|
||||||
|
[[libinput_config_accel_create(0)]])],
|
||||||
|
[AC_MSG_RESULT([yes])
|
||||||
|
AC_DEFINE(HAVE_LIBINPUT_CUSTOM_ACCEL, [1],
|
||||||
|
[libinput_config_accel_create() is available])
|
||||||
|
[libinput_have_custom_accel=yes]],
|
||||||
|
[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
|
LIBS=$OLD_LIBS
|
||||||
CFLAGS=$OLD_CFLAGS
|
CFLAGS=$OLD_CFLAGS
|
||||||
|
|
||||||
|
|||||||
@@ -1,24 +1,26 @@
|
|||||||
/*
|
/*
|
||||||
|
* SPDX-License-Identifier: MIT
|
||||||
|
*
|
||||||
* Copyright © 2015 Red Hat, Inc.
|
* Copyright © 2015 Red Hat, Inc.
|
||||||
*
|
*
|
||||||
* Permission to use, copy, modify, distribute, and sell this software
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* and its documentation for any purpose is hereby granted without
|
* of this software and associated documentation files (the "Software"), to
|
||||||
* fee, provided that the above copyright notice appear in all copies
|
* deal in the Software without restriction, including without limitation the
|
||||||
* and that both that copyright notice and this permission notice
|
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||||
* appear in supporting documentation, and that the name of Red Hat
|
* sell copies of the Software, and to permit persons to whom the Software is
|
||||||
* not be used in advertising or publicity pertaining to distribution
|
* furnished to do so, subject to the following conditions:
|
||||||
* of the software without specific, written prior permission. Red
|
|
||||||
* Hat makes no representations about the suitability of this software
|
|
||||||
* for any purpose. It is provided "as is" without express or implied
|
|
||||||
* warranty.
|
|
||||||
*
|
*
|
||||||
* THE AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
* The above copyright notice and this permission notice (including the next
|
||||||
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
|
* paragraph) shall be included in all copies or substantial portions of the
|
||||||
* NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
* Software.
|
||||||
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
|
*
|
||||||
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||||
|
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||||
|
* IN THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _LIBINPUT_PROPERTIES_H_
|
#ifndef _LIBINPUT_PROPERTIES_H_
|
||||||
@@ -49,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"
|
||||||
|
|
||||||
@@ -61,18 +70,36 @@
|
|||||||
/* Pointer accel speed: FLOAT, 1 value, 32 bit, read-only*/
|
/* Pointer accel speed: FLOAT, 1 value, 32 bit, read-only*/
|
||||||
#define LIBINPUT_PROP_ACCEL_DEFAULT "libinput Accel Speed Default"
|
#define LIBINPUT_PROP_ACCEL_DEFAULT "libinput Accel Speed Default"
|
||||||
|
|
||||||
/* Pointer accel profile: BOOL, 2 values in oder adaptive, flat,
|
/* Pointer accel profile: BOOL, 3 values in order adaptive, flat, custom
|
||||||
* only one is enabled at a time at max, read-only */
|
* only one is enabled at a time at max, read-only */
|
||||||
#define LIBINPUT_PROP_ACCEL_PROFILES_AVAILABLE "libinput Accel Profiles Available"
|
#define LIBINPUT_PROP_ACCEL_PROFILES_AVAILABLE "libinput Accel Profiles Available"
|
||||||
|
|
||||||
/* Pointer accel profile: BOOL, 2 values in order adaptive, flat,
|
/* Pointer accel profile: BOOL, 3 values in order adaptive, flat, custom
|
||||||
only one is enabled at a time at max, read-only */
|
only one is enabled at a time at max, read-only */
|
||||||
#define LIBINPUT_PROP_ACCEL_PROFILE_ENABLED_DEFAULT "libinput Accel Profile Enabled Default"
|
#define LIBINPUT_PROP_ACCEL_PROFILE_ENABLED_DEFAULT "libinput Accel Profile Enabled Default"
|
||||||
|
|
||||||
/* Pointer accel profile: BOOL, 2 values in order adaptive, flat,
|
/* Pointer accel profile: BOOL, 3 values in order adaptive, flat, custom
|
||||||
only one is enabled at a time at max */
|
only one is enabled at a time at max */
|
||||||
#define LIBINPUT_PROP_ACCEL_PROFILE_ENABLED "libinput Accel Profile Enabled"
|
#define LIBINPUT_PROP_ACCEL_PROFILE_ENABLED "libinput Accel Profile Enabled"
|
||||||
|
|
||||||
|
/* Points for the custom accel profile: FLOAT, N values */
|
||||||
|
#define LIBINPUT_PROP_ACCEL_CUSTOM_POINTS_FALLBACK "libinput Accel Custom Fallback Points"
|
||||||
|
|
||||||
|
/* Steps for the custom accel profile: FLOAT, 1 value */
|
||||||
|
#define LIBINPUT_PROP_ACCEL_CUSTOM_STEP_FALLBACK "libinput Accel Custom Fallback Step"
|
||||||
|
|
||||||
|
/* Points for the custom accel profile: FLOAT, N values */
|
||||||
|
#define LIBINPUT_PROP_ACCEL_CUSTOM_POINTS_MOTION "libinput Accel Custom Motion Points"
|
||||||
|
|
||||||
|
/* Steps for the custom accel profile: FLOAT, 1 value */
|
||||||
|
#define LIBINPUT_PROP_ACCEL_CUSTOM_STEP_MOTION "libinput Accel Custom Motion Step"
|
||||||
|
|
||||||
|
/* Points for the custom accel profile: FLOAT, N values */
|
||||||
|
#define LIBINPUT_PROP_ACCEL_CUSTOM_POINTS_SCROLL "libinput Accel Custom Scroll Points"
|
||||||
|
|
||||||
|
/* Steps for the custom accel profile: FLOAT, 1 value */
|
||||||
|
#define LIBINPUT_PROP_ACCEL_CUSTOM_STEP_SCROLL "libinput Accel Custom Scroll Step"
|
||||||
|
|
||||||
/* Natural scrolling: BOOL, 1 value */
|
/* Natural scrolling: BOOL, 1 value */
|
||||||
#define LIBINPUT_PROP_NATURAL_SCROLL "libinput Natural Scrolling Enabled"
|
#define LIBINPUT_PROP_NATURAL_SCROLL "libinput Natural Scrolling Enabled"
|
||||||
|
|
||||||
@@ -115,6 +142,18 @@
|
|||||||
/* Scroll button for button scrolling: 32-bit int, 1 value, read-only */
|
/* Scroll button for button scrolling: 32-bit int, 1 value, read-only */
|
||||||
#define LIBINPUT_PROP_SCROLL_BUTTON_DEFAULT "libinput Button Scrolling Button Default"
|
#define LIBINPUT_PROP_SCROLL_BUTTON_DEFAULT "libinput Button Scrolling Button Default"
|
||||||
|
|
||||||
|
/* Scroll button lock: BOOL, 1 value, TRUE for enabled, FALSE otherwise */
|
||||||
|
#define LIBINPUT_PROP_SCROLL_BUTTON_LOCK "libinput Button Scrolling Button Lock Enabled"
|
||||||
|
|
||||||
|
/* Scroll button lock: BOOL, 1 value, TRUE for enabled, FALSE otherwise, read-only*/
|
||||||
|
#define LIBINPUT_PROP_SCROLL_BUTTON_LOCK_DEFAULT "libinput Button Scrolling Button Lock Enabled Default"
|
||||||
|
|
||||||
|
/* Scroll pixel distance: CARD32, 1 value (with implementation-defined limits) */
|
||||||
|
#define LIBINPUT_PROP_SCROLL_PIXEL_DISTANCE "libinput Scrolling Pixel Distance"
|
||||||
|
|
||||||
|
/* Scroll pixel distance: CARD32, 1 value, read-only */
|
||||||
|
#define LIBINPUT_PROP_SCROLL_PIXEL_DISTANCE_DEFAULT "libinput Scrolling Pixel Distance Default"
|
||||||
|
|
||||||
/* Click method: BOOL read-only, 2 values in order buttonareas, clickfinger
|
/* Click method: BOOL read-only, 2 values in order buttonareas, clickfinger
|
||||||
shows available click methods */
|
shows available click methods */
|
||||||
#define LIBINPUT_PROP_CLICK_METHODS_AVAILABLE "libinput Click Methods Available"
|
#define LIBINPUT_PROP_CLICK_METHODS_AVAILABLE "libinput Click Methods Available"
|
||||||
@@ -190,7 +229,35 @@
|
|||||||
*/
|
*/
|
||||||
#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"
|
||||||
|
|
||||||
|
/* High-resolution wheel scroll events enabled: BOOL, 1 value (0 or 1).
|
||||||
|
* 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_ */
|
#endif /* _LIBINPUT_PROPERTIES_H_ */
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||||
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
# DEALINGS IN THE SOFTWARE.
|
# DEALINGS IN THE SOFTWARE.
|
||||||
#
|
#
|
||||||
|
|
||||||
drivermandir = $(DRIVER_MAN_DIR)
|
drivermandir = $(DRIVER_MAN_DIR)
|
||||||
|
|
||||||
@@ -32,6 +32,9 @@ CLEANFILES = $(driverman_DATA)
|
|||||||
|
|
||||||
SUFFIXES = .$(DRIVER_MAN_SUFFIX) .man
|
SUFFIXES = .$(DRIVER_MAN_SUFFIX) .man
|
||||||
|
|
||||||
|
MAN_SUBSTS += \
|
||||||
|
-e 's|\@VERSION\@|$(PACKAGE_NAME) $(PACKAGE_VERSION)|g'
|
||||||
|
|
||||||
# String replacements in MAN_SUBSTS now come from xorg-macros.m4 via configure
|
# String replacements in MAN_SUBSTS now come from xorg-macros.m4 via configure
|
||||||
.man.$(DRIVER_MAN_SUFFIX):
|
.man.$(DRIVER_MAN_SUFFIX):
|
||||||
$(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@
|
$(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@
|
||||||
|
|||||||
557
man/libinput.man
557
man/libinput.man
@@ -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 __drivermansuffix__ __vendorversion__
|
.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,55 +15,93 @@ 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 __xservername__ 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 __xconfigfile__(__filemansuffix__)) instead of manual
|
directive (refer to
|
||||||
per-device configuration. Devices configured in the
|
.BR xorg.conf (5))
|
||||||
__xconfigfile__(__filemansuffix__) 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 __xconfigfile__(__filemansuffix__) 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 ,
|
||||||
Not all devices support this option or all profiles. If a profile is
|
.BR custom .
|
||||||
unsupported, the default profile for this device is used. For a description
|
Not all devices support this option or all profiles.
|
||||||
on the profiles and their behavior, see the libinput documentation.
|
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
|
.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].
|
||||||
|
This only applies to the flat or adaptive profile.
|
||||||
|
.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.
|
||||||
|
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.
|
||||||
|
See section
|
||||||
|
.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(__libmansuffix__). 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
|
||||||
@@ -73,100 +112,148 @@ 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
|
||||||
|
.BI "Option \*qHighResolutionWheelScrolling\*q \*q" bool \*q
|
||||||
|
Disables high-resolution wheel scroll events, enabled by default. When enabled,
|
||||||
|
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
|
.BI "Option \*qHorizontalScrolling\*q \*q" bool \*q
|
||||||
Disables horizontal scrolling. When disabled, this driver will discard any
|
Enables or disables horizontal scrolling.
|
||||||
horizontal scroll events from libinput. Note that this does not disable
|
When disabled,
|
||||||
horizontal scrolling, it merely discards the horizontal axis from any scroll
|
this driver will discard any horizontal scroll events from libinput.
|
||||||
events.
|
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 held 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
|
||||||
|
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
|
||||||
|
.B ScrollButton
|
||||||
|
button is considered logically down while held down and up once physically
|
||||||
|
released.
|
||||||
|
.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
|
||||||
|
.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
|
||||||
|
.BR twofinger ,
|
||||||
|
.BR edge ,
|
||||||
|
.BR button .
|
||||||
|
See section
|
||||||
|
.B SCROLL PIXEL DISTANCE
|
||||||
|
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
|
||||||
@@ -177,136 +264,189 @@ 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"
|
||||||
2 boolean values (8 bit, 0 or 1), in order "adaptive", "flat".
|
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"
|
||||||
2 boolean values (8 bit, 0 or 1), in order "adaptive", "flat".
|
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.
|
||||||
.TP 7
|
.TP 7
|
||||||
.BI "libinput Button Scrolling Button"
|
.B "libinput Accel Custom Fallback Points"
|
||||||
1 32-bit value. Sets the button number to use for button scrolling. This
|
.TQ
|
||||||
setting is independent of the scroll method, to enable button scrolling the
|
.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.
|
method must be set to button-scrolling and a valid button must be set.
|
||||||
.TP 7
|
.TP 7
|
||||||
.BI "libinput Calibration Matrix"
|
.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
|
||||||
|
.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 Horizontal Scrolling Enabled"
|
.B "libinput High Resolution Wheel 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 high-resolution wheel scroll events are enabled or not.
|
||||||
.TP 7
|
.TP 7
|
||||||
.BI "libinput Left Handed Enabled"
|
.B "libinput Horizontal Scroll 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 whether horizontal scrolling events are enabled or not.
|
||||||
.TP 7
|
.TP 7
|
||||||
.BI "libinput Middle Emulation Enabled"
|
.B "libinput Left Handed 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 left-handed mode is enabled or disabled.
|
||||||
.TP 7
|
.TP 7
|
||||||
.BI "libinput Natural Scrolling Enabled"
|
.B "libinput Middle Emulation Enabled"
|
||||||
1 boolean value (8 bit, 0 or 1). 1 enables natural scrolling
|
1 boolean value (8 bit, 0 or 1).
|
||||||
|
Indicates if middle emulation is enabled or disabled.
|
||||||
.TP 7
|
.TP 7
|
||||||
.BI "libinput Rotation Angle"
|
.B "libinput Natural Scrolling Enabled"
|
||||||
1 32-bit float value [0.0 to 360.0). Sets the rotation angle of the device,
|
1 boolean value (8 bit, 0 or 1).
|
||||||
|
1 enables natural scrolling.
|
||||||
|
.TP 7
|
||||||
|
.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.
|
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 Send Events Modes Available"
|
.B "libinput Scroll Pixel Distance"
|
||||||
2 boolean values (8 bit, 0 or 1), in order "disabled" and
|
1 32-bit value (nonzero, with additional implementation-defined range checks).
|
||||||
"disabled-on-external-mouse". Indicates which send-event modes are available
|
Changes the movement distance required to trigger one logical wheel click.
|
||||||
on this device.
|
|
||||||
.TP 7
|
.TP 7
|
||||||
.BI "libinput Send Events Mode Enabled"
|
.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 is currently
|
"disabled-on-external-mouse".
|
||||||
enabled on this device.
|
Indicates which send-event modes are available on this device.
|
||||||
.TP 7
|
.TP 7
|
||||||
.BI "libinput Tablet Tool Pressurecurve"
|
.B "libinput Send Events Mode Enabled"
|
||||||
4 32-bit float values [0.0 to 1.0]. See section
|
2 boolean values (8 bit, 0 or 1), in order "disabled" and
|
||||||
|
"disabled-on-external-mouse".
|
||||||
|
Indicates which send-event mode is currently enabled on this device.
|
||||||
|
.TP 7
|
||||||
|
.B "libinput Tablet Tool Pressurecurve"
|
||||||
|
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
|
||||||
@@ -317,77 +457,136 @@ button mapping of
|
|||||||
.B "\*q3 2 1 ...\*q"
|
.B "\*q3 2 1 ...\*q"
|
||||||
On systems using the
|
On systems using the
|
||||||
.B libinput
|
.B libinput
|
||||||
__xservername__ input driver it is recommended to use the
|
Xorg input driver it is recommended to use the
|
||||||
.B LeftHanded
|
.B LeftHanded
|
||||||
option instead.
|
option instead.
|
||||||
.PP
|
.PP
|
||||||
The
|
The
|
||||||
.B libinput
|
.B libinput
|
||||||
__xservername__ input driver does not use the button mapping after setup.
|
Xorg input driver does not use the button mapping after setup.
|
||||||
Use XSetPointerMapping(__libmansuffix__) 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
|
||||||
|
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).
|
||||||
|
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
|
||||||
|
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
|
.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 __xconfigfile__(__filemansuffix__).
|
appropriate \fBMatch*\fR statement in the
|
||||||
|
.BR xorg.conf (5).
|
||||||
|
|
||||||
.SH AUTHORS
|
.SH AUTHORS
|
||||||
Peter Hutterer
|
Peter Hutterer
|
||||||
.SH "SEE ALSO"
|
.SH "SEE ALSO"
|
||||||
__xservername__(__appmansuffix__), __xconfigfile__(__filemansuffix__), Xserver(__appmansuffix__), X(__miscmansuffix__)
|
.BR Xorg (1),
|
||||||
|
.BR xorg.conf (5),
|
||||||
|
.BR Xserver (1),
|
||||||
|
.BR X (7)
|
||||||
|
|||||||
158
meson.build
Normal file
158
meson.build
Normal file
@@ -0,0 +1,158 @@
|
|||||||
|
project('xf86-input-libinput', 'c',
|
||||||
|
version: '1.5.0', # bump version in configure.ac
|
||||||
|
default_options: ['warning_level=2'],
|
||||||
|
meson_version: '>= 0.50.0')
|
||||||
|
|
||||||
|
driver_version = meson.project_version().split('.')
|
||||||
|
|
||||||
|
dir_pkgconf = get_option('prefix') / get_option('libdir') / 'pkgconfig'
|
||||||
|
dir_man4 = get_option('prefix') / get_option('mandir') / 'man4'
|
||||||
|
|
||||||
|
cc = meson.get_compiler('c')
|
||||||
|
cflags = [
|
||||||
|
'-Wno-unused-parameter',
|
||||||
|
'-Wno-sign-compare', # lots of work to get rid of this
|
||||||
|
'-Wmissing-prototypes',
|
||||||
|
'-Wstrict-prototypes',
|
||||||
|
'-Wlogical-op',
|
||||||
|
'-Wpointer-arith',
|
||||||
|
'-Wuninitialized',
|
||||||
|
'-Winit-self',
|
||||||
|
'-Wstrict-prototypes',
|
||||||
|
'-Wimplicit-fallthrough',
|
||||||
|
'-Wredundant-decls',
|
||||||
|
'-Wincompatible-pointer-types',
|
||||||
|
'-Wformat=2',
|
||||||
|
'-Wno-missing-field-initializers',
|
||||||
|
'-Wmissing-declarations',
|
||||||
|
|
||||||
|
'-fvisibility=hidden',
|
||||||
|
]
|
||||||
|
add_project_arguments(cc.get_supported_arguments(cflags), language: 'c')
|
||||||
|
|
||||||
|
pkgconfig = import('pkgconfig')
|
||||||
|
dep_xserver = dependency('xorg-server', version: '>= 1.19')
|
||||||
|
dep_xproto = dependency('xproto')
|
||||||
|
dep_inputproto = dependency('inputproto', version: '>= 2.2')
|
||||||
|
dep_libinput = dependency('libinput', version: '>= 1.11.0')
|
||||||
|
|
||||||
|
config_h = configuration_data()
|
||||||
|
config_h.set('PACKAGE_VERSION_MAJOR', driver_version[0])
|
||||||
|
config_h.set('PACKAGE_VERSION_MINOR', driver_version[1])
|
||||||
|
config_h.set('PACKAGE_VERSION_PATCHLEVEL', driver_version[2])
|
||||||
|
|
||||||
|
if dep_inputproto.version().version_compare('>= 2.3.99.1')
|
||||||
|
config_h.set('HAVE_INPUTPROTO24', 1)
|
||||||
|
endif
|
||||||
|
|
||||||
|
if cc.has_function('libinput_device_config_scroll_get_button_lock',
|
||||||
|
dependencies: dep_libinput)
|
||||||
|
config_h.set('HAVE_LIBINPUT_SCROLL_BUTTON_LOCK', 1)
|
||||||
|
endif
|
||||||
|
if cc.has_function('libinput_event_pointer_get_scroll_value_v120',
|
||||||
|
dependencies: dep_libinput)
|
||||||
|
config_h.set('HAVE_LIBINPUT_AXIS_VALUE_V120', 1)
|
||||||
|
endif
|
||||||
|
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 == ''
|
||||||
|
dir_headers = dep_xserver.get_pkgconfig_variable('sdkdir')
|
||||||
|
endif
|
||||||
|
|
||||||
|
dir_xorg_module = get_option('xorg-module-dir')
|
||||||
|
if dir_xorg_module == ''
|
||||||
|
dir_xorg_module = dep_xserver.get_pkgconfig_variable('moduledir') / 'input'
|
||||||
|
endif
|
||||||
|
|
||||||
|
dir_xorg_conf = get_option('xorg-conf-dir')
|
||||||
|
if dir_xorg_conf == ''
|
||||||
|
dir_xorg_conf = dep_xserver.get_pkgconfig_variable('sysconfigdir')
|
||||||
|
endif
|
||||||
|
|
||||||
|
libbezier = static_library('bezier', ['src/bezier.c', 'src/bezier.h'])
|
||||||
|
dep_libbezier = declare_dependency(link_with: libbezier)
|
||||||
|
|
||||||
|
libdraglock = static_library('draglock', ['src/draglock.c', 'src/draglock.h'])
|
||||||
|
dep_libdraglock = declare_dependency(link_with: libdraglock)
|
||||||
|
|
||||||
|
dep_drivers = [
|
||||||
|
dep_xserver,
|
||||||
|
dep_xproto,
|
||||||
|
dep_inputproto,
|
||||||
|
dep_libinput,
|
||||||
|
dep_libbezier,
|
||||||
|
dep_libdraglock,
|
||||||
|
]
|
||||||
|
|
||||||
|
driver_src = ['src/xf86libinput.c', 'src/util-strings.c']
|
||||||
|
driver_lib = shared_module(
|
||||||
|
'libinput_drv',
|
||||||
|
driver_src,
|
||||||
|
name_prefix: '', # we want libinput_drv.so, not liblibinput_drv.so
|
||||||
|
include_directories: include_directories('include'),
|
||||||
|
dependencies: dep_drivers,
|
||||||
|
install: true,
|
||||||
|
install_dir: dir_xorg_module,
|
||||||
|
)
|
||||||
|
|
||||||
|
test_bezier = executable('test-bezier',
|
||||||
|
['test/test-bezier.c'],
|
||||||
|
dependencies: dep_libbezier,
|
||||||
|
include_directories: include_directories('src'),
|
||||||
|
install: false)
|
||||||
|
test('test-bezier', test_bezier)
|
||||||
|
|
||||||
|
test_draglock = executable('test-draglock',
|
||||||
|
['test/test-draglock.c'],
|
||||||
|
dependencies: dep_libdraglock,
|
||||||
|
include_directories: include_directories('src'),
|
||||||
|
install: false)
|
||||||
|
test('test-draglock', test_draglock)
|
||||||
|
|
||||||
|
|
||||||
|
conf_pkgconf = configuration_data()
|
||||||
|
conf_pkgconf.set('PACKAGE_VERSION', meson.project_version())
|
||||||
|
conf_pkgconf.set('sdkdir', dir_headers)
|
||||||
|
|
||||||
|
configure_file(
|
||||||
|
input: 'xorg-libinput.pc.in',
|
||||||
|
output: 'xorg-libinput.pc',
|
||||||
|
configuration: conf_pkgconf,
|
||||||
|
install_dir: dir_pkgconf,
|
||||||
|
)
|
||||||
|
|
||||||
|
config_man = configuration_data()
|
||||||
|
config_man.set('VERSION', '@0@ @1@'.format(meson.project_name(), meson.project_version()))
|
||||||
|
|
||||||
|
configure_file(
|
||||||
|
input: 'man/libinput.man',
|
||||||
|
output: 'libinput.4',
|
||||||
|
configuration: config_man,
|
||||||
|
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
|
||||||
|
configure_file(output: 'config.h', configuration: config_h)
|
||||||
15
meson_options.txt
Normal file
15
meson_options.txt
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
option('sdkdir',
|
||||||
|
type: 'string',
|
||||||
|
value: '',
|
||||||
|
description: 'Directory to install header files in [default=from xorg-server pkgconf]',
|
||||||
|
)
|
||||||
|
option('xorg-module-dir',
|
||||||
|
type : 'string',
|
||||||
|
value : '',
|
||||||
|
description : 'Default xorg module directory [default=from xorg-server pkgconf]',
|
||||||
|
)
|
||||||
|
option('xorg-conf-dir',
|
||||||
|
type : 'string',
|
||||||
|
value : '',
|
||||||
|
description : 'Default xorg.conf.d directory [default=from xorg-server pkgconfig]'
|
||||||
|
)
|
||||||
@@ -33,7 +33,12 @@ AM_CPPFLAGS =-I$(top_srcdir)/include $(LIBINPUT_CFLAGS)
|
|||||||
@DRIVER_NAME@_drv_la_LIBADD = $(LIBINPUT_LIBS) libdraglock.la libbezier.la -lm
|
@DRIVER_NAME@_drv_la_LIBADD = $(LIBINPUT_LIBS) libdraglock.la libbezier.la -lm
|
||||||
@DRIVER_NAME@_drv_ladir = @inputdir@
|
@DRIVER_NAME@_drv_ladir = @inputdir@
|
||||||
|
|
||||||
@DRIVER_NAME@_drv_la_SOURCES = xf86libinput.c
|
@DRIVER_NAME@_drv_la_SOURCES = \
|
||||||
|
xf86libinput.c \
|
||||||
|
util-macros.h \
|
||||||
|
util-strings.h \
|
||||||
|
util-strings.c \
|
||||||
|
$(NULL)
|
||||||
|
|
||||||
noinst_LTLIBRARIES = libdraglock.la libbezier.la
|
noinst_LTLIBRARIES = libdraglock.la libbezier.la
|
||||||
libdraglock_la_SOURCES = draglock.c draglock.h
|
libdraglock_la_SOURCES = draglock.c draglock.h
|
||||||
|
|||||||
36
src/bezier.c
36
src/bezier.c
@@ -1,24 +1,26 @@
|
|||||||
/*
|
/*
|
||||||
|
* SPDX-License-Identifier: MIT
|
||||||
|
*
|
||||||
* Copyright © 2016 Red Hat, Inc.
|
* Copyright © 2016 Red Hat, Inc.
|
||||||
*
|
*
|
||||||
* Permission to use, copy, modify, distribute, and sell this software
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* and its documentation for any purpose is hereby granted without
|
* of this software and associated documentation files (the "Software"), to
|
||||||
* fee, provided that the above copyright notice appear in all copies
|
* deal in the Software without restriction, including without limitation the
|
||||||
* and that both that copyright notice and this permission notice
|
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||||
* appear in supporting documentation, and that the name of Red Hat
|
* sell copies of the Software, and to permit persons to whom the Software is
|
||||||
* not be used in advertising or publicity pertaining to distribution
|
* furnished to do so, subject to the following conditions:
|
||||||
* of the software without specific, written prior permission. Red
|
|
||||||
* Hat makes no representations about the suitability of this software
|
|
||||||
* for any purpose. It is provided "as is" without express or implied
|
|
||||||
* warranty.
|
|
||||||
*
|
*
|
||||||
* THE AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
* The above copyright notice and this permission notice (including the next
|
||||||
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
|
* paragraph) shall be included in all copies or substantial portions of the
|
||||||
* NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
* Software.
|
||||||
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
|
*
|
||||||
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||||
|
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||||
|
* IN THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
|
|||||||
38
src/bezier.h
38
src/bezier.h
@@ -1,24 +1,26 @@
|
|||||||
/*
|
/*
|
||||||
|
* SPDX-License-Identifier: MIT
|
||||||
|
*
|
||||||
* Copyright © 2016 Red Hat, Inc.
|
* Copyright © 2016 Red Hat, Inc.
|
||||||
*
|
*
|
||||||
* Permission to use, copy, modify, distribute, and sell this software
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* and its documentation for any purpose is hereby granted without
|
* of this software and associated documentation files (the "Software"), to
|
||||||
* fee, provided that the above copyright notice appear in all copies
|
* deal in the Software without restriction, including without limitation the
|
||||||
* and that both that copyright notice and this permission notice
|
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||||
* appear in supporting documentation, and that the name of Red Hat
|
* sell copies of the Software, and to permit persons to whom the Software is
|
||||||
* not be used in advertising or publicity pertaining to distribution
|
* furnished to do so, subject to the following conditions:
|
||||||
* of the software without specific, written prior permission. Red
|
|
||||||
* Hat makes no representations about the suitability of this software
|
|
||||||
* for any purpose. It is provided "as is" without express or implied
|
|
||||||
* warranty.
|
|
||||||
*
|
*
|
||||||
* THE AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
* The above copyright notice and this permission notice (including the next
|
||||||
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
|
* paragraph) shall be included in all copies or substantial portions of the
|
||||||
* NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
* Software.
|
||||||
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
|
*
|
||||||
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||||
|
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||||
|
* IN THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
@@ -54,7 +56,7 @@ extern const struct bezier_control_point bezier_defaults[4];
|
|||||||
* This function requires that c[i].x <= c[i+1].x
|
* This function requires that c[i].x <= c[i+1].x
|
||||||
*
|
*
|
||||||
* The curve is mapped into a canvas size [0, bezier_sz)². For each x
|
* The curve is mapped into a canvas size [0, bezier_sz)². For each x
|
||||||
* coordiante in [0, bezier_sz), the matching y coordinate is thus
|
* coordinate in [0, bezier_sz), the matching y coordinate is thus
|
||||||
* bezier[x].
|
* bezier[x].
|
||||||
*
|
*
|
||||||
* In other words, if you have a range [0,2048) input possible values,
|
* In other words, if you have a range [0,2048) input possible values,
|
||||||
|
|||||||
@@ -1,24 +1,26 @@
|
|||||||
/*
|
/*
|
||||||
|
* SPDX-License-Identifier: MIT
|
||||||
|
*
|
||||||
* Copyright © 2015 Red Hat, Inc.
|
* Copyright © 2015 Red Hat, Inc.
|
||||||
*
|
*
|
||||||
* Permission to use, copy, modify, distribute, and sell this software
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* and its documentation for any purpose is hereby granted without
|
* of this software and associated documentation files (the "Software"), to
|
||||||
* fee, provided that the above copyright notice appear in all copies
|
* deal in the Software without restriction, including without limitation the
|
||||||
* and that both that copyright notice and this permission notice
|
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||||
* appear in supporting documentation, and that the name of Red Hat
|
* sell copies of the Software, and to permit persons to whom the Software is
|
||||||
* not be used in advertising or publicity pertaining to distribution
|
* furnished to do so, subject to the following conditions:
|
||||||
* of the software without specific, written prior permission. Red
|
|
||||||
* Hat makes no representations about the suitability of this software
|
|
||||||
* for any purpose. It is provided "as is" without express or implied
|
|
||||||
* warranty.
|
|
||||||
*
|
*
|
||||||
* THE AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
* The above copyright notice and this permission notice (including the next
|
||||||
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
|
* paragraph) shall be included in all copies or substantial portions of the
|
||||||
* NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
* Software.
|
||||||
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
|
*
|
||||||
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||||
|
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||||
|
* IN THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
|
|||||||
@@ -1,24 +1,26 @@
|
|||||||
/*
|
/*
|
||||||
|
* SPDX-License-Identifier: MIT
|
||||||
|
*
|
||||||
* Copyright © 2015 Red Hat, Inc.
|
* Copyright © 2015 Red Hat, Inc.
|
||||||
*
|
*
|
||||||
* Permission to use, copy, modify, distribute, and sell this software
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* and its documentation for any purpose is hereby granted without
|
* of this software and associated documentation files (the "Software"), to
|
||||||
* fee, provided that the above copyright notice appear in all copies
|
* deal in the Software without restriction, including without limitation the
|
||||||
* and that both that copyright notice and this permission notice
|
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||||
* appear in supporting documentation, and that the name of Red Hat
|
* sell copies of the Software, and to permit persons to whom the Software is
|
||||||
* not be used in advertising or publicity pertaining to distribution
|
* furnished to do so, subject to the following conditions:
|
||||||
* of the software without specific, written prior permission. Red
|
|
||||||
* Hat makes no representations about the suitability of this software
|
|
||||||
* for any purpose. It is provided "as is" without express or implied
|
|
||||||
* warranty.
|
|
||||||
*
|
*
|
||||||
* THE AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
* The above copyright notice and this permission notice (including the next
|
||||||
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
|
* paragraph) shall be included in all copies or substantial portions of the
|
||||||
* NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
* Software.
|
||||||
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
|
*
|
||||||
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||||
|
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||||
|
* IN THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
|
|||||||
65
src/util-macros.h
Normal file
65
src/util-macros.h
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
/*
|
||||||
|
* Copyright © 2008-2011 Kristian Høgsberg
|
||||||
|
* Copyright © 2011 Intel Corporation
|
||||||
|
* Copyright © 2013-2015 Red Hat, Inc.
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
|
* copy of this software and associated documentation files (the "Software"),
|
||||||
|
* to deal in the Software without restriction, including without limitation
|
||||||
|
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||||
|
* and/or sell copies of the Software, and to permit persons to whom the
|
||||||
|
* Software is furnished to do so, subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice (including the next
|
||||||
|
* paragraph) shall be included in all copies or substantial portions of the
|
||||||
|
* Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||||
|
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||||
|
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
|
* DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
|
#define ARRAY_LENGTH(a) (sizeof (a) / sizeof (a)[0])
|
||||||
|
/**
|
||||||
|
* Iterate through the array _arr, assigning the variable elem to each
|
||||||
|
* element. elem only exists within the loop.
|
||||||
|
*/
|
||||||
|
#define ARRAY_FOR_EACH(_arr, _elem) \
|
||||||
|
for (__typeof__((_arr)[0]) *_elem = _arr; \
|
||||||
|
_elem < (_arr) + ARRAY_LENGTH(_arr); \
|
||||||
|
_elem++)
|
||||||
|
|
||||||
|
#define min(a, b) (((a) < (b)) ? (a) : (b))
|
||||||
|
#define max(a, b) (((a) > (b)) ? (a) : (b))
|
||||||
|
|
||||||
|
#define ANSI_HIGHLIGHT "\x1B[0;1;39m"
|
||||||
|
#define ANSI_RED "\x1B[0;31m"
|
||||||
|
#define ANSI_GREEN "\x1B[0;32m"
|
||||||
|
#define ANSI_YELLOW "\x1B[0;33m"
|
||||||
|
#define ANSI_BLUE "\x1B[0;34m"
|
||||||
|
#define ANSI_MAGENTA "\x1B[0;35m"
|
||||||
|
#define ANSI_CYAN "\x1B[0;36m"
|
||||||
|
#define ANSI_BRIGHT_RED "\x1B[0;31;1m"
|
||||||
|
#define ANSI_BRIGHT_GREEN "\x1B[0;32;1m"
|
||||||
|
#define ANSI_BRIGHT_YELLOW "\x1B[0;33;1m"
|
||||||
|
#define ANSI_BRIGHT_BLUE "\x1B[0;34;1m"
|
||||||
|
#define ANSI_BRIGHT_MAGENTA "\x1B[0;35;1m"
|
||||||
|
#define ANSI_BRIGHT_CYAN "\x1B[0;36;1m"
|
||||||
|
#define ANSI_NORMAL "\x1B[0m"
|
||||||
|
|
||||||
|
#define ANSI_UP "\x1B[%dA"
|
||||||
|
#define ANSI_DOWN "\x1B[%dB"
|
||||||
|
#define ANSI_RIGHT "\x1B[%dC"
|
||||||
|
#define ANSI_LEFT "\x1B[%dD"
|
||||||
|
|
||||||
|
#define CASE_RETURN_STRING(a) case a: return #a
|
||||||
|
|
||||||
|
#define _fallthrough_ __attribute__((fallthrough))
|
||||||
243
src/util-strings.c
Normal file
243
src/util-strings.c
Normal file
@@ -0,0 +1,243 @@
|
|||||||
|
/*
|
||||||
|
* Copyright © 2008 Kristian Høgsberg
|
||||||
|
* Copyright © 2013-2015 Red Hat, Inc.
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
|
* copy of this software and associated documentation files (the "Software"),
|
||||||
|
* to deal in the Software without restriction, including without limitation
|
||||||
|
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||||
|
* and/or sell copies of the Software, and to permit persons to whom the
|
||||||
|
* Software is furnished to do so, subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice (including the next
|
||||||
|
* paragraph) shall be included in all copies or substantial portions of the
|
||||||
|
* Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||||
|
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||||
|
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
|
* DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
|
#include "util-strings.h"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the next word in a string pointed to by state before the first
|
||||||
|
* separator character. Call repeatedly to tokenize a whole string.
|
||||||
|
*
|
||||||
|
* @param state Current state
|
||||||
|
* @param len String length of the word returned
|
||||||
|
* @param separators List of separator characters
|
||||||
|
*
|
||||||
|
* @return The first word in *state, NOT null-terminated
|
||||||
|
*/
|
||||||
|
static const char *
|
||||||
|
next_word(const char **state, size_t *len, const char *separators)
|
||||||
|
{
|
||||||
|
const char *next = *state;
|
||||||
|
size_t l;
|
||||||
|
|
||||||
|
if (!*next)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
next += strspn(next, separators);
|
||||||
|
if (!*next) {
|
||||||
|
*state = next;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
l = strcspn(next, separators);
|
||||||
|
*state = next + l;
|
||||||
|
*len = l;
|
||||||
|
|
||||||
|
return next;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return a null-terminated string array with the contents of argv
|
||||||
|
* duplicated.
|
||||||
|
*
|
||||||
|
* Use strv_free() to free the array.
|
||||||
|
*
|
||||||
|
* @return A null-terminated string array or NULL on errors
|
||||||
|
*/
|
||||||
|
char**
|
||||||
|
strv_from_argv(int argc, char **argv)
|
||||||
|
{
|
||||||
|
char **strv = NULL;
|
||||||
|
|
||||||
|
assert(argc >= 0);
|
||||||
|
|
||||||
|
if (argc == 0)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
strv = zalloc((argc + 1) * sizeof *strv);
|
||||||
|
for (int i = 0; i < argc; i++) {
|
||||||
|
char *copy = safe_strdup(argv[i]);
|
||||||
|
if (!copy) {
|
||||||
|
strv_free(strv);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
strv[i] = copy;
|
||||||
|
}
|
||||||
|
return strv;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return a null-terminated string array with the tokens in the input
|
||||||
|
* string, e.g. "one two\tthree" with a separator list of " \t" will return
|
||||||
|
* an array [ "one", "two", "three", NULL ] and num elements 3.
|
||||||
|
*
|
||||||
|
* Use strv_free() to free the array.
|
||||||
|
*
|
||||||
|
* Another example:
|
||||||
|
* result = strv_from_string("+1-2++3--4++-+5-+-", "+-", &nelem)
|
||||||
|
* result == [ "1", "2", "3", "4", "5", NULL ] and nelem == 5
|
||||||
|
*
|
||||||
|
* @param in Input string
|
||||||
|
* @param separators List of separator characters
|
||||||
|
* @param num_elements Number of elements found in the input string
|
||||||
|
*
|
||||||
|
* @return A null-terminated string array or NULL on errors
|
||||||
|
*/
|
||||||
|
char **
|
||||||
|
strv_from_string(const char *in, const char *separators, size_t *num_elements)
|
||||||
|
{
|
||||||
|
assert(in != NULL);
|
||||||
|
|
||||||
|
const char *s = in;
|
||||||
|
size_t l, nelems = 0;
|
||||||
|
while (next_word(&s, &l, separators) != NULL)
|
||||||
|
nelems++;
|
||||||
|
|
||||||
|
if (nelems == 0) {
|
||||||
|
*num_elements = 0;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
size_t strv_len = nelems + 1; /* NULL-terminated */
|
||||||
|
char **strv = zalloc(strv_len * sizeof *strv);
|
||||||
|
|
||||||
|
size_t idx = 0;
|
||||||
|
const char *word;
|
||||||
|
s = in;
|
||||||
|
while ((word = next_word(&s, &l, separators)) != NULL) {
|
||||||
|
char *copy = strndup(word, l);
|
||||||
|
if (!copy) {
|
||||||
|
strv_free(strv);
|
||||||
|
*num_elements = 0;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
strv[idx++] = copy;
|
||||||
|
}
|
||||||
|
|
||||||
|
*num_elements = nelems;
|
||||||
|
|
||||||
|
return strv;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return a newly allocated string with all elements joined by the
|
||||||
|
* joiner, same as Python's string.join() basically.
|
||||||
|
* A strv of ["one", "two", "three", NULL] with a joiner of ", " results
|
||||||
|
* in "one, two, three".
|
||||||
|
*
|
||||||
|
* An empty strv ([NULL]) returns NULL, same for passing NULL as either
|
||||||
|
* argument.
|
||||||
|
*
|
||||||
|
* @param strv Input string array
|
||||||
|
* @param joiner Joiner between the elements in the final string
|
||||||
|
*
|
||||||
|
* @return A null-terminated string joining all elements
|
||||||
|
*/
|
||||||
|
char *
|
||||||
|
strv_join(char **strv, const char *joiner)
|
||||||
|
{
|
||||||
|
char **s;
|
||||||
|
char *str;
|
||||||
|
size_t slen = 0;
|
||||||
|
size_t count = 0;
|
||||||
|
|
||||||
|
if (!strv || !joiner)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
if (strv[0] == NULL)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
for (s = strv, count = 0; *s; s++, count++) {
|
||||||
|
slen += strlen(*s);
|
||||||
|
}
|
||||||
|
|
||||||
|
assert(slen < 1000);
|
||||||
|
assert(strlen(joiner) < 1000);
|
||||||
|
assert(count > 0);
|
||||||
|
assert(count < 100);
|
||||||
|
|
||||||
|
slen += (count - 1) * strlen(joiner);
|
||||||
|
|
||||||
|
str = zalloc(slen + 1); /* trailing \0 */
|
||||||
|
for (s = strv; *s; s++) {
|
||||||
|
strcat(str, *s);
|
||||||
|
--count;
|
||||||
|
if (count > 0)
|
||||||
|
strcat(str, joiner);
|
||||||
|
}
|
||||||
|
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return a pointer to the basename within filename.
|
||||||
|
* If the filename the empty string or a directory (i.e. the last char of
|
||||||
|
* filename is '/') NULL is returned.
|
||||||
|
*/
|
||||||
|
const char *
|
||||||
|
safe_basename(const char *filename)
|
||||||
|
{
|
||||||
|
const char *basename;
|
||||||
|
|
||||||
|
if (*filename == '\0')
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
basename = strrchr(filename, '/');
|
||||||
|
if (basename == NULL)
|
||||||
|
return filename;
|
||||||
|
|
||||||
|
if (*(basename + 1) == '\0')
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
return basename + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Similar to basename() but returns the trunk only without the (last)
|
||||||
|
* trailing suffix, so that:
|
||||||
|
*
|
||||||
|
* - foo.c returns foo
|
||||||
|
* - foo.a.b returns foo.a
|
||||||
|
* - foo returns foo
|
||||||
|
* - foo/ returns ""
|
||||||
|
*
|
||||||
|
* @return an allocated string representing the trunk name of the file
|
||||||
|
*/
|
||||||
|
char *
|
||||||
|
trunkname(const char *filename)
|
||||||
|
{
|
||||||
|
const char *base = safe_basename(filename);
|
||||||
|
char *suffix;
|
||||||
|
|
||||||
|
if (base == NULL)
|
||||||
|
return safe_strdup("");
|
||||||
|
|
||||||
|
suffix = rindex(base, '.');
|
||||||
|
if (suffix == NULL)
|
||||||
|
return safe_strdup(base);
|
||||||
|
else
|
||||||
|
return strndup(base, suffix-base);
|
||||||
|
}
|
||||||
464
src/util-strings.h
Normal file
464
src/util-strings.h
Normal file
@@ -0,0 +1,464 @@
|
|||||||
|
/*
|
||||||
|
* Copyright © 2008 Kristian Høgsberg
|
||||||
|
* Copyright © 2013-2015 Red Hat, Inc.
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
|
* copy of this software and associated documentation files (the "Software"),
|
||||||
|
* to deal in the Software without restriction, including without limitation
|
||||||
|
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||||
|
* and/or sell copies of the Software, and to permit persons to whom the
|
||||||
|
* Software is furnished to do so, subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice (including the next
|
||||||
|
* paragraph) shall be included in all copies or substantial portions of the
|
||||||
|
* Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||||
|
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||||
|
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
|
* DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
#define _GNU_SOURCE
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
|
#include <ctype.h>
|
||||||
|
#include <errno.h>
|
||||||
|
#include <limits.h>
|
||||||
|
#include <math.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdbool.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <stdarg.h>
|
||||||
|
#ifdef HAVE_LOCALE_H
|
||||||
|
#include <locale.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_XLOCALE_H
|
||||||
|
#include <xlocale.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "util-macros.h"
|
||||||
|
|
||||||
|
static inline bool
|
||||||
|
streq(const char *str1, const char *str2)
|
||||||
|
{
|
||||||
|
/* one NULL, one not NULL is always false */
|
||||||
|
if (str1 && str2)
|
||||||
|
return strcmp(str1, str2) == 0;
|
||||||
|
return str1 == str2;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline bool
|
||||||
|
strneq(const char *str1, const char *str2, int n)
|
||||||
|
{
|
||||||
|
/* one NULL, one not NULL is always false */
|
||||||
|
if (str1 && str2)
|
||||||
|
return strncmp(str1, str2, n) == 0;
|
||||||
|
return str1 == str2;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void *
|
||||||
|
zalloc(size_t size)
|
||||||
|
{
|
||||||
|
void *p;
|
||||||
|
|
||||||
|
/* We never need to alloc anything more than 1,5 MB so we can assume
|
||||||
|
* if we ever get above that something's going wrong */
|
||||||
|
if (size > 1536 * 1024)
|
||||||
|
assert(!"bug: internal malloc size limit exceeded");
|
||||||
|
|
||||||
|
p = calloc(1, size);
|
||||||
|
if (!p)
|
||||||
|
abort();
|
||||||
|
|
||||||
|
return p;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* strdup guaranteed to succeed. If the input string is NULL, the output
|
||||||
|
* string is NULL. If the input string is a string pointer, we strdup or
|
||||||
|
* abort on failure.
|
||||||
|
*/
|
||||||
|
static inline char*
|
||||||
|
safe_strdup(const char *str)
|
||||||
|
{
|
||||||
|
char *s;
|
||||||
|
|
||||||
|
if (!str)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
s = strdup(str);
|
||||||
|
if (!s)
|
||||||
|
abort();
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Simple wrapper for asprintf that ensures the passed in-pointer is set
|
||||||
|
* to NULL upon error.
|
||||||
|
* The standard asprintf() call does not guarantee the passed in pointer
|
||||||
|
* will be NULL'ed upon failure, whereas this wrapper does.
|
||||||
|
*
|
||||||
|
* @param strp pointer to set to newly allocated string.
|
||||||
|
* This pointer should be passed to free() to release when done.
|
||||||
|
* @param fmt the format string to use for printing.
|
||||||
|
* @return The number of bytes printed (excluding the null byte terminator)
|
||||||
|
* upon success or -1 upon failure. In the case of failure the pointer is set
|
||||||
|
* to NULL.
|
||||||
|
*/
|
||||||
|
__attribute__ ((format (printf, 2, 3)))
|
||||||
|
static inline int
|
||||||
|
xasprintf(char **strp, const char *fmt, ...)
|
||||||
|
{
|
||||||
|
int rc = 0;
|
||||||
|
va_list args;
|
||||||
|
|
||||||
|
va_start(args, fmt);
|
||||||
|
rc = vasprintf(strp, fmt, args);
|
||||||
|
va_end(args);
|
||||||
|
if ((rc == -1) && strp)
|
||||||
|
*strp = NULL;
|
||||||
|
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
|
__attribute__ ((format (printf, 2, 0)))
|
||||||
|
static inline int
|
||||||
|
xvasprintf(char **strp, const char *fmt, va_list args)
|
||||||
|
{
|
||||||
|
int rc = 0;
|
||||||
|
rc = vasprintf(strp, fmt, args);
|
||||||
|
if ((rc == -1) && strp)
|
||||||
|
*strp = NULL;
|
||||||
|
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline bool
|
||||||
|
safe_atoi_base(const char *str, int *val, int base)
|
||||||
|
{
|
||||||
|
char *endptr;
|
||||||
|
long v;
|
||||||
|
|
||||||
|
assert(base == 10 || base == 16 || base == 8);
|
||||||
|
|
||||||
|
errno = 0;
|
||||||
|
v = strtol(str, &endptr, base);
|
||||||
|
if (errno > 0)
|
||||||
|
return false;
|
||||||
|
if (str == endptr)
|
||||||
|
return false;
|
||||||
|
if (*str != '\0' && *endptr != '\0')
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (v > INT_MAX || v < INT_MIN)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
*val = v;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline bool
|
||||||
|
safe_atoi(const char *str, int *val)
|
||||||
|
{
|
||||||
|
return safe_atoi_base(str, val, 10);
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline bool
|
||||||
|
safe_atou_base(const char *str, unsigned int *val, int base)
|
||||||
|
{
|
||||||
|
char *endptr;
|
||||||
|
unsigned long v;
|
||||||
|
|
||||||
|
assert(base == 10 || base == 16 || base == 8);
|
||||||
|
|
||||||
|
errno = 0;
|
||||||
|
v = strtoul(str, &endptr, base);
|
||||||
|
if (errno > 0)
|
||||||
|
return false;
|
||||||
|
if (str == endptr)
|
||||||
|
return false;
|
||||||
|
if (*str != '\0' && *endptr != '\0')
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if ((long)v < 0)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
*val = v;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline bool
|
||||||
|
safe_atou(const char *str, unsigned int *val)
|
||||||
|
{
|
||||||
|
return safe_atou_base(str, val, 10);
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline bool
|
||||||
|
safe_atod(const char *str, double *val)
|
||||||
|
{
|
||||||
|
char *endptr;
|
||||||
|
double v;
|
||||||
|
#ifdef HAVE_LOCALE_H
|
||||||
|
locale_t c_locale;
|
||||||
|
#endif
|
||||||
|
size_t slen = strlen(str);
|
||||||
|
|
||||||
|
/* We don't have a use-case where we want to accept hex for a double
|
||||||
|
* or any of the other values strtod can parse */
|
||||||
|
for (size_t i = 0; i < slen; i++) {
|
||||||
|
char c = str[i];
|
||||||
|
|
||||||
|
if (isdigit(c))
|
||||||
|
continue;
|
||||||
|
switch(c) {
|
||||||
|
case '+':
|
||||||
|
case '-':
|
||||||
|
case '.':
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef HAVE_LOCALE_H
|
||||||
|
/* Create a "C" locale to force strtod to use '.' as separator */
|
||||||
|
c_locale = newlocale(LC_NUMERIC_MASK, "C", (locale_t)0);
|
||||||
|
if (c_locale == (locale_t)0)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
errno = 0;
|
||||||
|
v = strtod_l(str, &endptr, c_locale);
|
||||||
|
freelocale(c_locale);
|
||||||
|
#else
|
||||||
|
/* No locale support in provided libc, assume it already uses '.' */
|
||||||
|
errno = 0;
|
||||||
|
v = strtod(str, &endptr);
|
||||||
|
#endif
|
||||||
|
if (errno > 0)
|
||||||
|
return false;
|
||||||
|
if (str == endptr)
|
||||||
|
return false;
|
||||||
|
if (*str != '\0' && *endptr != '\0')
|
||||||
|
return false;
|
||||||
|
if (v != 0.0 && !isnormal(v))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
*val = v;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
char **strv_from_argv(int argc, char **argv);
|
||||||
|
char **strv_from_string(const char *in, const char *separator, size_t *num_elements);
|
||||||
|
char *strv_join(char **strv, const char *joiner);
|
||||||
|
|
||||||
|
static inline void
|
||||||
|
strv_free(char **strv) {
|
||||||
|
char **s = strv;
|
||||||
|
|
||||||
|
if (!strv)
|
||||||
|
return;
|
||||||
|
|
||||||
|
while (*s != NULL) {
|
||||||
|
free(*s);
|
||||||
|
*s = (char*)0x1; /* detect use-after-free */
|
||||||
|
s++;
|
||||||
|
}
|
||||||
|
|
||||||
|
free (strv);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* parse a string containing a list of doubles into a double array.
|
||||||
|
*
|
||||||
|
* @param in string to parse
|
||||||
|
* @param separator string used to separate double in list e.g. ","
|
||||||
|
* @param result double array
|
||||||
|
* @param length length of double array
|
||||||
|
* @return true when parsed successfully otherwise false
|
||||||
|
*/
|
||||||
|
static inline double *
|
||||||
|
double_array_from_string(const char *in,
|
||||||
|
const char *separator,
|
||||||
|
size_t *length)
|
||||||
|
{
|
||||||
|
double *result = NULL;
|
||||||
|
*length = 0;
|
||||||
|
|
||||||
|
size_t nelem;
|
||||||
|
char **strv = strv_from_string(in, separator, &nelem);
|
||||||
|
if(!strv)
|
||||||
|
return result;
|
||||||
|
|
||||||
|
double *numv = zalloc(sizeof(double) * nelem);
|
||||||
|
for (size_t idx = 0; idx < nelem; idx++) {
|
||||||
|
double val;
|
||||||
|
if (!safe_atod(strv[idx], &val))
|
||||||
|
goto out;
|
||||||
|
|
||||||
|
numv[idx] = val;
|
||||||
|
}
|
||||||
|
|
||||||
|
result = numv;
|
||||||
|
numv = NULL;
|
||||||
|
*length = nelem;
|
||||||
|
|
||||||
|
out:
|
||||||
|
strv_free(strv);
|
||||||
|
free(numv);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct key_value_str{
|
||||||
|
char *key;
|
||||||
|
char *value;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct key_value_double {
|
||||||
|
double key;
|
||||||
|
double value;
|
||||||
|
};
|
||||||
|
|
||||||
|
static inline ssize_t
|
||||||
|
kv_double_from_string(const char *string,
|
||||||
|
const char *pair_separator,
|
||||||
|
const char *kv_separator,
|
||||||
|
struct key_value_double **result_out)
|
||||||
|
|
||||||
|
{
|
||||||
|
struct key_value_double *result = NULL;
|
||||||
|
|
||||||
|
if (!pair_separator || pair_separator[0] == '\0' ||
|
||||||
|
!kv_separator || kv_separator[0] == '\0')
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
size_t npairs;
|
||||||
|
char **pairs = strv_from_string(string, pair_separator, &npairs);
|
||||||
|
if (!pairs || npairs == 0)
|
||||||
|
goto error;
|
||||||
|
|
||||||
|
result = zalloc(npairs * sizeof *result);
|
||||||
|
|
||||||
|
for (size_t idx = 0; idx < npairs; idx++) {
|
||||||
|
char *pair = pairs[idx];
|
||||||
|
size_t nelem;
|
||||||
|
char **kv = strv_from_string(pair, kv_separator, &nelem);
|
||||||
|
double k, v;
|
||||||
|
|
||||||
|
if (!kv || nelem != 2 ||
|
||||||
|
!safe_atod(kv[0], &k) ||
|
||||||
|
!safe_atod(kv[1], &v)) {
|
||||||
|
strv_free(kv);
|
||||||
|
goto error;
|
||||||
|
}
|
||||||
|
|
||||||
|
result[idx].key = k;
|
||||||
|
result[idx].value = v;
|
||||||
|
|
||||||
|
strv_free(kv);
|
||||||
|
}
|
||||||
|
|
||||||
|
strv_free(pairs);
|
||||||
|
|
||||||
|
*result_out = result;
|
||||||
|
|
||||||
|
return npairs;
|
||||||
|
|
||||||
|
error:
|
||||||
|
strv_free(pairs);
|
||||||
|
free(result);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Strip any of the characters in what from the beginning and end of the
|
||||||
|
* input string.
|
||||||
|
*
|
||||||
|
* @return a newly allocated string with none of "what" at the beginning or
|
||||||
|
* end of string
|
||||||
|
*/
|
||||||
|
static inline char *
|
||||||
|
strstrip(const char *input, const char *what)
|
||||||
|
{
|
||||||
|
char *str, *last;
|
||||||
|
|
||||||
|
str = safe_strdup(&input[strspn(input, what)]);
|
||||||
|
|
||||||
|
last = str;
|
||||||
|
|
||||||
|
for (char *c = str; *c != '\0'; c++) {
|
||||||
|
if (!strchr(what, *c))
|
||||||
|
last = c + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
*last = '\0';
|
||||||
|
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return true if str ends in suffix, false otherwise. If the suffix is the
|
||||||
|
* empty string, strendswith() always returns false.
|
||||||
|
*/
|
||||||
|
static inline bool
|
||||||
|
strendswith(const char *str, const char *suffix)
|
||||||
|
{
|
||||||
|
size_t slen = strlen(str);
|
||||||
|
size_t suffixlen = strlen(suffix);
|
||||||
|
size_t offset;
|
||||||
|
|
||||||
|
if (slen == 0 || suffixlen == 0 || suffixlen > slen)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
offset = slen - suffixlen;
|
||||||
|
return strneq(&str[offset], suffix, suffixlen);
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline bool
|
||||||
|
strstartswith(const char *str, const char *prefix)
|
||||||
|
{
|
||||||
|
size_t prefixlen = strlen(prefix);
|
||||||
|
|
||||||
|
return prefixlen > 0 ? strneq(str, prefix, strlen(prefix)) : false;
|
||||||
|
}
|
||||||
|
|
||||||
|
const char *
|
||||||
|
safe_basename(const char *filename);
|
||||||
|
|
||||||
|
char *
|
||||||
|
trunkname(const char *filename);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return a copy of str with all % converted to %% to make the string
|
||||||
|
* acceptable as printf format.
|
||||||
|
*/
|
||||||
|
static inline char *
|
||||||
|
str_sanitize(const char *str)
|
||||||
|
{
|
||||||
|
if (!str)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
if (!strchr(str, '%'))
|
||||||
|
return strdup(str);
|
||||||
|
|
||||||
|
size_t slen = min(strlen(str), 512);
|
||||||
|
char *sanitized = zalloc(2 * slen + 1);
|
||||||
|
const char *src = str;
|
||||||
|
char *dst = sanitized;
|
||||||
|
|
||||||
|
for (size_t i = 0; i < slen; i++) {
|
||||||
|
if (*src == '%')
|
||||||
|
*dst++ = '%';
|
||||||
|
*dst++ = *src++;
|
||||||
|
}
|
||||||
|
*dst = '\0';
|
||||||
|
|
||||||
|
return sanitized;
|
||||||
|
}
|
||||||
1739
src/xf86libinput.c
1739
src/xf86libinput.c
File diff suppressed because it is too large
Load Diff
@@ -1,24 +1,26 @@
|
|||||||
/*
|
/*
|
||||||
|
* SPDX-License-Identifier: MIT
|
||||||
|
*
|
||||||
* Copyright © 2016 Red Hat, Inc.
|
* Copyright © 2016 Red Hat, Inc.
|
||||||
*
|
*
|
||||||
* Permission to use, copy, modify, distribute, and sell this software
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* and its documentation for any purpose is hereby granted without
|
* of this software and associated documentation files (the "Software"), to
|
||||||
* fee, provided that the above copyright notice appear in all copies
|
* deal in the Software without restriction, including without limitation the
|
||||||
* and that both that copyright notice and this permission notice
|
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||||
* appear in supporting documentation, and that the name of Red Hat
|
* sell copies of the Software, and to permit persons to whom the Software is
|
||||||
* not be used in advertising or publicity pertaining to distribution
|
* furnished to do so, subject to the following conditions:
|
||||||
* of the software without specific, written prior permission. Red
|
|
||||||
* Hat makes no representations about the suitability of this software
|
|
||||||
* for any purpose. It is provided "as is" without express or implied
|
|
||||||
* warranty.
|
|
||||||
*
|
*
|
||||||
* THE AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
* The above copyright notice and this permission notice (including the next
|
||||||
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
|
* paragraph) shall be included in all copies or substantial portions of the
|
||||||
* NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
* Software.
|
||||||
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
|
*
|
||||||
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||||
|
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||||
|
* IN THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "bezier.h"
|
#include "bezier.h"
|
||||||
|
|||||||
@@ -1,24 +1,26 @@
|
|||||||
/*
|
/*
|
||||||
|
* SPDX-License-Identifier: MIT
|
||||||
|
*
|
||||||
* Copyright © 2013-2015 Red Hat, Inc.
|
* Copyright © 2013-2015 Red Hat, Inc.
|
||||||
*
|
*
|
||||||
* Permission to use, copy, modify, distribute, and sell this software
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* and its documentation for any purpose is hereby granted without
|
* of this software and associated documentation files (the "Software"), to
|
||||||
* fee, provided that the above copyright notice appear in all copies
|
* deal in the Software without restriction, including without limitation the
|
||||||
* and that both that copyright notice and this permission notice
|
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||||
* appear in supporting documentation, and that the name of Red Hat
|
* sell copies of the Software, and to permit persons to whom the Software is
|
||||||
* not be used in advertising or publicity pertaining to distribution
|
* furnished to do so, subject to the following conditions:
|
||||||
* of the software without specific, written prior permission. Red
|
|
||||||
* Hat makes no representations about the suitability of this software
|
|
||||||
* for any purpose. It is provided "as is" without express or implied
|
|
||||||
* warranty.
|
|
||||||
*
|
*
|
||||||
* THE AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
* The above copyright notice and this permission notice (including the next
|
||||||
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
|
* paragraph) shall be included in all copies or substantial portions of the
|
||||||
* NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
* Software.
|
||||||
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
|
*
|
||||||
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||||
|
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||||
|
* IN THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "draglock.h"
|
#include "draglock.h"
|
||||||
@@ -231,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;
|
||||||
@@ -257,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;
|
||||||
@@ -281,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 */
|
||||||
@@ -337,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 */
|
||||||
@@ -407,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 */
|
||||||
@@ -465,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;
|
||||||
|
|||||||
Reference in New Issue
Block a user