Compare commits

..

34 commits

Author SHA1 Message Date
Giulio P
be44b6e6a8 doc: fix typo
Remove a repetition of words in the comments on
libevdev_set_event_value()

Part-of: <https://gitlab.freedesktop.org/libevdev/libevdev/-/merge_requests/131>
2025-12-07 02:31:20 +00:00
Peter Hutterer
139b58e135 libevdev 1.13.6
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2025-12-01 15:12:22 +10:00
Peter Hutterer
c6bf238c4e include: sync event codes with kernel 6.18
Part-of: <https://gitlab.freedesktop.org/libevdev/libevdev/-/merge_requests/129>
2025-12-01 14:49:50 +10:00
Peter Hutterer
f3a9c2038d libevdev 1.13.5
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2025-10-20 14:49:38 +10:00
Marcos Alano
9289c9826c Sync headers with kernel 6.17
Part-of: <https://gitlab.freedesktop.org/libevdev/libevdev/-/merge_requests/126>
2025-09-28 20:34:21 -03:00
Peter Hutterer
a30a461e82 util: change the bit to shift to ULL
libevdev/libevdev-util.h:45:45: runtime error: left shift of 1 by 63 places cannot be represented in type 'long long'

Fixes: #32
Part-of: <https://gitlab.freedesktop.org/libevdev/libevdev/-/merge_requests/127>
2025-08-13 21:23:10 +10:00
Peter Hutterer
d093b4752a include: sync event codes with kernel 6.16
Part-of: <https://gitlab.freedesktop.org/libevdev/libevdev/-/merge_requests/125>
2025-07-29 09:07:13 +10:00
Peter Hutterer
ac0056961c libevdev 1.13.4 2025-03-25 09:27:07 +10:00
andeston
d06abb81e5 Always push changed mt events when syncing
If the start and end of a touch are dropped, the slot, according to the
kernel, may have a different state. We should inform the client of these
changes even if the slot is not currently active.

For most axes this doesn't matter too much as we expect them to change
during an active touch anyway so we don't expect the kernel's caching to
be a problem. However where the ABS_MT_TOOL_TYPE changed during a sync
we need to inform the client of the new tool type so that future
touchese won't be erroneously treated as e.g. palms.

For a full reproducer see the test case but it comes down to:
- touch down with MT_TOOL_PALM, make sure libevdev reads the state
- change that slot to MT_TOOL_FINGER, trigger a sync
- ensure that libevdev pushes out that tool type change even if the
  slot is not currently active

Co-authored-by: Peter Hutterer <peter.hutterer@who-t.net>
Part-of: <https://gitlab.freedesktop.org/libevdev/libevdev/-/merge_requests/124>
2025-01-06 13:21:29 +10:00
Peter Hutterer
cfd803566c CI: update to latest ci-templates
This allows for using @users.noreply addresses and still pass
ci-fairy checks.

Part-of: <https://gitlab.freedesktop.org/libevdev/libevdev/-/merge_requests/123>
2025-01-06 12:57:50 +10:00
Peter Hutterer
1a8324aeb8 Drop the signed-off-by requirement
We've had this for roughly 10y now and it's value is dubious. Most of
xorg no longer requires, mesa accepts but doesn't require it, most of GNOME
doesn't accept it and neither does systemd.

Let's drop the requirement.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Part-of: <https://gitlab.freedesktop.org/libevdev/libevdev/-/merge_requests/123>
2025-01-06 12:51:05 +10:00
Peter Hutterer
72fa564092 gitlab CI: bump to latest fedoras and ubuntu
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2024-11-25 10:34:30 +10:00
Peter Hutterer
2342d8c9ee libevdev 1.13.3
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2024-09-03 12:16:11 +10:00
Peter Hutterer
54c083378e include: sync event codes with kernel 6.10
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2024-07-15 15:57:02 +10:00
Peter Hutterer
5501633d51 libevdev 1.13.2
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2024-05-31 15:16:54 +10:00
Peter Hutterer
080d1d097a include: sync event codes with kernel 6.9
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2024-05-14 15:23:31 +10:00
Peter Hutterer
414757317d gitlab CI: don't run MR pipelines in forks
Commit originally by Simon Ser in wayland/wayland-protocols!305.

Currently our CI setup has a downside: for each push on a merge
request, two pipelines are triggered. The first is triggered in
the context of the forked repository, and the second is triggered
in the context of the MR in the parent repository.

Replace the workflow rules with the ones in the official docs [1],
so that a branch pipeline isn't triggered when a MR exists for that
branch.

[1]: https://docs.gitlab.com/ee/ci/yaml/workflow.html#switch-between-branch-pipelines-and-merge-request-pipelines

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2024-04-30 08:46:00 +10:00
Peter Hutterer
fb5402020f meson.build: remove superfluous double doxygen check
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2024-03-21 16:11:08 +10:00
Peter Hutterer
de6ae19483 meson.build: specify the include directory correctly
If libevdev is used as subproject header lookup for libevdev.h fails
because our build directory isn't correctly set as one of the include
directories.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2024-03-21 16:11:08 +10:00
Peter Hutterer
82560ca9d7 meson.build: declare the file list as such
Not much of an effect but where libevdev is used as subproject those
files are now correctly accessible.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2024-03-21 16:11:08 +10:00
Peter Hutterer
1ee2399ba8 meson.build: allow disabling building the various tools
A bit of a niche case but this helps with embedding libevdev as static
library when the tools don't matter.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2024-03-21 16:11:08 +10:00
Peter Hutterer
d852e59dd0 gitlab CI: rebuild the images
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2024-03-21 16:04:50 +10:00
Peter Hutterer
8d8a3d8fc7 gitlab CI: drop Ubuntu 22.10
Repos are 404

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2024-03-21 16:04:44 +10:00
Peter Hutterer
cd9bea914c gitlab CI: drop unnecessary B2C_VERSION
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2024-03-21 15:52:50 +10:00
Peter Hutterer
179fc4d370 gitlab CI: update to the same b2c image libinput uses
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2024-03-21 15:26:57 +10:00
Peter Hutterer
703999edec gitlab CI: remove the jobs for the scheduled forced rebuild
This scheduled pipeline no long runs, so let's drop this job.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2024-03-21 15:15:01 +10:00
Peter Hutterer
5db8e66bd3 gitlab CI: update to latest Fedoras
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2024-03-21 15:15:01 +10:00
Peter Hutterer
2e0a0cd271 gitlab CI: update to latest template and use the ci-fairy image
Makes life easier because we don't have to deal with the pip complaints.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2024-03-21 15:10:00 +10:00
Peter Hutterer
97d0e4d151 CI: add a comment to the meson build helper
We now have an upstream for it so we can sync changes between projects.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2023-05-30 15:18:28 +10:00
Peter Hutterer
d21d826b63 CI: bump to new fedoras and ubuntus
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2023-05-08 14:45:10 +10:00
Peter Hutterer
d399abca1a tools/publish-doc: enable pushing docs for specific tags
Historically, I copied the docs on the server directly after pushing latest,
but (especially with meson) it's a lot easier to just build that specific tag
locally and rsync it to the correct target directory.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2023-05-07 23:48:44 +00:00
Peter Hutterer
d7139f1314 tools/publish-doc: build the docs with meson before synching
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2023-05-07 23:48:44 +00:00
Peter Hutterer
1cc8c6d491 doc: update the ioctl list with missing ioctls
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2023-05-08 09:35:37 +10:00
Peter Hutterer
f201583026 doc: remove duplicate doc entry for EVIOCSKEYCODE
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2023-05-08 09:18:57 +10:00
16 changed files with 505 additions and 310 deletions

View file

@ -4,22 +4,18 @@
# # # #
######################################## ########################################
.templates_sha: &template_sha c1e465762df9d4208a03ed4df6cae15006579838 # see https://docs.gitlab.com/ee/ci/yaml/#includefile .templates_sha: &template_sha e195d80f35b45cc73668be3767b923fd76c70ed5 # see https://docs.gitlab.com/ee/ci/yaml/#includefile
include: include:
- project: 'freedesktop/ci-templates' - project: 'freedesktop/ci-templates'
ref: *template_sha ref: *template_sha
file: file:
# Alpine container builder template
- '/templates/alpine.yml' - '/templates/alpine.yml'
# Arch container builder template
- '/templates/arch.yml' - '/templates/arch.yml'
# Debian container builder template
- '/templates/debian.yml' - '/templates/debian.yml'
# Fedora container builder template
- '/templates/fedora.yml' - '/templates/fedora.yml'
# Ubuntu container builder template
- '/templates/ubuntu.yml' - '/templates/ubuntu.yml'
- '/templates/ci-fairy.yml'
stages: stages:
- prep # rebuild the container images if there is a change - prep # rebuild the container images if there is a change
@ -33,8 +29,10 @@ stages:
workflow: workflow:
rules: rules:
- if: $CI_PIPELINE_SOURCE == 'merge_request_event' - if: $CI_PIPELINE_SOURCE == "merge_request_event"
- if: $CI_PIPELINE_SOURCE == 'push' - if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS
when: never
- if: $CI_COMMIT_BRANCH
variables: variables:
# The upstrem repository we will check for images # The upstrem repository we will check for images
@ -74,52 +72,46 @@ variables:
variables: variables:
MESON_TEST_ARGS: '--no-suite=needs-uinput' MESON_TEST_ARGS: '--no-suite=needs-uinput'
.fedora:36: .fedora:40:
extends: .fdo.distribution-image@fedora extends: .fdo.distribution-image@fedora
variables: variables:
FDO_DISTRIBUTION_TAG: '2023-02-15.0' FDO_DISTRIBUTION_TAG: '2024-11-25.0'
FDO_DISTRIBUTION_VERSION: '36' FDO_DISTRIBUTION_VERSION: '40'
.fedora:37: .fedora:41:
extends: .fdo.distribution-image@fedora extends: .fdo.distribution-image@fedora
variables: variables:
FDO_DISTRIBUTION_TAG: '2023-02-15.0' FDO_DISTRIBUTION_TAG: '2024-11-25.0'
FDO_DISTRIBUTION_VERSION: '37' FDO_DISTRIBUTION_VERSION: '41'
.ubuntu:22.04: .ubuntu:24.10:
extends: .fdo.distribution-image@ubuntu extends: .fdo.distribution-image@ubuntu
variables: variables:
FDO_DISTRIBUTION_TAG: '2023-02-15.0' FDO_DISTRIBUTION_TAG: '2024-11-25.0'
FDO_DISTRIBUTION_VERSION: '22.04' FDO_DISTRIBUTION_VERSION: '24.10'
.ubuntu:22.10:
extends: .fdo.distribution-image@ubuntu
variables:
FDO_DISTRIBUTION_TAG: '2023-02-15.0'
FDO_DISTRIBUTION_VERSION: '22.10'
.debian:stable: .debian:stable:
extends: .fdo.distribution-image@debian extends: .fdo.distribution-image@debian
variables: variables:
FDO_DISTRIBUTION_TAG: '2023-02-15.0' FDO_DISTRIBUTION_TAG: '2024-11-25.0'
FDO_DISTRIBUTION_VERSION: 'stable' FDO_DISTRIBUTION_VERSION: 'stable'
.debian:sid: .debian:sid:
extends: .fdo.distribution-image@debian extends: .fdo.distribution-image@debian
variables: variables:
FDO_DISTRIBUTION_TAG: '2023-02-15.0' FDO_DISTRIBUTION_TAG: '2024-11-25.0'
FDO_DISTRIBUTION_VERSION: 'sid' FDO_DISTRIBUTION_VERSION: 'sid'
.arch:rolling: .arch:rolling:
extends: .fdo.distribution-image@arch extends: .fdo.distribution-image@arch
variables: variables:
FDO_DISTRIBUTION_TAG: '2023-02-15.0' FDO_DISTRIBUTION_TAG: '2024-11-25.0'
FDO_DISTRIBUTION_VERSION: 'rolling' FDO_DISTRIBUTION_VERSION: 'rolling'
.alpine:latest: .alpine:latest:
extends: .fdo.distribution-image@alpine extends: .fdo.distribution-image@alpine
variables: variables:
FDO_DISTRIBUTION_TAG: '2023-02-15.0' FDO_DISTRIBUTION_TAG: '2024-11-25.0'
FDO_DISTRIBUTION_VERSION: 'latest' FDO_DISTRIBUTION_VERSION: 'latest'
@ -135,14 +127,11 @@ variables:
# $SRCDIR/.gitlab-ci/generate-gitlab-ci.py # $SRCDIR/.gitlab-ci/generate-gitlab-ci.py
# #
check-ci-script: check-ci-script:
image: golang:alpine extends:
- .fdo.ci-fairy
stage: prep stage: prep
before_script:
- apk add python3 py-pip git
- pip3 install git+http://gitlab.freedesktop.org/freedesktop/ci-templates
script: script:
- ci-fairy generate-template - ci-fairy generate-template --verify && exit 0 || true
- git diff --exit-code && exit 0 || true
- echo "Committed gitlab-ci.yml differs from generated gitlab-ci.yml. Please verify" - echo "Committed gitlab-ci.yml differs from generated gitlab-ci.yml. Please verify"
- exit 1 - exit 1
@ -151,13 +140,13 @@ check-ci-script:
# #
check-commit: check-commit:
image: golang:alpine extends:
- .fdo.ci-fairy
stage: prep stage: prep
before_script:
- apk add python3 py-pip git
- pip3 install git+http://gitlab.freedesktop.org/freedesktop/ci-templates
script: script:
- ci-fairy check-commits --signed-off-by --junit-xml=results.xml - ci-fairy -vv check-commits --junit-xml=results.xml && exit 0 || true
- echo "Error checking the commit message format. Please verify"
- exit 1
except: except:
- master@libevdev/libevdev - master@libevdev/libevdev
variables: variables:
@ -171,11 +160,9 @@ check-commit:
# #
check-merge-request: check-merge-request:
image: golang:alpine extends:
- .fdo.ci-fairy
stage: merge-check stage: merge-check
before_script:
- apk add python3 py-pip git
- pip3 install git+http://gitlab.freedesktop.org/freedesktop/ci-templates
script: script:
- ci-fairy check-merge-request --require-allow-collaboration --junit-xml=results.xml - ci-fairy check-merge-request --require-allow-collaboration --junit-xml=results.xml
artifacts: artifacts:
@ -183,6 +170,8 @@ check-merge-request:
reports: reports:
junit: results.xml junit: results.xml
allow_failure: true allow_failure: true
rules:
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
.fedora.packages: .fedora.packages:
@ -199,7 +188,7 @@ check-merge-request:
.arch.packages: .arch.packages:
variables: variables:
FDO_DISTRIBUTION_PACKAGES: 'git gcc meson automake autoconf libtool make pkgconfig python3 check valgrind binutils doxygen' FDO_DISTRIBUTION_PACKAGES: 'git gc meson automake autoconf libtool make pkgconfig python3 check valgrind binutils doxygen'
.alpine.packages: .alpine.packages:
variables: variables:
@ -208,84 +197,37 @@ check-merge-request:
# Pulls in the container from upstream or rebuilds it if missing # Pulls in the container from upstream or rebuilds it if missing
fedora:36@container-prep: fedora:40@container-prep:
extends: extends:
- .fedora:36 - .fedora:40
- .fedora.packages - .fedora.packages
- .fdo.container-build@fedora - .fdo.container-build@fedora
stage: prep stage: prep
variables: variables:
GIT_STRATEGY: none GIT_STRATEGY: none
# Always rebuilds the container
fedora:36@container-forced-rebuild:
extends:
- fedora:36@container-prep
only:
- schedules
variables:
FDO_FORCE_REBUILD: 1
# Pulls in the container from upstream or rebuilds it if missing # Pulls in the container from upstream or rebuilds it if missing
fedora:37@container-prep: fedora:41@container-prep:
extends: extends:
- .fedora:37 - .fedora:41
- .fedora.packages - .fedora.packages
- .fdo.container-build@fedora - .fdo.container-build@fedora
stage: prep stage: prep
variables: variables:
GIT_STRATEGY: none GIT_STRATEGY: none
# Always rebuilds the container
fedora:37@container-forced-rebuild:
extends:
- fedora:37@container-prep
only:
- schedules
variables:
FDO_FORCE_REBUILD: 1
# Pulls in the container from upstream or rebuilds it if missing # Pulls in the container from upstream or rebuilds it if missing
ubuntu:22.04@container-prep: ubuntu:24.10@container-prep:
extends: extends:
- .ubuntu:22.04 - .ubuntu:24.10
- .ubuntu.packages - .ubuntu.packages
- .fdo.container-build@ubuntu - .fdo.container-build@ubuntu
stage: prep stage: prep
variables: variables:
GIT_STRATEGY: none GIT_STRATEGY: none
# Always rebuilds the container
ubuntu:22.04@container-forced-rebuild:
extends:
- ubuntu:22.04@container-prep
only:
- schedules
variables:
FDO_FORCE_REBUILD: 1
# Pulls in the container from upstream or rebuilds it if missing
ubuntu:22.10@container-prep:
extends:
- .ubuntu:22.10
- .ubuntu.packages
- .fdo.container-build@ubuntu
stage: prep
variables:
GIT_STRATEGY: none
# Always rebuilds the container
ubuntu:22.10@container-forced-rebuild:
extends:
- ubuntu:22.10@container-prep
only:
- schedules
variables:
FDO_FORCE_REBUILD: 1
# Pulls in the container from upstream or rebuilds it if missing # Pulls in the container from upstream or rebuilds it if missing
debian:stable@container-prep: debian:stable@container-prep:
@ -297,15 +239,6 @@ debian:stable@container-prep:
variables: variables:
GIT_STRATEGY: none GIT_STRATEGY: none
# Always rebuilds the container
debian:stable@container-forced-rebuild:
extends:
- debian:stable@container-prep
only:
- schedules
variables:
FDO_FORCE_REBUILD: 1
# Pulls in the container from upstream or rebuilds it if missing # Pulls in the container from upstream or rebuilds it if missing
debian:sid@container-prep: debian:sid@container-prep:
@ -317,15 +250,6 @@ debian:sid@container-prep:
variables: variables:
GIT_STRATEGY: none GIT_STRATEGY: none
# Always rebuilds the container
debian:sid@container-forced-rebuild:
extends:
- debian:sid@container-prep
only:
- schedules
variables:
FDO_FORCE_REBUILD: 1
# Pulls in the container from upstream or rebuilds it if missing # Pulls in the container from upstream or rebuilds it if missing
arch:rolling@container-prep: arch:rolling@container-prep:
@ -337,15 +261,6 @@ arch:rolling@container-prep:
variables: variables:
GIT_STRATEGY: none GIT_STRATEGY: none
# Always rebuilds the container
arch:rolling@container-forced-rebuild:
extends:
- arch:rolling@container-prep
only:
- schedules
variables:
FDO_FORCE_REBUILD: 1
# Pulls in the container from upstream or rebuilds it if missing # Pulls in the container from upstream or rebuilds it if missing
alpine:latest@container-prep: alpine:latest@container-prep:
@ -357,15 +272,6 @@ alpine:latest@container-prep:
variables: variables:
GIT_STRATEGY: none GIT_STRATEGY: none
# Always rebuilds the container
alpine:latest@container-forced-rebuild:
extends:
- alpine:latest@container-prep
only:
- schedules
variables:
FDO_FORCE_REBUILD: 1
################################################################# #################################################################
# # # #
@ -379,11 +285,9 @@ alpine:latest@container-forced-rebuild:
# the registry and will remove any that are not tagged with the provided # the registry and will remove any that are not tagged with the provided
# $container_image:$tag # $container_image:$tag
.container-clean: .container-clean:
extends:
- .fdo.ci-fairy
stage: container_clean stage: container_clean
image: golang:alpine
before_script:
- apk add python3 py-pip git
- pip3 install git+http://gitlab.freedesktop.org/freedesktop/ci-templates
script: script:
# Go to your Profile, Settings, Access Tokens # Go to your Profile, Settings, Access Tokens
# Create a personal token with 'api' scope, copy the value. # Create a personal token with 'api' scope, copy the value.
@ -398,33 +302,26 @@ alpine:latest@container-forced-rebuild:
only: only:
- schedules - schedules
### fedora 36 ### fedora 40
fedora:36@container-clean: fedora:40@container-clean:
extends: extends:
- .fedora:36 - .fedora:40
- .container-clean - .container-clean
needs: ["fedora:36@container-prep"] needs: ["fedora:40@container-prep"]
### fedora 37 ### fedora 41
fedora:37@container-clean: fedora:41@container-clean:
extends: extends:
- .fedora:37 - .fedora:41
- .container-clean - .container-clean
needs: ["fedora:37@container-prep"] needs: ["fedora:41@container-prep"]
### ubuntu 22.04 ### ubuntu 24.10
ubuntu:22.04@container-clean: ubuntu:24.10@container-clean:
extends: extends:
- .ubuntu:22.04 - .ubuntu:24.10
- .container-clean - .container-clean
needs: ["ubuntu:22.04@container-prep"] needs: ["ubuntu:24.10@container-prep"]
### ubuntu 22.10
ubuntu:22.10@container-clean:
extends:
- .ubuntu:22.10
- .container-clean
needs: ["ubuntu:22.10@container-prep"]
### debian stable ### debian stable
debian:stable@container-clean: debian:stable@container-clean:
@ -476,64 +373,49 @@ alpine:latest@container-clean:
dependencies: [] dependencies: []
fedora:36@autotools-build: fedora:40@autotools-build:
extends: extends:
- .fedora:36 - .fedora:40
- .autotools-build@template - .autotools-build@template
stage: autotools stage: autotools
needs: ['fedora:36@container-prep'] needs: ['fedora:40@container-prep']
fedora:36@meson-build: fedora:40@meson-build:
extends: extends:
- .fedora:36 - .fedora:40
- .meson-build@template - .meson-build@template
stage: meson stage: meson
needs: ['fedora:36@container-prep'] needs: ['fedora:40@container-prep']
fedora:37@autotools-build: fedora:41@autotools-build:
extends: extends:
- .fedora:37 - .fedora:41
- .autotools-build@template - .autotools-build@template
stage: autotools stage: autotools
needs: ['fedora:37@container-prep'] needs: ['fedora:41@container-prep']
fedora:37@meson-build: fedora:41@meson-build:
extends: extends:
- .fedora:37 - .fedora:41
- .meson-build@template - .meson-build@template
stage: meson stage: meson
needs: ['fedora:37@container-prep'] needs: ['fedora:41@container-prep']
ubuntu:22.04@autotools-build: ubuntu:24.10@autotools-build:
extends: extends:
- .ubuntu:22.04 - .ubuntu:24.10
- .autotools-build@template - .autotools-build@template
stage: autotools stage: autotools
needs: ['ubuntu:22.04@container-prep'] needs: ['ubuntu:24.10@container-prep']
ubuntu:22.04@meson-build: ubuntu:24.10@meson-build:
extends: extends:
- .ubuntu:22.04 - .ubuntu:24.10
- .meson-build@template - .meson-build@template
stage: meson stage: meson
needs: ['ubuntu:22.04@container-prep'] needs: ['ubuntu:24.10@container-prep']
ubuntu:22.10@autotools-build:
extends:
- .ubuntu:22.10
- .autotools-build@template
stage: autotools
needs: ['ubuntu:22.10@container-prep']
ubuntu:22.10@meson-build:
extends:
- .ubuntu:22.10
- .meson-build@template
stage: meson
needs: ['ubuntu:22.10@container-prep']
debian:stable@autotools-build: debian:stable@autotools-build:
@ -602,10 +484,10 @@ alpine:latest@meson-build:
# because they're supposed to fail equally on all # because they're supposed to fail equally on all
.fedora-custom-build@autotools-template: .fedora-custom-build@autotools-template:
extends: extends:
- .fedora:36 - .fedora:40
- .autotools-build@template - .autotools-build@template
stage: build stage: build
needs: ['fedora:36@container-prep'] needs: ['fedora:40@container-prep']
no-valgrind:autotools: no-valgrind:autotools:
extends: .fedora-custom-build@autotools-template extends: .fedora-custom-build@autotools-template
@ -644,10 +526,10 @@ enable-gcov:autotools:
.fedora-custom-build@meson-template: .fedora-custom-build@meson-template:
extends: extends:
- .fedora:36 - .fedora:40
- .meson-build@template - .meson-build@template
stage: build stage: build
needs: ['fedora:36@container-prep'] needs: ['fedora:40@container-prep']
no-valgrind:meson: no-valgrind:meson:
extends: .fedora-custom-build@meson-template extends: .fedora-custom-build@meson-template
@ -698,7 +580,7 @@ static-build:meson:
soname: soname:
extends: extends:
- .fedora:36 - .fedora:40
stage: build stage: build
script: script:
- ./autogen.sh --prefix=$PWD/prefix-autotools/ - ./autogen.sh --prefix=$PWD/prefix-autotools/
@ -707,7 +589,7 @@ soname:
- meson "$MESON_BUILDDIR" --prefix=$PWD/prefix-meson/ - meson "$MESON_BUILDDIR" --prefix=$PWD/prefix-meson/
- ninja -C "$MESON_BUILDDIR" install - ninja -C "$MESON_BUILDDIR" install
- ls -l $PWD/prefix-meson/lib64/libevdev.so.2.3.0 - ls -l $PWD/prefix-meson/lib64/libevdev.so.2.3.0
needs: ['fedora:36@container-prep'] needs: ['fedora:40@container-prep']
################################################################# #################################################################
# # # #
@ -732,8 +614,7 @@ soname:
- kvm - kvm
variables: variables:
MESON_BUILDDIR: build_dir MESON_BUILDDIR: build_dir
B2C_KERNEL: https://gitlab.freedesktop.org/api/v4/projects/libevdev%2Fhid-tools/packages/generic/kernel-x86_64/v6.1/bzImage B2C_KERNEL: https://gitlab.freedesktop.org/api/v4/projects/libevdev%2Fhid-tools/packages/generic/kernel-x86_64/v6.5/bzImage
B2C_VERSION: v0.9.9
B2C_IMAGE: $FDO_DISTRIBUTION_IMAGE B2C_IMAGE: $FDO_DISTRIBUTION_IMAGE
B2C_COMMAND: .gitlab-ci/start-in-systemd.sh B2C_COMMAND: .gitlab-ci/start-in-systemd.sh
script: script:
@ -741,7 +622,7 @@ soname:
- .gitlab-ci/meson-build.sh --skip-test - .gitlab-ci/meson-build.sh --skip-test
# pull b2c # pull b2c
- curl -L -o /app/boot2container https://gitlab.freedesktop.org/mupuf/boot2container/-/raw/v0.9.9/vm2c.py - curl -L -o /app/boot2container https://gitlab.freedesktop.org/gfx-ci/boot2container/-/raw/2ff65156ba67fa8a0c309a4fc16c5df1a88a3844/vm2c.py
- chmod +x /app/boot2container - chmod +x /app/boot2container
# runs the test suite only # runs the test suite only
@ -751,10 +632,10 @@ qemu:meson:
stage: VM stage: VM
extends: extends:
- .fdo.distribution-image@fedora - .fdo.distribution-image@fedora
- .fedora:37 - .fedora:41
- .build-in-b2c@template - .build-in-b2c@template
needs: needs:
- "fedora:37@container-prep" - "fedora:41@container-prep"
qemu:meson:valgrind: qemu:meson:valgrind:
extends: extends:
@ -765,7 +646,7 @@ qemu:meson:valgrind:
meson-from-tarball: meson-from-tarball:
extends: extends:
- .fedora:37 - .fedora:41
stage: tarballs stage: tarballs
script: script:
- export INSTALLDIR="$PWD/_inst" - export INSTALLDIR="$PWD/_inst"
@ -783,11 +664,11 @@ meson-from-tarball:
- ninja -C "$MESON_BUILDDIR" install - ninja -C "$MESON_BUILDDIR" install
- popd > /dev/null - popd > /dev/null
- ls -lR $INSTALLDIR - ls -lR $INSTALLDIR
needs: ['fedora:37@container-prep'] needs: ['fedora:41@container-prep']
autotools-from-tarball: autotools-from-tarball:
extends: extends:
- .fedora:37 - .fedora:41
stage: tarballs stage: tarballs
script: script:
- export INSTALLDIR="$PWD/_inst" - export INSTALLDIR="$PWD/_inst"
@ -808,4 +689,4 @@ autotools-from-tarball:
variables: variables:
LIBEVDEV_SKIP_ROOT_TESTS: 1 LIBEVDEV_SKIP_ROOT_TESTS: 1
needs: ['fedora:37@container-prep'] needs: ['fedora:41@container-prep']

View file

@ -6,16 +6,16 @@
# # # #
######################################## ########################################
.templates_sha: &template_sha c1e465762df9d4208a03ed4df6cae15006579838 # see https://docs.gitlab.com/ee/ci/yaml/#includefile .templates_sha: &template_sha e195d80f35b45cc73668be3767b923fd76c70ed5 # see https://docs.gitlab.com/ee/ci/yaml/#includefile
include: include:
- project: 'freedesktop/ci-templates' - project: 'freedesktop/ci-templates'
ref: *template_sha ref: *template_sha
file: file:
{% for distribution in distributions|map(attribute='name')|unique()|sort() %} {% for distribution in distributions|map(attribute='name')|unique()|sort() %}
# {{ distribution.capitalize() }} container builder template
- '/templates/{{distribution}}.yml' - '/templates/{{distribution}}.yml'
{% endfor %} {% endfor %}
- '/templates/ci-fairy.yml'
stages: stages:
- prep # rebuild the container images if there is a change - prep # rebuild the container images if there is a change
@ -29,8 +29,10 @@ stages:
workflow: workflow:
rules: rules:
- if: $CI_PIPELINE_SOURCE == 'merge_request_event' - if: $CI_PIPELINE_SOURCE == "merge_request_event"
- if: $CI_PIPELINE_SOURCE == 'push' - if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS
when: never
- if: $CI_COMMIT_BRANCH
variables: variables:
# The upstrem repository we will check for images # The upstrem repository we will check for images
@ -96,14 +98,11 @@ variables:
# $SRCDIR/.gitlab-ci/generate-gitlab-ci.py # $SRCDIR/.gitlab-ci/generate-gitlab-ci.py
# #
check-ci-script: check-ci-script:
image: golang:alpine extends:
- .fdo.ci-fairy
stage: prep stage: prep
before_script:
- apk add python3 py-pip git
- pip3 install git+http://gitlab.freedesktop.org/freedesktop/ci-templates
script: script:
- ci-fairy generate-template - ci-fairy generate-template --verify && exit 0 || true
- git diff --exit-code && exit 0 || true
- echo "Committed gitlab-ci.yml differs from generated gitlab-ci.yml. Please verify" - echo "Committed gitlab-ci.yml differs from generated gitlab-ci.yml. Please verify"
- exit 1 - exit 1
@ -112,13 +111,13 @@ check-ci-script:
# #
check-commit: check-commit:
image: golang:alpine extends:
- .fdo.ci-fairy
stage: prep stage: prep
before_script:
- apk add python3 py-pip git
- pip3 install git+http://gitlab.freedesktop.org/freedesktop/ci-templates
script: script:
- ci-fairy check-commits --signed-off-by --junit-xml=results.xml - ci-fairy -vv check-commits --junit-xml=results.xml && exit 0 || true
- echo "Error checking the commit message format. Please verify"
- exit 1
except: except:
- master@libevdev/libevdev - master@libevdev/libevdev
variables: variables:
@ -132,11 +131,9 @@ check-commit:
# #
check-merge-request: check-merge-request:
image: golang:alpine extends:
- .fdo.ci-fairy
stage: merge-check stage: merge-check
before_script:
- apk add python3 py-pip git
- pip3 install git+http://gitlab.freedesktop.org/freedesktop/ci-templates
script: script:
- ci-fairy check-merge-request --require-allow-collaboration --junit-xml=results.xml - ci-fairy check-merge-request --require-allow-collaboration --junit-xml=results.xml
artifacts: artifacts:
@ -144,6 +141,8 @@ check-merge-request:
reports: reports:
junit: results.xml junit: results.xml
allow_failure: true allow_failure: true
rules:
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
{% for distro in distributions %} {% for distro in distributions %}
@ -166,15 +165,6 @@ check-merge-request:
variables: variables:
GIT_STRATEGY: none GIT_STRATEGY: none
# Always rebuilds the container
{{ distro.name }}:{{ version }}@container-forced-rebuild:
extends:
- {{ distro.name }}:{{ version }}@container-prep
only:
- schedules
variables:
FDO_FORCE_REBUILD: 1
{% endfor %} {% endfor %}
{% endfor %} {% endfor %}
@ -190,11 +180,9 @@ check-merge-request:
# the registry and will remove any that are not tagged with the provided # the registry and will remove any that are not tagged with the provided
# $container_image:$tag # $container_image:$tag
.container-clean: .container-clean:
extends:
- .fdo.ci-fairy
stage: container_clean stage: container_clean
image: golang:alpine
before_script:
- apk add python3 py-pip git
- pip3 install git+http://gitlab.freedesktop.org/freedesktop/ci-templates
script: script:
# Go to your Profile, Settings, Access Tokens # Go to your Profile, Settings, Access Tokens
# Create a personal token with 'api' scope, copy the value. # Create a personal token with 'api' scope, copy the value.
@ -415,7 +403,6 @@ soname:
variables: variables:
MESON_BUILDDIR: build_dir MESON_BUILDDIR: build_dir
B2C_KERNEL: {{ b2c.kernel }} B2C_KERNEL: {{ b2c.kernel }}
B2C_VERSION: {{ b2c.version }}
B2C_IMAGE: $FDO_DISTRIBUTION_IMAGE B2C_IMAGE: $FDO_DISTRIBUTION_IMAGE
B2C_COMMAND: .gitlab-ci/start-in-systemd.sh B2C_COMMAND: .gitlab-ci/start-in-systemd.sh
script: script:
@ -423,7 +410,7 @@ soname:
- .gitlab-ci/meson-build.sh --skip-test - .gitlab-ci/meson-build.sh --skip-test
# pull b2c # pull b2c
- curl -L -o /app/boot2container https://gitlab.freedesktop.org/mupuf/boot2container/-/raw/{{b2c.version}}/vm2c.py - curl -L -o /app/boot2container https://gitlab.freedesktop.org/gfx-ci/boot2container/-/raw/{{b2c.version}}/vm2c.py
- chmod +x /app/boot2container - chmod +x /app/boot2container
# runs the test suite only # runs the test suite only

View file

@ -3,7 +3,7 @@
# #
# We're happy to rebuild all containers when one changes. # We're happy to rebuild all containers when one changes.
.default_tag: &default_tag '2023-02-15.0' .default_tag: &default_tag '2024-11-25.0'
distributions: distributions:
- name: fedora - name: fedora
@ -12,8 +12,8 @@ distributions:
# only one distro for qemu tests # only one distro for qemu tests
use_for_qemu_tests: true use_for_qemu_tests: true
versions: versions:
- '36' - '40'
- '37' - '41'
packages: packages:
- git - git
- gcc - gcc
@ -42,8 +42,7 @@ distributions:
- name: ubuntu - name: ubuntu
tag: *default_tag tag: *default_tag
versions: versions:
- '22.04' - '24.10'
- '22.10'
packages: packages:
- git - git
- gcc - gcc
@ -87,7 +86,7 @@ distributions:
- 'rolling' - 'rolling'
packages: packages:
- git - git
- gcc - gc
- meson - meson
- automake - automake
- autoconf - autoconf
@ -122,5 +121,5 @@ distributions:
- linux-headers - linux-headers
b2c: b2c:
version: v0.9.9 version: 2ff65156ba67fa8a0c309a4fc16c5df1a88a3844
kernel: https://gitlab.freedesktop.org/api/v4/projects/libevdev%2Fhid-tools/packages/generic/kernel-x86_64/v6.1/bzImage kernel: https://gitlab.freedesktop.org/api/v4/projects/libevdev%2Fhid-tools/packages/generic/kernel-x86_64/v6.5/bzImage

View file

@ -1,5 +1,8 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# #
# This script is sourced from here:
# https://gitlab.freedesktop.org/whot/meson-helper
#
# SPDX-License-Identifier: MIT # SPDX-License-Identifier: MIT
set -x set -x

View file

@ -7,7 +7,7 @@ AC_PREREQ([2.62])
# change meson version too # change meson version too
AC_INIT([libevdev], AC_INIT([libevdev],
[1.13.1], [1.13.6],
[https://gitlab.freedesktop.org/libevdev/libevdev/issues/], [https://gitlab.freedesktop.org/libevdev/libevdev/issues/],
[libevdev], [libevdev],
[http://freedesktop.org/wiki/Software/libevdev/]) [http://freedesktop.org/wiki/Software/libevdev/])

View file

@ -27,6 +27,7 @@
#define INPUT_PROP_TOPBUTTONPAD 0x04 /* softbuttons at top of pad */ #define INPUT_PROP_TOPBUTTONPAD 0x04 /* softbuttons at top of pad */
#define INPUT_PROP_POINTING_STICK 0x05 /* is a pointing stick */ #define INPUT_PROP_POINTING_STICK 0x05 /* is a pointing stick */
#define INPUT_PROP_ACCELEROMETER 0x06 /* has accelerometer */ #define INPUT_PROP_ACCELEROMETER 0x06 /* has accelerometer */
#define INPUT_PROP_PRESSUREPAD 0x07 /* pressure triggers clicks */
#define INPUT_PROP_MAX 0x1f #define INPUT_PROP_MAX 0x1f
#define INPUT_PROP_CNT (INPUT_PROP_MAX + 1) #define INPUT_PROP_CNT (INPUT_PROP_MAX + 1)
@ -519,6 +520,7 @@
#define KEY_NOTIFICATION_CENTER 0x1bc /* Show/hide the notification center */ #define KEY_NOTIFICATION_CENTER 0x1bc /* Show/hide the notification center */
#define KEY_PICKUP_PHONE 0x1bd /* Answer incoming call */ #define KEY_PICKUP_PHONE 0x1bd /* Answer incoming call */
#define KEY_HANGUP_PHONE 0x1be /* Decline incoming call */ #define KEY_HANGUP_PHONE 0x1be /* Decline incoming call */
#define KEY_LINK_PHONE 0x1bf /* AL Phone Syncing */
#define KEY_DEL_EOL 0x1c0 #define KEY_DEL_EOL 0x1c0
#define KEY_DEL_EOS 0x1c1 #define KEY_DEL_EOS 0x1c1
@ -600,8 +602,14 @@
#define BTN_DPAD_LEFT 0x222 #define BTN_DPAD_LEFT 0x222
#define BTN_DPAD_RIGHT 0x223 #define BTN_DPAD_RIGHT 0x223
#define BTN_GRIPL 0x224
#define BTN_GRIPR 0x225
#define BTN_GRIPL2 0x226
#define BTN_GRIPR2 0x227
#define KEY_ALS_TOGGLE 0x230 /* Ambient light sensor */ #define KEY_ALS_TOGGLE 0x230 /* Ambient light sensor */
#define KEY_ROTATE_LOCK_TOGGLE 0x231 /* Display rotation lock */ #define KEY_ROTATE_LOCK_TOGGLE 0x231 /* Display rotation lock */
#define KEY_REFRESH_RATE_TOGGLE 0x232 /* Display refresh rate toggle */
#define KEY_BUTTONCONFIG 0x240 /* AL Button Configuration */ #define KEY_BUTTONCONFIG 0x240 /* AL Button Configuration */
#define KEY_TASKMANAGER 0x241 /* AL Task/Project Manager */ #define KEY_TASKMANAGER 0x241 /* AL Task/Project Manager */
@ -617,10 +625,24 @@
#define KEY_CAMERA_ACCESS_ENABLE 0x24b /* Enables programmatic access to camera devices. (HUTRR72) */ #define KEY_CAMERA_ACCESS_ENABLE 0x24b /* Enables programmatic access to camera devices. (HUTRR72) */
#define KEY_CAMERA_ACCESS_DISABLE 0x24c /* Disables programmatic access to camera devices. (HUTRR72) */ #define KEY_CAMERA_ACCESS_DISABLE 0x24c /* Disables programmatic access to camera devices. (HUTRR72) */
#define KEY_CAMERA_ACCESS_TOGGLE 0x24d /* Toggles the current state of the camera access control. (HUTRR72) */ #define KEY_CAMERA_ACCESS_TOGGLE 0x24d /* Toggles the current state of the camera access control. (HUTRR72) */
#define KEY_ACCESSIBILITY 0x24e /* Toggles the system bound accessibility UI/command (HUTRR116) */
#define KEY_DO_NOT_DISTURB 0x24f /* Toggles the system-wide "Do Not Disturb" control (HUTRR94)*/
#define KEY_BRIGHTNESS_MIN 0x250 /* Set Brightness to Minimum */ #define KEY_BRIGHTNESS_MIN 0x250 /* Set Brightness to Minimum */
#define KEY_BRIGHTNESS_MAX 0x251 /* Set Brightness to Maximum */ #define KEY_BRIGHTNESS_MAX 0x251 /* Set Brightness to Maximum */
/*
* Keycodes for hotkeys toggling the electronic privacy screen found on some
* laptops on/off. Note when the embedded-controller turns on/off the eprivacy
* screen itself then the state should be reported through drm connecter props:
* https://www.kernel.org/doc/html/latest/gpu/drm-kms.html#standard-connector-properties
* Except when implementing the drm connecter properties API is not possible
* because e.g. the firmware does not allow querying the presence and/or status
* of the eprivacy screen at boot.
*/
#define KEY_EPRIVACY_SCREEN_ON 0x252
#define KEY_EPRIVACY_SCREEN_OFF 0x253
#define KEY_KBDINPUTASSIST_PREV 0x260 #define KEY_KBDINPUTASSIST_PREV 0x260
#define KEY_KBDINPUTASSIST_NEXT 0x261 #define KEY_KBDINPUTASSIST_NEXT 0x261
#define KEY_KBDINPUTASSIST_PREVGROUP 0x262 #define KEY_KBDINPUTASSIST_PREVGROUP 0x262
@ -761,6 +783,9 @@
#define KEY_KBD_LCD_MENU4 0x2bb #define KEY_KBD_LCD_MENU4 0x2bb
#define KEY_KBD_LCD_MENU5 0x2bc #define KEY_KBD_LCD_MENU5 0x2bc
/* Performance Boost key (Alienware)/G-Mode key (Dell) */
#define KEY_PERFORMANCE 0x2bd
#define BTN_TRIGGER_HAPPY 0x2c0 #define BTN_TRIGGER_HAPPY 0x2c0
#define BTN_TRIGGER_HAPPY1 0x2c0 #define BTN_TRIGGER_HAPPY1 0x2c0
#define BTN_TRIGGER_HAPPY2 0x2c1 #define BTN_TRIGGER_HAPPY2 0x2c1
@ -921,7 +946,8 @@
#define SW_MUTE_DEVICE 0x0e /* set = device disabled */ #define SW_MUTE_DEVICE 0x0e /* set = device disabled */
#define SW_PEN_INSERTED 0x0f /* set = pen inserted */ #define SW_PEN_INSERTED 0x0f /* set = pen inserted */
#define SW_MACHINE_COVER 0x10 /* set = cover closed */ #define SW_MACHINE_COVER 0x10 /* set = cover closed */
#define SW_MAX 0x10 #define SW_USB_INSERT 0x11 /* set = USB audio device connected */
#define SW_MAX 0x11
#define SW_CNT (SW_MAX+1) #define SW_CNT (SW_MAX+1)
/* /*

View file

@ -27,6 +27,7 @@
#define INPUT_PROP_TOPBUTTONPAD 0x04 /* softbuttons at top of pad */ #define INPUT_PROP_TOPBUTTONPAD 0x04 /* softbuttons at top of pad */
#define INPUT_PROP_POINTING_STICK 0x05 /* is a pointing stick */ #define INPUT_PROP_POINTING_STICK 0x05 /* is a pointing stick */
#define INPUT_PROP_ACCELEROMETER 0x06 /* has accelerometer */ #define INPUT_PROP_ACCELEROMETER 0x06 /* has accelerometer */
#define INPUT_PROP_PRESSUREPAD 0x07 /* pressure triggers clicks */
#define INPUT_PROP_MAX 0x1f #define INPUT_PROP_MAX 0x1f
#define INPUT_PROP_CNT (INPUT_PROP_MAX + 1) #define INPUT_PROP_CNT (INPUT_PROP_MAX + 1)
@ -519,6 +520,7 @@
#define KEY_NOTIFICATION_CENTER 0x1bc /* Show/hide the notification center */ #define KEY_NOTIFICATION_CENTER 0x1bc /* Show/hide the notification center */
#define KEY_PICKUP_PHONE 0x1bd /* Answer incoming call */ #define KEY_PICKUP_PHONE 0x1bd /* Answer incoming call */
#define KEY_HANGUP_PHONE 0x1be /* Decline incoming call */ #define KEY_HANGUP_PHONE 0x1be /* Decline incoming call */
#define KEY_LINK_PHONE 0x1bf /* AL Phone Syncing */
#define KEY_DEL_EOL 0x1c0 #define KEY_DEL_EOL 0x1c0
#define KEY_DEL_EOS 0x1c1 #define KEY_DEL_EOS 0x1c1
@ -600,8 +602,14 @@
#define BTN_DPAD_LEFT 0x222 #define BTN_DPAD_LEFT 0x222
#define BTN_DPAD_RIGHT 0x223 #define BTN_DPAD_RIGHT 0x223
#define BTN_GRIPL 0x224
#define BTN_GRIPR 0x225
#define BTN_GRIPL2 0x226
#define BTN_GRIPR2 0x227
#define KEY_ALS_TOGGLE 0x230 /* Ambient light sensor */ #define KEY_ALS_TOGGLE 0x230 /* Ambient light sensor */
#define KEY_ROTATE_LOCK_TOGGLE 0x231 /* Display rotation lock */ #define KEY_ROTATE_LOCK_TOGGLE 0x231 /* Display rotation lock */
#define KEY_REFRESH_RATE_TOGGLE 0x232 /* Display refresh rate toggle */
#define KEY_BUTTONCONFIG 0x240 /* AL Button Configuration */ #define KEY_BUTTONCONFIG 0x240 /* AL Button Configuration */
#define KEY_TASKMANAGER 0x241 /* AL Task/Project Manager */ #define KEY_TASKMANAGER 0x241 /* AL Task/Project Manager */
@ -617,10 +625,24 @@
#define KEY_CAMERA_ACCESS_ENABLE 0x24b /* Enables programmatic access to camera devices. (HUTRR72) */ #define KEY_CAMERA_ACCESS_ENABLE 0x24b /* Enables programmatic access to camera devices. (HUTRR72) */
#define KEY_CAMERA_ACCESS_DISABLE 0x24c /* Disables programmatic access to camera devices. (HUTRR72) */ #define KEY_CAMERA_ACCESS_DISABLE 0x24c /* Disables programmatic access to camera devices. (HUTRR72) */
#define KEY_CAMERA_ACCESS_TOGGLE 0x24d /* Toggles the current state of the camera access control. (HUTRR72) */ #define KEY_CAMERA_ACCESS_TOGGLE 0x24d /* Toggles the current state of the camera access control. (HUTRR72) */
#define KEY_ACCESSIBILITY 0x24e /* Toggles the system bound accessibility UI/command (HUTRR116) */
#define KEY_DO_NOT_DISTURB 0x24f /* Toggles the system-wide "Do Not Disturb" control (HUTRR94)*/
#define KEY_BRIGHTNESS_MIN 0x250 /* Set Brightness to Minimum */ #define KEY_BRIGHTNESS_MIN 0x250 /* Set Brightness to Minimum */
#define KEY_BRIGHTNESS_MAX 0x251 /* Set Brightness to Maximum */ #define KEY_BRIGHTNESS_MAX 0x251 /* Set Brightness to Maximum */
/*
* Keycodes for hotkeys toggling the electronic privacy screen found on some
* laptops on/off. Note when the embedded-controller turns on/off the eprivacy
* screen itself then the state should be reported through drm connecter props:
* https://www.kernel.org/doc/html/latest/gpu/drm-kms.html#standard-connector-properties
* Except when implementing the drm connecter properties API is not possible
* because e.g. the firmware does not allow querying the presence and/or status
* of the eprivacy screen at boot.
*/
#define KEY_EPRIVACY_SCREEN_ON 0x252
#define KEY_EPRIVACY_SCREEN_OFF 0x253
#define KEY_KBDINPUTASSIST_PREV 0x260 #define KEY_KBDINPUTASSIST_PREV 0x260
#define KEY_KBDINPUTASSIST_NEXT 0x261 #define KEY_KBDINPUTASSIST_NEXT 0x261
#define KEY_KBDINPUTASSIST_PREVGROUP 0x262 #define KEY_KBDINPUTASSIST_PREVGROUP 0x262
@ -761,6 +783,9 @@
#define KEY_KBD_LCD_MENU4 0x2bb #define KEY_KBD_LCD_MENU4 0x2bb
#define KEY_KBD_LCD_MENU5 0x2bc #define KEY_KBD_LCD_MENU5 0x2bc
/* Performance Boost key (Alienware)/G-Mode key (Dell) */
#define KEY_PERFORMANCE 0x2bd
#define BTN_TRIGGER_HAPPY 0x2c0 #define BTN_TRIGGER_HAPPY 0x2c0
#define BTN_TRIGGER_HAPPY1 0x2c0 #define BTN_TRIGGER_HAPPY1 0x2c0
#define BTN_TRIGGER_HAPPY2 0x2c1 #define BTN_TRIGGER_HAPPY2 0x2c1
@ -921,7 +946,8 @@
#define SW_MUTE_DEVICE 0x0e /* set = device disabled */ #define SW_MUTE_DEVICE 0x0e /* set = device disabled */
#define SW_PEN_INSERTED 0x0f /* set = pen inserted */ #define SW_PEN_INSERTED 0x0f /* set = pen inserted */
#define SW_MACHINE_COVER 0x10 /* set = cover closed */ #define SW_MACHINE_COVER 0x10 /* set = cover closed */
#define SW_MAX 0x10 #define SW_USB_INSERT 0x11 /* set = USB audio device connected */
#define SW_MAX 0x11
#define SW_CNT (SW_MAX+1) #define SW_CNT (SW_MAX+1)
/* /*

View file

@ -6,14 +6,16 @@
* under the terms of the GNU General Public License version 2 as published by * under the terms of the GNU General Public License version 2 as published by
* the Free Software Foundation. * the Free Software Foundation.
*/ */
#ifndef _INPUT_H #ifndef _UAPI_INPUT_H
#define _INPUT_H #define _UAPI_INPUT_H
#ifndef __KERNEL__
#include <sys/time.h> #include <sys/time.h>
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include <sys/types.h> #include <sys/types.h>
#include <linux/types.h> #include <linux/types.h>
#endif
#include "input-event-codes.h" #include "input-event-codes.h"
@ -273,6 +275,7 @@ struct input_mask {
#define BUS_CEC 0x1E #define BUS_CEC 0x1E
#define BUS_INTEL_ISHTP 0x1F #define BUS_INTEL_ISHTP 0x1F
#define BUS_AMD_SFH 0x20 #define BUS_AMD_SFH 0x20
#define BUS_SDW 0x21
/* /*
* MT_TOOL types * MT_TOOL types
@ -426,6 +429,24 @@ struct ff_rumble_effect {
__u16 weak_magnitude; __u16 weak_magnitude;
}; };
/**
* struct ff_haptic_effect
* @hid_usage: hid_usage according to Haptics page (WAVEFORM_CLICK, etc.)
* @vendor_id: the waveform vendor ID if hid_usage is in the vendor-defined range
* @vendor_waveform_page: the vendor waveform page if hid_usage is in the vendor-defined range
* @intensity: strength of the effect as percentage
* @repeat_count: number of times to retrigger effect
* @retrigger_period: time before effect is retriggered (in ms)
*/
struct ff_haptic_effect {
__u16 hid_usage;
__u16 vendor_id;
__u8 vendor_waveform_page;
__u16 intensity;
__u16 repeat_count;
__u16 retrigger_period;
};
/** /**
* struct ff_effect - defines force feedback effect * struct ff_effect - defines force feedback effect
* @type: type of the effect (FF_CONSTANT, FF_PERIODIC, FF_RAMP, FF_SPRING, * @type: type of the effect (FF_CONSTANT, FF_PERIODIC, FF_RAMP, FF_SPRING,
@ -462,6 +483,7 @@ struct ff_effect {
struct ff_periodic_effect periodic; struct ff_periodic_effect periodic;
struct ff_condition_effect condition[2]; /* One for each axis */ struct ff_condition_effect condition[2]; /* One for each axis */
struct ff_rumble_effect rumble; struct ff_rumble_effect rumble;
struct ff_haptic_effect haptic;
} u; } u;
}; };
@ -469,6 +491,7 @@ struct ff_effect {
* Force feedback effect types * Force feedback effect types
*/ */
#define FF_HAPTIC 0x4f
#define FF_RUMBLE 0x50 #define FF_RUMBLE 0x50
#define FF_PERIODIC 0x51 #define FF_PERIODIC 0x51
#define FF_CONSTANT 0x52 #define FF_CONSTANT 0x52
@ -478,7 +501,7 @@ struct ff_effect {
#define FF_INERTIA 0x56 #define FF_INERTIA 0x56
#define FF_RAMP 0x57 #define FF_RAMP 0x57
#define FF_EFFECT_MIN FF_RUMBLE #define FF_EFFECT_MIN FF_HAPTIC
#define FF_EFFECT_MAX FF_RAMP #define FF_EFFECT_MAX FF_RAMP
/* /*
@ -513,4 +536,4 @@ struct ff_effect {
#define FF_MAX 0x7f #define FF_MAX 0x7f
#define FF_CNT (FF_MAX+1) #define FF_CNT (FF_MAX+1)
#endif /* _INPUT_H */ #endif /* _UAPI_INPUT_H */

View file

@ -42,19 +42,19 @@ startswith(const char *str, size_t len, const char *prefix, size_t plen)
static inline int static inline int
bit_is_set(const unsigned long *array, int bit) bit_is_set(const unsigned long *array, int bit)
{ {
return !!(array[bit / LONG_BITS] & (1LL << (bit % LONG_BITS))); return !!(array[bit / LONG_BITS] & (1ULL << (bit % LONG_BITS)));
} }
static inline void static inline void
set_bit(unsigned long *array, int bit) set_bit(unsigned long *array, int bit)
{ {
array[bit / LONG_BITS] |= (1LL << (bit % LONG_BITS)); array[bit / LONG_BITS] |= (1ULL << (bit % LONG_BITS));
} }
static inline void static inline void
clear_bit(unsigned long *array, int bit) clear_bit(unsigned long *array, int bit)
{ {
array[bit / LONG_BITS] &= ~(1LL << (bit % LONG_BITS)); array[bit / LONG_BITS] &= ~(1ULL << (bit % LONG_BITS));
} }
static inline void static inline void

View file

@ -805,23 +805,34 @@ push_mt_sync_events(struct libevdev *dev,
int rc; int rc;
for (int slot = 0; slot < dev->num_slots; slot++) { for (int slot = 0; slot < dev->num_slots; slot++) {
/* stopped touches were already terminated in bool have_slot_event = false;
* terminate_slots */
if (changes[slot].state == TOUCH_STOPPED ||
!bit_is_set(changes[slot].axes, ABS_MT_SLOT))
continue;
queue_push_event(dev, EV_ABS, ABS_MT_SLOT, slot); if (!bit_is_set(changes[slot].axes, ABS_MT_SLOT))
last_reported_slot = slot; continue;
for (int axis = ABS_MT_MIN; axis <= ABS_MT_MAX; axis++) { for (int axis = ABS_MT_MIN; axis <= ABS_MT_MAX; axis++) {
if (axis == ABS_MT_SLOT || if (axis == ABS_MT_SLOT ||
!libevdev_has_event_code(dev, EV_ABS, axis)) !libevdev_has_event_code(dev, EV_ABS, axis))
continue; continue;
if (bit_is_set(changes[slot].axes, axis)) if (bit_is_set(changes[slot].axes, axis)) {
/* We already sent the tracking id -1 in
* terminate_slots so don't do that again. There
* may be other axes like ABS_MT_TOOL_TYPE that
* need to be synced despite no touch being active */
if (axis == ABS_MT_TRACKING_ID &&
*slot_value(dev, slot, axis) == -1)
continue;
if (!have_slot_event) {
queue_push_event(dev, EV_ABS, ABS_MT_SLOT, slot);
last_reported_slot = slot;
have_slot_event = true;
}
queue_push_event(dev, EV_ABS, axis, queue_push_event(dev, EV_ABS, axis,
*slot_value(dev, slot, axis)); *slot_value(dev, slot, axis));
}
} }
} }

View file

@ -500,11 +500,11 @@ extern "C" {
* <dd>supported, see libevdev_enable_event_code()</dd> * <dd>supported, see libevdev_enable_event_code()</dd>
* <dt>EVIOCGKEYCODE:</dt> * <dt>EVIOCGKEYCODE:</dt>
* <dd>currently not supported</dd> * <dd>currently not supported</dd>
* <dt>EVIOCGKEYCODE:</dt>
* <dd>currently not supported</dd>
* <dt>EVIOCSKEYCODE:</dt> * <dt>EVIOCSKEYCODE:</dt>
* <dd>currently not supported</dd> * <dd>currently not supported</dd>
* <dt>EVIOCSKEYCODE:</dt> * <dt>EVIOCGKEYCODE_V2:</dt>
* <dd>currently not supported</dd>
* <dt>EVIOCSKEYCODE_V2:</dt>
* <dd>currently not supported</dd> * <dd>currently not supported</dd>
* <dt>EVIOCGNAME:</dt> * <dt>EVIOCGNAME:</dt>
* <dd>supported, see libevdev_get_name()</dd> * <dd>supported, see libevdev_get_name()</dd>
@ -544,6 +544,10 @@ extern "C" {
* <dt>EVIOCREVOKE:</dt> * <dt>EVIOCREVOKE:</dt>
* <dd>currently not supported, see * <dd>currently not supported, see
* http://lists.freedesktop.org/archives/input-tools/2014-January/000688.html</dd> * http://lists.freedesktop.org/archives/input-tools/2014-January/000688.html</dd>
* <dt>EVIOCGMASK:</dt>
* <dd>currently not supported</dd>
* <dt>EVIOCSMASK:</dt>
* <dd>currently not supported</dd>
* </dl> * </dl>
* *
*/ */
@ -1559,8 +1563,7 @@ int libevdev_get_event_value(const struct libevdev *dev, unsigned int type, unsi
* *
* @return 0 on success, or -1 on failure. * @return 0 on success, or -1 on failure.
* @retval -1 * @retval -1
* - the device does not have the event type or * - the device does not have the event type or code enabled, or
* - code enabled, or the code is outside the, or
* - the code is outside the allowed limits for the given type, or * - the code is outside the allowed limits for the given type, or
* - the type cannot be set, or * - the type cannot be set, or
* - the value is not permitted for the given code. * - the value is not permitted for the given code.

View file

@ -1,5 +1,5 @@
project('libevdev', 'c', project('libevdev', 'c',
version: '1.13.1', # change autotools version too version: '1.13.6', # change autotools version too
license: 'MIT/Expat', license: 'MIT/Expat',
default_options: [ 'c_std=gnu99', 'warning_level=2' ], default_options: [ 'c_std=gnu99', 'warning_level=2' ],
meson_version: '>= 0.56.0') meson_version: '>= 0.56.0')
@ -55,8 +55,7 @@ event_names_h = configure_file(input: 'libevdev/libevdev.h',
install_headers('libevdev/libevdev.h', install_headers('libevdev/libevdev.h',
'libevdev/libevdev-uinput.h', 'libevdev/libevdev-uinput.h',
subdir: 'libevdev-1.0/libevdev') subdir: 'libevdev-1.0/libevdev')
src_libevdev = [ src_libevdev = [event_names_h] + files(
event_names_h,
'libevdev/libevdev.h', 'libevdev/libevdev.h',
'libevdev/libevdev-int.h', 'libevdev/libevdev-int.h',
'libevdev/libevdev-util.h', 'libevdev/libevdev-util.h',
@ -67,7 +66,7 @@ src_libevdev = [
'libevdev/libevdev-names.c', 'libevdev/libevdev-names.c',
'include/linux/input.h', 'include/linux/input.h',
'include/linux/uinput.h', 'include/linux/uinput.h',
] )
mapfile = dir_src / 'libevdev.sym' mapfile = dir_src / 'libevdev.sym'
version_flag = '-Wl,--version-script,@0@'.format(mapfile) version_flag = '-Wl,--version-script,@0@'.format(mapfile)
@ -81,7 +80,9 @@ lib_libevdev = library('evdev',
install: true install: true
) )
dep_libevdev = declare_dependency(link_with: lib_libevdev) inc_libevdev = include_directories('.')
dep_libevdev = declare_dependency(link_with: lib_libevdev,
include_directories: [inc_libevdev])
pkgconfig.generate( pkgconfig.generate(
filebase: 'libevdev', filebase: 'libevdev',
@ -101,34 +102,36 @@ install_man(manpage)
# tools # tools
executable('libevdev-events', if not get_option('tools').disabled()
sources: ['tools/libevdev-events.c'], executable('libevdev-events',
include_directories: [includes_include], sources: ['tools/libevdev-events.c'],
dependencies: dep_libevdev, include_directories: [includes_include],
install: false) dependencies: dep_libevdev,
executable('libevdev-list-codes', install: false)
sources: ['tools/libevdev-list-codes.c'], executable('libevdev-list-codes',
include_directories: [includes_include], sources: ['tools/libevdev-list-codes.c'],
dependencies: dep_libevdev, include_directories: [includes_include],
install: false) dependencies: dep_libevdev,
executable('touchpad-edge-detector', install: false)
sources: ['tools/touchpad-edge-detector.c'], executable('touchpad-edge-detector',
include_directories: [includes_include], sources: ['tools/touchpad-edge-detector.c'],
dependencies: [dep_libevdev, dep_lm], include_directories: [includes_include],
install: true) dependencies: [dep_libevdev, dep_lm],
executable('mouse-dpi-tool', install: true)
sources: ['tools/mouse-dpi-tool.c'], executable('mouse-dpi-tool',
include_directories: [includes_include], sources: ['tools/mouse-dpi-tool.c'],
dependencies: dep_libevdev, include_directories: [includes_include],
install: true) dependencies: dep_libevdev,
executable('libevdev-tweak-device', install: true)
sources: ['tools/libevdev-tweak-device.c'], executable('libevdev-tweak-device',
include_directories: [includes_include], sources: ['tools/libevdev-tweak-device.c'],
dependencies: dep_libevdev, include_directories: [includes_include],
install: true) dependencies: dep_libevdev,
install_man('tools/libevdev-tweak-device.1', install: true)
'tools/touchpad-edge-detector.1', install_man('tools/libevdev-tweak-device.1',
'tools/mouse-dpi-tool.1') 'tools/touchpad-edge-detector.1',
'tools/mouse-dpi-tool.1')
endif
# tests # tests
dep_check = dependency('check', version: '>= 0.9.9', dep_check = dependency('check', version: '>= 0.9.9',
@ -230,8 +233,6 @@ endif
doxygen = find_program('doxygen', required: get_option('documentation')) doxygen = find_program('doxygen', required: get_option('documentation'))
if doxygen.found() if doxygen.found()
doxygen = find_program('doxygen')
src_doxygen = files( src_doxygen = files(
# source files # source files
dir_src / 'libevdev.h', dir_src / 'libevdev.h',

View file

@ -2,6 +2,10 @@ option('tests',
type: 'feature', type: 'feature',
value: 'enabled', value: 'enabled',
description: 'Build the tests') description: 'Build the tests')
option('tools',
type: 'feature',
value: 'enabled',
description: 'Build the tools')
option('documentation', option('documentation',
type: 'feature', type: 'feature',
value: 'enabled', value: 'enabled',

View file

@ -158,7 +158,7 @@ START_TEST(test_code_sw_name)
ck_assert_str_eq(libevdev_event_code_get_name(EV_SW, SW_RFKILL_ALL), "SW_RFKILL_ALL"); ck_assert_str_eq(libevdev_event_code_get_name(EV_SW, SW_RFKILL_ALL), "SW_RFKILL_ALL");
ck_assert_str_eq(libevdev_event_code_get_name(EV_SW, SW_LINEIN_INSERT), "SW_LINEIN_INSERT"); ck_assert_str_eq(libevdev_event_code_get_name(EV_SW, SW_LINEIN_INSERT), "SW_LINEIN_INSERT");
ck_assert_str_eq(libevdev_event_code_get_name(EV_SW, SW_PEN_INSERTED), "SW_PEN_INSERTED"); ck_assert_str_eq(libevdev_event_code_get_name(EV_SW, SW_PEN_INSERTED), "SW_PEN_INSERTED");
ck_assert_str_eq(libevdev_event_code_get_name(EV_SW, SW_MAX), "SW_MACHINE_COVER"); ck_assert_str_eq(libevdev_event_code_get_name(EV_SW, SW_MAX), "SW_USB_INSERT");
} }
END_TEST END_TEST

View file

@ -617,12 +617,12 @@ START_TEST(test_syn_delta_sw)
EV_SYN, SYN_DROPPED, EV_SYN, SYN_DROPPED,
EV_SW, SW_HEADPHONE_INSERT, EV_SW, SW_HEADPHONE_INSERT,
EV_SW, SW_MICROPHONE_INSERT, EV_SW, SW_MICROPHONE_INSERT,
EV_SW, SW_MAX, EV_SW, SW_MACHINE_COVER, /* Replace with SW_MAX once runners are on 6.16 */
-1); -1);
uinput_device_event(uidev, EV_SW, SW_HEADPHONE_INSERT, 1); uinput_device_event(uidev, EV_SW, SW_HEADPHONE_INSERT, 1);
uinput_device_event(uidev, EV_SW, SW_MICROPHONE_INSERT, 1); uinput_device_event(uidev, EV_SW, SW_MICROPHONE_INSERT, 1);
uinput_device_event(uidev, EV_SW, SW_MAX, 1); uinput_device_event(uidev, EV_SW, SW_MACHINE_COVER, 1);
uinput_device_event(uidev, EV_SYN, SYN_REPORT, 0); uinput_device_event(uidev, EV_SYN, SYN_REPORT, 0);
rc = libevdev_next_event(dev, LIBEVDEV_READ_FLAG_FORCE_SYNC, &ev); rc = libevdev_next_event(dev, LIBEVDEV_READ_FLAG_FORCE_SYNC, &ev);
ck_assert_int_eq(rc, LIBEVDEV_READ_STATUS_SYNC); ck_assert_int_eq(rc, LIBEVDEV_READ_STATUS_SYNC);
@ -635,7 +635,7 @@ START_TEST(test_syn_delta_sw)
assert_event(&ev, EV_SW, SW_MICROPHONE_INSERT, 1); assert_event(&ev, EV_SW, SW_MICROPHONE_INSERT, 1);
rc = libevdev_next_event(dev, LIBEVDEV_READ_FLAG_SYNC, &ev); rc = libevdev_next_event(dev, LIBEVDEV_READ_FLAG_SYNC, &ev);
ck_assert_int_eq(rc, LIBEVDEV_READ_STATUS_SYNC); ck_assert_int_eq(rc, LIBEVDEV_READ_STATUS_SYNC);
assert_event(&ev, EV_SW, SW_MAX, 1); assert_event(&ev, EV_SW, SW_MACHINE_COVER, 1);
rc = libevdev_next_event(dev, LIBEVDEV_READ_FLAG_SYNC, &ev); rc = libevdev_next_event(dev, LIBEVDEV_READ_FLAG_SYNC, &ev);
ck_assert_int_eq(rc, LIBEVDEV_READ_STATUS_SYNC); ck_assert_int_eq(rc, LIBEVDEV_READ_STATUS_SYNC);
assert_event(&ev, EV_SYN, SYN_REPORT, 0); assert_event(&ev, EV_SYN, SYN_REPORT, 0);
@ -644,7 +644,7 @@ START_TEST(test_syn_delta_sw)
ck_assert_int_eq(libevdev_get_event_value(dev, EV_SW, SW_HEADPHONE_INSERT), 1); ck_assert_int_eq(libevdev_get_event_value(dev, EV_SW, SW_HEADPHONE_INSERT), 1);
ck_assert_int_eq(libevdev_get_event_value(dev, EV_SW, SW_MICROPHONE_INSERT), 1); ck_assert_int_eq(libevdev_get_event_value(dev, EV_SW, SW_MICROPHONE_INSERT), 1);
ck_assert_int_eq(libevdev_get_event_value(dev, EV_SW, SW_MAX), 1); ck_assert_int_eq(libevdev_get_event_value(dev, EV_SW, SW_MACHINE_COVER), 1);
uinput_device_free(uidev); uinput_device_free(uidev);
libevdev_free(dev); libevdev_free(dev);
@ -1008,6 +1008,206 @@ START_TEST(test_syn_delta_tracking_ids_btntool)
} }
END_TEST END_TEST
START_TEST(test_syn_delta_mt_tool_type)
{
struct uinput_device* uidev;
struct libevdev *dev;
int rc;
struct input_event ev;
int i;
const int num_slots = 15;
int slot = -1;
unsigned long terminated[NLONGS(num_slots)];
struct input_absinfo abs[7] = {
{ .value = ABS_X, .maximum = 1000 },
{ .value = ABS_Y, .maximum = 1000 },
{ .value = ABS_MT_POSITION_X, .maximum = 1000 },
{ .value = ABS_MT_POSITION_Y, .maximum = 1000 },
{ .value = ABS_MT_TOOL_TYPE, .maximum = MT_TOOL_PALM },
{ .value = ABS_MT_SLOT, .maximum = num_slots },
{ .value = ABS_MT_TRACKING_ID, .minimum = -1, .maximum = 0xff },
};
test_create_abs_device(&uidev, &dev,
ARRAY_LENGTH(abs), abs,
EV_SYN, SYN_REPORT,
-1);
for (i = num_slots; i >= 0; i--) {
int tool_type = MT_TOOL_FINGER;
switch (i) {
case 0:
case 1:
case 2:
case 3:
tool_type = MT_TOOL_FINGER;
break;
case 4:
case 5:
case 6:
case 7:
tool_type = MT_TOOL_PALM;
break;
}
uinput_device_event_multiple(uidev,
EV_ABS, ABS_MT_SLOT, i,
EV_ABS, ABS_MT_TRACKING_ID, i,
EV_ABS, ABS_X, 100 + i,
EV_ABS, ABS_Y, 500 + i,
EV_ABS, ABS_MT_POSITION_X, 100 + i,
EV_ABS, ABS_MT_POSITION_Y, 500 + i,
EV_ABS, ABS_MT_TOOL_TYPE, tool_type,
EV_SYN, SYN_REPORT, 0,
-1, -1);
do {
rc = libevdev_next_event(dev, LIBEVDEV_READ_FLAG_NORMAL, &ev);
ck_assert_int_ne(rc, LIBEVDEV_READ_STATUS_SYNC);
} while (rc >= 0);
}
/* we have a bunch of touches now, and libevdev knows it. Change all
* touches */
for (i = num_slots; i >= 0; i--) {
uinput_device_event(uidev, EV_ABS, ABS_MT_SLOT, i);
switch (i) {
/* Slot 0 is a finger and stays a finger */
case 0:
/* Slot 4 is a palm and stays a palm */
case 4:
uinput_device_event_multiple(uidev,
EV_ABS, ABS_X, 200 + i,
EV_ABS, ABS_Y, 700 + i,
EV_ABS, ABS_MT_POSITION_X, 200 + i,
EV_ABS, ABS_MT_POSITION_Y, 700 + i,
-1, -1);
break;
/* Slot 1 is a finger and changes active touch to palm */
case 1:
uinput_device_event(uidev, EV_ABS, ABS_MT_TOOL_TYPE, MT_TOOL_PALM);
break;
/* Slot 2 is a finger and terminates */
case 2:
/* Slot 6 is a palm and terminates */
case 6:
uinput_device_event(uidev, EV_ABS, ABS_MT_TRACKING_ID, -1);
break;
/* Slot 3 is a finger and restarts as finger */
case 3:
/* Slot 5 is a palm and restarts as finger */
case 5:
uinput_device_event_multiple(uidev,
EV_ABS, ABS_MT_TRACKING_ID, num_slots + i,
EV_ABS, ABS_X, 200 + i,
EV_ABS, ABS_Y, 700 + i,
EV_ABS, ABS_MT_POSITION_X, 200 + i,
EV_ABS, ABS_MT_POSITION_Y, 700 + i,
EV_ABS, ABS_MT_TOOL_TYPE, MT_TOOL_FINGER,
-1, -1);
break;
/* Slot 7 is a palm and restarts and terminates again as finger */
case 7:
uinput_device_event(uidev, EV_ABS, ABS_MT_TRACKING_ID, -1);
uinput_device_event(uidev, EV_SYN, SYN_REPORT, 0);
uinput_device_event_multiple(uidev,
EV_ABS, ABS_MT_TRACKING_ID, num_slots + i,
EV_ABS, ABS_X, 200 + i,
EV_ABS, ABS_Y, 700 + i,
EV_ABS, ABS_MT_POSITION_X, 200 + i,
EV_ABS, ABS_MT_POSITION_Y, 700 + i,
EV_ABS, ABS_MT_TOOL_TYPE, MT_TOOL_FINGER,
-1, -1);
uinput_device_event(uidev, EV_ABS, ABS_MT_TRACKING_ID, -1);
uinput_device_event(uidev, EV_SYN, SYN_REPORT, 0);
break;
}
uinput_device_event(uidev, EV_SYN, SYN_REPORT, 0);
}
/* Force sync */
rc = libevdev_next_event(dev, LIBEVDEV_READ_FLAG_FORCE_SYNC, &ev);
ck_assert_int_eq(rc, LIBEVDEV_READ_STATUS_SYNC);
/* now check for the right tracking IDs */
memset(terminated, 0, sizeof(terminated));
slot = -1;
while ((rc = libevdev_next_event(dev, LIBEVDEV_READ_FLAG_SYNC, &ev)) != -EAGAIN) {
if (libevdev_event_is_code(&ev, EV_SYN, SYN_REPORT))
continue;
if (libevdev_event_is_code(&ev, EV_ABS, ABS_MT_SLOT)) {
slot = ev.value;
continue;
}
if (libevdev_event_is_code(&ev, EV_ABS, ABS_X) ||
libevdev_event_is_code(&ev, EV_ABS, ABS_Y))
continue;
ck_assert_int_ne(slot, -1);
if (libevdev_event_is_code(&ev, EV_ABS, ABS_MT_TRACKING_ID)) {
switch (slot) {
case 0:
case 1:
case 4:
ck_abort_msg("No ABS_MT_TRACKING_ID expected for this slot");
break;
case 2:
case 6:
case 7:
ck_assert_int_eq(ev.value, -1);
break;
case 3:
case 5:
if (!bit_is_set(terminated, slot)) {
ck_assert_int_eq(ev.value, -1);
set_bit(terminated, slot);
} else {
ck_assert_int_eq(ev.value, num_slots + slot);
}
break;
}
continue;
}
if (libevdev_event_is_code(&ev, EV_ABS, ABS_MT_TOOL_TYPE)) {
switch (slot) {
case 0:
case 2:
case 3:
case 4:
case 6:
ck_abort_msg("No ABS_MT_TOOL_TYPE expected for this slot");
break;
case 1:
ck_assert_int_eq(ev.value, MT_TOOL_PALM);
break;
case 5:
case 7:
ck_assert_int_eq(ev.value, MT_TOOL_FINGER);
break;
}
continue;
}
switch(ev.code) {
case ABS_MT_POSITION_X:
ck_assert_int_eq(ev.value, 200 + slot);
break;
case ABS_MT_POSITION_Y:
ck_assert_int_eq(ev.value, 700 + slot);
break;
default:
ck_abort();
}
}
uinput_device_free(uidev);
libevdev_free(dev);
}
END_TEST
START_TEST(test_syn_delta_late_sync) START_TEST(test_syn_delta_late_sync)
{ {
struct uinput_device* uidev; struct uinput_device* uidev;
@ -2060,6 +2260,7 @@ TEST_SUITE_ROOT_PRIVILEGES(libevdev_events)
add_test(s, test_syn_delta_late_sync); add_test(s, test_syn_delta_late_sync);
add_test(s, test_syn_delta_tracking_ids); add_test(s, test_syn_delta_tracking_ids);
add_test(s, test_syn_delta_tracking_ids_btntool); add_test(s, test_syn_delta_tracking_ids_btntool);
add_test(s, test_syn_delta_mt_tool_type);
add_test(s, test_skipped_sync); add_test(s, test_skipped_sync);
add_test(s, test_incomplete_sync); add_test(s, test_incomplete_sync);

View file

@ -2,6 +2,36 @@
set -e set -e
make tag="$1"
rsync --delete -avz doc/html/ freedesktop.org:/srv/www.freedesktop.org/www/software/libevdev/doc/latest case $tag in
-h|--help)
echo "Usage: $0 <tag>"
echo "Builds the libevdev documentation and rsyncs it to the freedesktop.org server."
echo ""
echo "Options:"
echo " tag ... the tag to build (default: master)"
exit 0
;;
1*)
# Helper so we can run it with the numerical tag only, tags
# are all prefixed with libevdev
tag="libevdev-$tag"
;;
**)
;;
esac
tag=${tag:-master}
dir=$(mktemp -d --tmpdir='' libevdev-doc.XXX)
git clone --depth 1 --branch "$tag" https://gitlab.freedesktop.org/libevdev/libevdev.git "$dir"
pushd $dir
builddir=_doc_build
rm -rf "$builddir"
meson setup "$builddir"
ninja -C "$builddir"
# Strip libevdev- prefix from the tag and replace master with latest, whichever applies
htmldir=${tag/#libevdev-/}
htmldir=${htmldir/master/latest}
rsync --delete -avz "$builddir/html/" freedesktop.org:/srv/www.freedesktop.org/www/software/libevdev/doc/${htmldir}
popd