mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-06-10 04:28:23 +02:00
Compare commits
21 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
faf6f27dfe | ||
|
|
7819c23eaf | ||
|
|
af041ea9ed | ||
|
|
042c5e6fd9 | ||
|
|
7b2e8df143 | ||
|
|
7522cb9bae | ||
|
|
f20f4c54a2 | ||
|
|
edc25c071a | ||
|
|
421fe9457e | ||
|
|
448e18a7d6 | ||
|
|
7a9b757d7d | ||
|
|
baf1ceca88 | ||
|
|
83d89dde5d | ||
|
|
58fe6f387f | ||
|
|
b5b2d92ead | ||
|
|
e3f4afccac | ||
|
|
f2bf1d9aef | ||
|
|
11063aa28b | ||
|
|
5bf134e77b | ||
|
|
b14894e794 | ||
|
|
41d0caf333 |
20 changed files with 448 additions and 40 deletions
36
doc/user/dot/libinput-contexts.gv
Normal file
36
doc/user/dot/libinput-contexts.gv
Normal file
|
|
@ -0,0 +1,36 @@
|
||||||
|
digraph stack
|
||||||
|
{
|
||||||
|
compound=true;
|
||||||
|
splines=line;
|
||||||
|
rankdir="LR";
|
||||||
|
node [
|
||||||
|
shape="box";
|
||||||
|
]
|
||||||
|
|
||||||
|
subgraph cluster_2 {
|
||||||
|
label="Kernel";
|
||||||
|
event0 [label="/dev/input/event0"];
|
||||||
|
event1 [label="/dev/input/event1"];
|
||||||
|
}
|
||||||
|
|
||||||
|
subgraph cluster_0 {
|
||||||
|
label="Compositor process";
|
||||||
|
libinput [label="libinput context 1"];
|
||||||
|
}
|
||||||
|
|
||||||
|
subgraph cluster_1 {
|
||||||
|
label="libinput debug-events";
|
||||||
|
libinput2 [label="libinput context 2"];
|
||||||
|
}
|
||||||
|
|
||||||
|
stdout;
|
||||||
|
|
||||||
|
client [label="Wayland client"];
|
||||||
|
|
||||||
|
event0:e -> libinput:w;
|
||||||
|
event1:e -> libinput:w;
|
||||||
|
event0:e -> libinput2:w;
|
||||||
|
event1:e -> libinput2:w;
|
||||||
|
libinput -> client [ltail=cluster_0 label="Wayland protocol"];
|
||||||
|
libinput2 -> stdout [ltail=cluster_1];
|
||||||
|
}
|
||||||
|
|
@ -348,10 +348,14 @@ compositor. This indicates a misunderstanding of how libinput works:
|
||||||
libinput is a library that converts kernel events into libinput events, much
|
libinput is a library that converts kernel events into libinput events, much
|
||||||
like ``sed`` reads data in, modifies it, and provides it to stdout.
|
like ``sed`` reads data in, modifies it, and provides it to stdout.
|
||||||
|
|
||||||
If ``sed`` is used by a shell-script, that script has full control over how
|
.. graphviz:: libinput-contexts.gv
|
||||||
``sed`` processes data. In this analogy, ``sed`` is libinput and the
|
|
||||||
shell script is the compositor. It is not possible to write a program
|
A libinput context is private to the process and cannot be modified from the
|
||||||
to modify the behavior of the ``sed`` instance used inside that shell script
|
outside. To use the ``sed`` analogy again: if ``sed`` is used by a
|
||||||
|
shell-script, that script has full control over how ``sed`` processes data. In
|
||||||
|
this analogy, ``sed`` is libinput and the shell script is the compositor. It is
|
||||||
|
not possible to write a program to modify the behavior of the ``sed`` instance
|
||||||
|
used inside that shell script.
|
||||||
|
|
||||||
Writing a program that uses libinput is akin to writing a new script that
|
Writing a program that uses libinput is akin to writing a new script that
|
||||||
invoke ``sed``. It will not have any effect on the original ``sed`` instance.
|
invoke ``sed``. It will not have any effect on the original ``sed`` instance.
|
||||||
|
|
@ -360,6 +364,14 @@ The only way to modify libinput's behavior is to use the configuration options
|
||||||
exposed by the respective compositor. Those affect the libinput context inside
|
exposed by the respective compositor. Those affect the libinput context inside
|
||||||
the compositor and thus have an effect on the input device behavior.
|
the compositor and thus have an effect on the input device behavior.
|
||||||
|
|
||||||
|
.. _faq_debug_events_not_showing_configuration:
|
||||||
|
|
||||||
|
------------------------------------------------------------------------------
|
||||||
|
Why doesn't libinput debug-events show my configuration
|
||||||
|
------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
See :ref:`faq_separate_contexts`.
|
||||||
|
|
||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
Can I configure scroll speed?
|
Can I configure scroll speed?
|
||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -95,6 +95,7 @@ src_rst = files(
|
||||||
# dot drawings
|
# dot drawings
|
||||||
'dot/seats-sketch.gv',
|
'dot/seats-sketch.gv',
|
||||||
'dot/seats-sketch-libinput.gv',
|
'dot/seats-sketch-libinput.gv',
|
||||||
|
'dot/libinput-contexts.gv',
|
||||||
'dot/libinput-stack-wayland.gv',
|
'dot/libinput-stack-wayland.gv',
|
||||||
'dot/libinput-stack-xorg.gv',
|
'dot/libinput-stack-xorg.gv',
|
||||||
'dot/libinput-stack-gnome.gv',
|
'dot/libinput-stack-gnome.gv',
|
||||||
|
|
|
||||||
|
|
@ -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)
|
||||||
|
|
@ -278,7 +279,8 @@
|
||||||
#define KEY_PAUSECD 201
|
#define KEY_PAUSECD 201
|
||||||
#define KEY_PROG3 202
|
#define KEY_PROG3 202
|
||||||
#define KEY_PROG4 203
|
#define KEY_PROG4 203
|
||||||
#define KEY_DASHBOARD 204 /* AL Dashboard */
|
#define KEY_ALL_APPLICATIONS 204 /* AC Desktop Show All Applications */
|
||||||
|
#define KEY_DASHBOARD KEY_ALL_APPLICATIONS
|
||||||
#define KEY_SUSPEND 205
|
#define KEY_SUSPEND 205
|
||||||
#define KEY_CLOSE 206 /* AC Close */
|
#define KEY_CLOSE 206 /* AC Close */
|
||||||
#define KEY_PLAY 207
|
#define KEY_PLAY 207
|
||||||
|
|
@ -515,6 +517,10 @@
|
||||||
#define KEY_10CHANNELSUP 0x1b8 /* 10 channels up (10+) */
|
#define KEY_10CHANNELSUP 0x1b8 /* 10 channels up (10+) */
|
||||||
#define KEY_10CHANNELSDOWN 0x1b9 /* 10 channels down (10-) */
|
#define KEY_10CHANNELSDOWN 0x1b9 /* 10 channels down (10-) */
|
||||||
#define KEY_IMAGES 0x1ba /* AL Image Browser */
|
#define KEY_IMAGES 0x1ba /* AL Image Browser */
|
||||||
|
#define KEY_NOTIFICATION_CENTER 0x1bc /* Show/hide the notification center */
|
||||||
|
#define KEY_PICKUP_PHONE 0x1bd /* Answer 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
|
||||||
|
|
@ -542,6 +548,7 @@
|
||||||
#define KEY_FN_F 0x1e2
|
#define KEY_FN_F 0x1e2
|
||||||
#define KEY_FN_S 0x1e3
|
#define KEY_FN_S 0x1e3
|
||||||
#define KEY_FN_B 0x1e4
|
#define KEY_FN_B 0x1e4
|
||||||
|
#define KEY_FN_RIGHT_SHIFT 0x1e5
|
||||||
|
|
||||||
#define KEY_BRL_DOT1 0x1f1
|
#define KEY_BRL_DOT1 0x1f1
|
||||||
#define KEY_BRL_DOT2 0x1f2
|
#define KEY_BRL_DOT2 0x1f2
|
||||||
|
|
@ -595,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 */
|
||||||
|
|
@ -607,10 +620,29 @@
|
||||||
#define KEY_VOICECOMMAND 0x246 /* Listening Voice Command */
|
#define KEY_VOICECOMMAND 0x246 /* Listening Voice Command */
|
||||||
#define KEY_ASSISTANT 0x247 /* AL Context-aware desktop assistant */
|
#define KEY_ASSISTANT 0x247 /* AL Context-aware desktop assistant */
|
||||||
#define KEY_KBD_LAYOUT_NEXT 0x248 /* AC Next Keyboard Layout Select */
|
#define KEY_KBD_LAYOUT_NEXT 0x248 /* AC Next Keyboard Layout Select */
|
||||||
|
#define KEY_EMOJI_PICKER 0x249 /* Show/hide emoji picker (HUTRR101) */
|
||||||
|
#define KEY_DICTATE 0x24a /* Start or Stop Voice Dictation Session (HUTRR99) */
|
||||||
|
#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_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
|
||||||
|
|
@ -655,6 +687,27 @@
|
||||||
/* Select an area of screen to be copied */
|
/* Select an area of screen to be copied */
|
||||||
#define KEY_SELECTIVE_SCREENSHOT 0x27a
|
#define KEY_SELECTIVE_SCREENSHOT 0x27a
|
||||||
|
|
||||||
|
/* Move the focus to the next or previous user controllable element within a UI container */
|
||||||
|
#define KEY_NEXT_ELEMENT 0x27b
|
||||||
|
#define KEY_PREVIOUS_ELEMENT 0x27c
|
||||||
|
|
||||||
|
/* Toggle Autopilot engagement */
|
||||||
|
#define KEY_AUTOPILOT_ENGAGE_TOGGLE 0x27d
|
||||||
|
|
||||||
|
/* Shortcut Keys */
|
||||||
|
#define KEY_MARK_WAYPOINT 0x27e
|
||||||
|
#define KEY_SOS 0x27f
|
||||||
|
#define KEY_NAV_CHART 0x280
|
||||||
|
#define KEY_FISHING_CHART 0x281
|
||||||
|
#define KEY_SINGLE_RANGE_RADAR 0x282
|
||||||
|
#define KEY_DUAL_RANGE_RADAR 0x283
|
||||||
|
#define KEY_RADAR_OVERLAY 0x284
|
||||||
|
#define KEY_TRADITIONAL_SONAR 0x285
|
||||||
|
#define KEY_CLEARVU_SONAR 0x286
|
||||||
|
#define KEY_SIDEVU_SONAR 0x287
|
||||||
|
#define KEY_NAV_INFO 0x288
|
||||||
|
#define KEY_BRIGHTNESS_MENU 0x289
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Some keyboards have keys which do not have a defined meaning, these keys
|
* Some keyboards have keys which do not have a defined meaning, these keys
|
||||||
* are intended to be programmed / bound to macros by the user. For most
|
* are intended to be programmed / bound to macros by the user. For most
|
||||||
|
|
@ -730,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
|
||||||
|
|
@ -834,6 +890,7 @@
|
||||||
#define ABS_TOOL_WIDTH 0x1c
|
#define ABS_TOOL_WIDTH 0x1c
|
||||||
|
|
||||||
#define ABS_VOLUME 0x20
|
#define ABS_VOLUME 0x20
|
||||||
|
#define ABS_PROFILE 0x21
|
||||||
|
|
||||||
#define ABS_MISC 0x28
|
#define ABS_MISC 0x28
|
||||||
|
|
||||||
|
|
@ -889,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)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
||||||
|
|
@ -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)
|
||||||
|
|
@ -278,7 +279,8 @@
|
||||||
#define KEY_PAUSECD 201
|
#define KEY_PAUSECD 201
|
||||||
#define KEY_PROG3 202
|
#define KEY_PROG3 202
|
||||||
#define KEY_PROG4 203
|
#define KEY_PROG4 203
|
||||||
#define KEY_DASHBOARD 204 /* AL Dashboard */
|
#define KEY_ALL_APPLICATIONS 204 /* AC Desktop Show All Applications */
|
||||||
|
#define KEY_DASHBOARD KEY_ALL_APPLICATIONS
|
||||||
#define KEY_SUSPEND 205
|
#define KEY_SUSPEND 205
|
||||||
#define KEY_CLOSE 206 /* AC Close */
|
#define KEY_CLOSE 206 /* AC Close */
|
||||||
#define KEY_PLAY 207
|
#define KEY_PLAY 207
|
||||||
|
|
@ -515,6 +517,10 @@
|
||||||
#define KEY_10CHANNELSUP 0x1b8 /* 10 channels up (10+) */
|
#define KEY_10CHANNELSUP 0x1b8 /* 10 channels up (10+) */
|
||||||
#define KEY_10CHANNELSDOWN 0x1b9 /* 10 channels down (10-) */
|
#define KEY_10CHANNELSDOWN 0x1b9 /* 10 channels down (10-) */
|
||||||
#define KEY_IMAGES 0x1ba /* AL Image Browser */
|
#define KEY_IMAGES 0x1ba /* AL Image Browser */
|
||||||
|
#define KEY_NOTIFICATION_CENTER 0x1bc /* Show/hide the notification center */
|
||||||
|
#define KEY_PICKUP_PHONE 0x1bd /* Answer 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
|
||||||
|
|
@ -542,6 +548,7 @@
|
||||||
#define KEY_FN_F 0x1e2
|
#define KEY_FN_F 0x1e2
|
||||||
#define KEY_FN_S 0x1e3
|
#define KEY_FN_S 0x1e3
|
||||||
#define KEY_FN_B 0x1e4
|
#define KEY_FN_B 0x1e4
|
||||||
|
#define KEY_FN_RIGHT_SHIFT 0x1e5
|
||||||
|
|
||||||
#define KEY_BRL_DOT1 0x1f1
|
#define KEY_BRL_DOT1 0x1f1
|
||||||
#define KEY_BRL_DOT2 0x1f2
|
#define KEY_BRL_DOT2 0x1f2
|
||||||
|
|
@ -595,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 */
|
||||||
|
|
@ -607,10 +620,29 @@
|
||||||
#define KEY_VOICECOMMAND 0x246 /* Listening Voice Command */
|
#define KEY_VOICECOMMAND 0x246 /* Listening Voice Command */
|
||||||
#define KEY_ASSISTANT 0x247 /* AL Context-aware desktop assistant */
|
#define KEY_ASSISTANT 0x247 /* AL Context-aware desktop assistant */
|
||||||
#define KEY_KBD_LAYOUT_NEXT 0x248 /* AC Next Keyboard Layout Select */
|
#define KEY_KBD_LAYOUT_NEXT 0x248 /* AC Next Keyboard Layout Select */
|
||||||
|
#define KEY_EMOJI_PICKER 0x249 /* Show/hide emoji picker (HUTRR101) */
|
||||||
|
#define KEY_DICTATE 0x24a /* Start or Stop Voice Dictation Session (HUTRR99) */
|
||||||
|
#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_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
|
||||||
|
|
@ -655,6 +687,27 @@
|
||||||
/* Select an area of screen to be copied */
|
/* Select an area of screen to be copied */
|
||||||
#define KEY_SELECTIVE_SCREENSHOT 0x27a
|
#define KEY_SELECTIVE_SCREENSHOT 0x27a
|
||||||
|
|
||||||
|
/* Move the focus to the next or previous user controllable element within a UI container */
|
||||||
|
#define KEY_NEXT_ELEMENT 0x27b
|
||||||
|
#define KEY_PREVIOUS_ELEMENT 0x27c
|
||||||
|
|
||||||
|
/* Toggle Autopilot engagement */
|
||||||
|
#define KEY_AUTOPILOT_ENGAGE_TOGGLE 0x27d
|
||||||
|
|
||||||
|
/* Shortcut Keys */
|
||||||
|
#define KEY_MARK_WAYPOINT 0x27e
|
||||||
|
#define KEY_SOS 0x27f
|
||||||
|
#define KEY_NAV_CHART 0x280
|
||||||
|
#define KEY_FISHING_CHART 0x281
|
||||||
|
#define KEY_SINGLE_RANGE_RADAR 0x282
|
||||||
|
#define KEY_DUAL_RANGE_RADAR 0x283
|
||||||
|
#define KEY_RADAR_OVERLAY 0x284
|
||||||
|
#define KEY_TRADITIONAL_SONAR 0x285
|
||||||
|
#define KEY_CLEARVU_SONAR 0x286
|
||||||
|
#define KEY_SIDEVU_SONAR 0x287
|
||||||
|
#define KEY_NAV_INFO 0x288
|
||||||
|
#define KEY_BRIGHTNESS_MENU 0x289
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Some keyboards have keys which do not have a defined meaning, these keys
|
* Some keyboards have keys which do not have a defined meaning, these keys
|
||||||
* are intended to be programmed / bound to macros by the user. For most
|
* are intended to be programmed / bound to macros by the user. For most
|
||||||
|
|
@ -730,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
|
||||||
|
|
@ -834,6 +890,7 @@
|
||||||
#define ABS_TOOL_WIDTH 0x1c
|
#define ABS_TOOL_WIDTH 0x1c
|
||||||
|
|
||||||
#define ABS_VOLUME 0x20
|
#define ABS_VOLUME 0x20
|
||||||
|
#define ABS_PROFILE 0x21
|
||||||
|
|
||||||
#define ABS_MISC 0x28
|
#define ABS_MISC 0x28
|
||||||
|
|
||||||
|
|
@ -889,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)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
project('libinput', 'c',
|
project('libinput', 'c',
|
||||||
version : '1.30.0',
|
version : '1.30.3',
|
||||||
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.64.0')
|
meson_version : '>= 0.64.0')
|
||||||
|
|
|
||||||
10
quirks/30-vendor-goodix.quirks
Normal file
10
quirks/30-vendor-goodix.quirks
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
# Do not edit this file, it will be overwritten on update
|
||||||
|
|
||||||
|
# "GXTP5100 Touchpad": pressure touchpad mostly used in Lenovo laptops.
|
||||||
|
# Match vid and pid as it can have other names.
|
||||||
|
[Lenovo Haptic Touchpad (Goodix)]
|
||||||
|
MatchBus=i2c
|
||||||
|
MatchVendor=0x27C6
|
||||||
|
MatchProduct=0x01E8
|
||||||
|
MatchUdevType=touchpad
|
||||||
|
ModelPressurePad=1
|
||||||
|
|
@ -323,3 +323,10 @@ MatchBus=usb
|
||||||
MatchVendor=0x1532
|
MatchVendor=0x1532
|
||||||
MatchProduct=0x02C6
|
MatchProduct=0x02C6
|
||||||
AttrKeyboardIntegration=internal
|
AttrKeyboardIntegration=internal
|
||||||
|
|
||||||
|
[RazerBlade182025 Keyboard]
|
||||||
|
MatchUdevType=keyboard
|
||||||
|
MatchBus=usb
|
||||||
|
MatchVendor=0x1532
|
||||||
|
MatchProduct=0x02C7
|
||||||
|
AttrKeyboardIntegration=internal
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,14 @@ MatchVendor=0x0002
|
||||||
MatchProduct=0x0007
|
MatchProduct=0x0007
|
||||||
ModelSynapticsSerialTouchpad=1
|
ModelSynapticsSerialTouchpad=1
|
||||||
|
|
||||||
|
# "SYNA3580:00 06CB:CFD2 Touchpad": pressure touchpad mostly used in HP laptops.
|
||||||
|
[Synaptics 06CB:CFD2 Touchpad]
|
||||||
|
MatchBus=i2c
|
||||||
|
MatchVendor=0x06CB
|
||||||
|
MatchProduct=0xCFD2
|
||||||
|
MatchUdevType=touchpad
|
||||||
|
ModelPressurePad=1
|
||||||
|
|
||||||
# SYNA3602:00 0911:5288 touchpad, clickpad pretending it has a right button.
|
# SYNA3602:00 0911:5288 touchpad, clickpad pretending it has a right button.
|
||||||
# Integrated into several systems, including
|
# Integrated into several systems, including
|
||||||
# Purism Librem 14v1
|
# Purism Librem 14v1
|
||||||
|
|
|
||||||
|
|
@ -3,3 +3,11 @@ MatchUdevType=touchpad
|
||||||
MatchName=ETPS/2 Elantech Touchpad
|
MatchName=ETPS/2 Elantech Touchpad
|
||||||
MatchDMIModalias=dmi:*svnGIGABYTE:pnAERO15-XA*
|
MatchDMIModalias=dmi:*svnGIGABYTE:pnAERO15-XA*
|
||||||
AttrPalmSizeThreshold=800
|
AttrPalmSizeThreshold=800
|
||||||
|
|
||||||
|
[Gigabyte Aorus15BKF keyboard]
|
||||||
|
MatchUdevType=keyboard
|
||||||
|
MatchBus=usb
|
||||||
|
MatchVendor=0x0414
|
||||||
|
MatchProduct=0x7A44
|
||||||
|
MatchDMIModalias=dmi:*:svnGIGABYTE:pnAORUS15BKF:*
|
||||||
|
AttrKeyboardIntegration=internal
|
||||||
|
|
|
||||||
|
|
@ -423,3 +423,12 @@ MatchName=*GXTP5100*
|
||||||
MatchDMIModalias=dmi:*svnLENOVO:*pvrThinkBook*G7+IAH*:*
|
MatchDMIModalias=dmi:*svnLENOVO:*pvrThinkBook*G7+IAH*:*
|
||||||
MatchUdevType=touchpad
|
MatchUdevType=touchpad
|
||||||
ModelPressurePad=1
|
ModelPressurePad=1
|
||||||
|
|
||||||
|
# "GXTP5420 Touchpad": pressure touchpad mostly used in Lenovo laptops.
|
||||||
|
# GXTP5420:00 27C6:0F95 Touchpad
|
||||||
|
[Goodix Haptic Touchpad (27C6:0F95)]
|
||||||
|
MatchBus=i2c
|
||||||
|
MatchVendor=0x27C6
|
||||||
|
MatchProduct=0x0F95
|
||||||
|
MatchUdevType=touchpad
|
||||||
|
ModelPressurePad=1
|
||||||
|
|
|
||||||
|
|
@ -3622,7 +3622,8 @@ tp_init_pressurepad(struct tp_dispatch *tp, struct evdev_device *device)
|
||||||
*
|
*
|
||||||
* See also #562
|
* See also #562
|
||||||
*/
|
*/
|
||||||
if (libevdev_get_abs_resolution(device->evdev, ABS_MT_PRESSURE) != 0 ||
|
if (libevdev_has_property(device->evdev, INPUT_PROP_PRESSUREPAD) ||
|
||||||
|
libevdev_get_abs_resolution(device->evdev, ABS_MT_PRESSURE) != 0 ||
|
||||||
evdev_device_has_model_quirk(device, QUIRK_MODEL_PRESSURE_PAD)) {
|
evdev_device_has_model_quirk(device, QUIRK_MODEL_PRESSURE_PAD)) {
|
||||||
libevdev_disable_event_code(device->evdev, EV_ABS, ABS_MT_PRESSURE);
|
libevdev_disable_event_code(device->evdev, EV_ABS, ABS_MT_PRESSURE);
|
||||||
libevdev_disable_event_code(device->evdev, EV_ABS, ABS_PRESSURE);
|
libevdev_disable_event_code(device->evdev, EV_ABS, ABS_PRESSURE);
|
||||||
|
|
|
||||||
|
|
@ -1142,8 +1142,8 @@ tablet_get_quirked_pressure_thresholds(struct tablet_dispatch *tablet, int *hi,
|
||||||
_unref_(quirks) *q = libinput_device_get_quirks(&device->base);
|
_unref_(quirks) *q = libinput_device_get_quirks(&device->base);
|
||||||
if (q && quirks_get_range(q, QUIRK_ATTR_PRESSURE_RANGE, &r)) {
|
if (q && quirks_get_range(q, QUIRK_ATTR_PRESSURE_RANGE, &r)) {
|
||||||
if (r.lower < r.upper) {
|
if (r.lower < r.upper) {
|
||||||
*hi = r.lower;
|
*lo = r.lower;
|
||||||
*lo = r.upper;
|
*hi = r.upper;
|
||||||
status = true;
|
status = true;
|
||||||
} else {
|
} else {
|
||||||
evdev_log_info(device,
|
evdev_log_info(device,
|
||||||
|
|
@ -1272,10 +1272,13 @@ static void
|
||||||
eraser_button_toggle(struct libinput_tablet_tool *tool)
|
eraser_button_toggle(struct libinput_tablet_tool *tool)
|
||||||
{
|
{
|
||||||
struct libinput_device *libinput_device = tool->last_device;
|
struct libinput_device *libinput_device = tool->last_device;
|
||||||
struct evdev_device *device = evdev_device(libinput_device);
|
|
||||||
struct tablet_dispatch *tablet = tablet_dispatch(device->dispatch);
|
|
||||||
|
|
||||||
tablet_tool_apply_eraser_button(tablet, tool);
|
if (libinput_device) {
|
||||||
|
struct evdev_device *device = evdev_device(libinput_device);
|
||||||
|
struct tablet_dispatch *tablet = tablet_dispatch(device->dispatch);
|
||||||
|
|
||||||
|
tablet_tool_apply_eraser_button(tablet, tool);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static enum libinput_config_status
|
static enum libinput_config_status
|
||||||
|
|
@ -1296,7 +1299,7 @@ eraser_button_set_mode(struct libinput_tablet_tool *tool,
|
||||||
static enum libinput_config_eraser_button_mode
|
static enum libinput_config_eraser_button_mode
|
||||||
eraser_button_get_mode(struct libinput_tablet_tool *tool)
|
eraser_button_get_mode(struct libinput_tablet_tool *tool)
|
||||||
{
|
{
|
||||||
return tool->eraser_button.mode;
|
return tool->eraser_button.want_mode;
|
||||||
}
|
}
|
||||||
|
|
||||||
static enum libinput_config_eraser_button_mode
|
static enum libinput_config_eraser_button_mode
|
||||||
|
|
@ -1330,7 +1333,7 @@ eraser_button_set_button(struct libinput_tablet_tool *tool, uint32_t button)
|
||||||
static unsigned int
|
static unsigned int
|
||||||
eraser_button_get_button(struct libinput_tablet_tool *tool)
|
eraser_button_get_button(struct libinput_tablet_tool *tool)
|
||||||
{
|
{
|
||||||
return tool->eraser_button.button;
|
return tool->eraser_button.want_button;
|
||||||
}
|
}
|
||||||
|
|
||||||
static unsigned int
|
static unsigned int
|
||||||
|
|
@ -2448,6 +2451,8 @@ tablet_destroy(struct evdev_dispatch *dispatch)
|
||||||
struct libinput *li = tablet_libinput_context(tablet);
|
struct libinput *li = tablet_libinput_context(tablet);
|
||||||
|
|
||||||
list_for_each_safe(tool, &tablet->tool_list, link) {
|
list_for_each_safe(tool, &tablet->tool_list, link) {
|
||||||
|
list_remove(&tool->link);
|
||||||
|
list_init(&tool->link); /* unref may list_remove() too */
|
||||||
libinput_tablet_tool_unref(tool);
|
libinput_tablet_tool_unref(tool);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -537,6 +537,12 @@ libinputplugin_unregister(lua_State *L)
|
||||||
return luaL_error(L, "@@unregistering@@");
|
return luaL_error(L, "@@unregistering@@");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
readonly_newindex(lua_State *L)
|
||||||
|
{
|
||||||
|
return luaL_error(L, "attempt to modify a read-only table");
|
||||||
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
libinputplugin_gc(lua_State *L)
|
libinputplugin_gc(lua_State *L)
|
||||||
{
|
{
|
||||||
|
|
@ -647,7 +653,28 @@ libinputplugin_log_error(lua_State *L)
|
||||||
return libinputplugin_log(L, LIBINPUT_LOG_PRIORITY_ERROR);
|
return libinputplugin_log(L, LIBINPUT_LOG_PRIORITY_ERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct luaL_Reg libinputplugin_vtable[] = {
|
static void
|
||||||
|
setup_vfuncs(lua_State *L,
|
||||||
|
const char *metatable_name,
|
||||||
|
const struct luaL_Reg *vfuncs,
|
||||||
|
const struct luaL_Reg *public_methods)
|
||||||
|
{
|
||||||
|
luaL_newmetatable(L, metatable_name);
|
||||||
|
luaL_setfuncs(L, vfuncs, 0);
|
||||||
|
|
||||||
|
lua_newtable(L);
|
||||||
|
luaL_setfuncs(L, public_methods, 0);
|
||||||
|
lua_setfield(L, -2, "__index");
|
||||||
|
|
||||||
|
/* set metatable.__metatable = false to prevent a script from getmetatable(),
|
||||||
|
which is blocked anyway but safe and sorry and whatnot */
|
||||||
|
lua_pushboolean(L, 0);
|
||||||
|
lua_setfield(L, -2, "__metatable");
|
||||||
|
|
||||||
|
lua_pop(L, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
static const struct luaL_Reg libinputplugin_methods[] = {
|
||||||
{ "now", libinputplugin_now },
|
{ "now", libinputplugin_now },
|
||||||
{ "version", libinputplugin_version },
|
{ "version", libinputplugin_version },
|
||||||
{ "connect", libinputplugin_connect },
|
{ "connect", libinputplugin_connect },
|
||||||
|
|
@ -659,18 +686,18 @@ static const struct luaL_Reg libinputplugin_vtable[] = {
|
||||||
{ "log_debug", libinputplugin_log_debug },
|
{ "log_debug", libinputplugin_log_debug },
|
||||||
{ "log_info", libinputplugin_log_info },
|
{ "log_info", libinputplugin_log_info },
|
||||||
{ "log_error", libinputplugin_log_error },
|
{ "log_error", libinputplugin_log_error },
|
||||||
{ "__gc", libinputplugin_gc },
|
|
||||||
{ NULL, NULL }
|
{ NULL, NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static const struct luaL_Reg libinputplugin_meta[] = { { "__gc", libinputplugin_gc },
|
||||||
|
{ "__newindex",
|
||||||
|
readonly_newindex },
|
||||||
|
{ NULL, NULL } };
|
||||||
|
|
||||||
static void
|
static void
|
||||||
libinputplugin_init(lua_State *L)
|
libinputplugin_init(lua_State *L)
|
||||||
{
|
{
|
||||||
luaL_newmetatable(L, PLUGIN_METATABLE);
|
setup_vfuncs(L, PLUGIN_METATABLE, libinputplugin_meta, libinputplugin_methods);
|
||||||
lua_pushstring(L, "__index");
|
|
||||||
lua_pushvalue(L, -2); /* push metatable */
|
|
||||||
lua_settable(L, -3); /* metatable.__index = metatable */
|
|
||||||
luaL_setfuncs(L, libinputplugin_vtable, 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
|
@ -1047,7 +1074,7 @@ evdevdevice_gc(lua_State *L)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct luaL_Reg evdevdevice_vtable[] = {
|
static const struct luaL_Reg evdevdevice_methods[] = {
|
||||||
{ "info", evdevdevice_info },
|
{ "info", evdevdevice_info },
|
||||||
{ "name", evdevdevice_name },
|
{ "name", evdevdevice_name },
|
||||||
{ "usages", evdevdevice_usages },
|
{ "usages", evdevdevice_usages },
|
||||||
|
|
@ -1061,18 +1088,17 @@ static const struct luaL_Reg evdevdevice_vtable[] = {
|
||||||
{ "prepend_frame", evdevdevice_prepend_frame },
|
{ "prepend_frame", evdevdevice_prepend_frame },
|
||||||
{ "append_frame", evdevdevice_append_frame },
|
{ "append_frame", evdevdevice_append_frame },
|
||||||
{ "disable_feature", evdevdevice_disable_feature },
|
{ "disable_feature", evdevdevice_disable_feature },
|
||||||
{ "__gc", evdevdevice_gc },
|
|
||||||
{ NULL, NULL }
|
{ NULL, NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static const struct luaL_Reg evdevdevice_meta[] = { { "__gc", evdevdevice_gc },
|
||||||
|
{ "__newindex", readonly_newindex },
|
||||||
|
{ NULL, NULL } };
|
||||||
|
|
||||||
static void
|
static void
|
||||||
evdevdevice_init(lua_State *L)
|
evdevdevice_init(lua_State *L)
|
||||||
{
|
{
|
||||||
luaL_newmetatable(L, EVDEV_DEVICE_METATABLE);
|
setup_vfuncs(L, EVDEV_DEVICE_METATABLE, evdevdevice_meta, evdevdevice_methods);
|
||||||
lua_pushstring(L, "__index");
|
|
||||||
lua_pushvalue(L, -2); /* push metatable */
|
|
||||||
lua_settable(L, -3); /* metatable.__index = metatable */
|
|
||||||
luaL_setfuncs(L, evdevdevice_vtable, 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
@ -1310,7 +1336,7 @@ libinput_lua_plugin_new_from_path(struct libinput *libinput, const char *path)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
int ret = luaL_loadfile(L, path);
|
int ret = luaL_loadfilex(L, path, "t");
|
||||||
if (ret == LUA_OK) {
|
if (ret == LUA_OK) {
|
||||||
plugin->L = steal(&L);
|
plugin->L = steal(&L);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -54,6 +54,7 @@ struct plugin_device {
|
||||||
struct libinput_device *device;
|
struct libinput_device *device;
|
||||||
bitmask_t tool_state;
|
bitmask_t tool_state;
|
||||||
bool pen_forced_into_proximity;
|
bool pen_forced_into_proximity;
|
||||||
|
size_t pen_prox_out_events;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct plugin_data {
|
struct plugin_data {
|
||||||
|
|
@ -121,6 +122,23 @@ forced_tool_plugin_device_handle_frame(struct libinput_plugin *libinput_plugin,
|
||||||
} else {
|
} else {
|
||||||
bitmask_clear_bit(&device->tool_state, BTN_TOOL_PEN);
|
bitmask_clear_bit(&device->tool_state, BTN_TOOL_PEN);
|
||||||
device->pen_forced_into_proximity = false;
|
device->pen_forced_into_proximity = false;
|
||||||
|
|
||||||
|
/* If we get three valid pen proximity out events, let's
|
||||||
|
* assume this device works fine and disable our plugin
|
||||||
|
*/
|
||||||
|
if (++device->pen_prox_out_events > 2) {
|
||||||
|
plugin_log_debug(
|
||||||
|
libinput_plugin,
|
||||||
|
"%s: forced tool handling unloaded\n",
|
||||||
|
libinput_device_get_name(
|
||||||
|
device->device));
|
||||||
|
libinput_plugin_enable_device_event_frame(
|
||||||
|
libinput_plugin,
|
||||||
|
device->device,
|
||||||
|
false);
|
||||||
|
plugin_device_destroy(device);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return; /* Nothing to do */
|
return; /* Nothing to do */
|
||||||
case EVDEV_BTN_TOOL_RUBBER:
|
case EVDEV_BTN_TOOL_RUBBER:
|
||||||
|
|
|
||||||
|
|
@ -6700,7 +6700,7 @@ libinput_device_config_dwt_set_enabled(struct libinput_device *device,
|
||||||
/**
|
/**
|
||||||
* @ingroup config
|
* @ingroup config
|
||||||
*
|
*
|
||||||
* Check if the disable-while typing feature is currently enabled on this
|
* Check if the disable-while-typing feature is currently enabled on this
|
||||||
* device. If the device does not support disable-while-typing, this
|
* device. If the device does not support disable-while-typing, this
|
||||||
* function returns @ref LIBINPUT_CONFIG_DWT_DISABLED.
|
* function returns @ref LIBINPUT_CONFIG_DWT_DISABLED.
|
||||||
*
|
*
|
||||||
|
|
@ -6718,7 +6718,7 @@ libinput_device_config_dwt_get_enabled(struct libinput_device *device);
|
||||||
/**
|
/**
|
||||||
* @ingroup config
|
* @ingroup config
|
||||||
*
|
*
|
||||||
* Check if the disable-while typing feature is enabled on this device by
|
* Check if the disable-while-typing feature is enabled on this device by
|
||||||
* default. If the device does not support disable-while-typing, this
|
* default. If the device does not support disable-while-typing, this
|
||||||
* function returns @ref LIBINPUT_CONFIG_DWT_DISABLED.
|
* function returns @ref LIBINPUT_CONFIG_DWT_DISABLED.
|
||||||
*
|
*
|
||||||
|
|
@ -6796,7 +6796,7 @@ libinput_device_config_dwtp_set_enabled(struct libinput_device *device,
|
||||||
/**
|
/**
|
||||||
* @ingroup config
|
* @ingroup config
|
||||||
*
|
*
|
||||||
* Check if the disable-while trackpointing feature is currently enabled on
|
* Check if the disable-while-trackpointing feature is currently enabled on
|
||||||
* this device. If the device does not support disable-while-trackpointing,
|
* this device. If the device does not support disable-while-trackpointing,
|
||||||
* this function returns @ref LIBINPUT_CONFIG_DWTP_DISABLED.
|
* this function returns @ref LIBINPUT_CONFIG_DWTP_DISABLED.
|
||||||
*
|
*
|
||||||
|
|
@ -6816,7 +6816,7 @@ libinput_device_config_dwtp_get_enabled(struct libinput_device *device);
|
||||||
/**
|
/**
|
||||||
* @ingroup config
|
* @ingroup config
|
||||||
*
|
*
|
||||||
* Check if the disable-while trackpointing feature is enabled on this device
|
* Check if the disable-while-trackpointing feature is enabled on this device
|
||||||
* by default. If the device does not support disable-while-trackpointing, this
|
* by default. If the device does not support disable-while-trackpointing, this
|
||||||
* function returns @ref LIBINPUT_CONFIG_DWTP_DISABLED.
|
* function returns @ref LIBINPUT_CONFIG_DWTP_DISABLED.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -123,7 +123,8 @@ static void
|
||||||
close_pipes(int fds[_FD_LAST])
|
close_pipes(int fds[_FD_LAST])
|
||||||
{
|
{
|
||||||
for (int i = 0; i < _FD_LAST; i++) {
|
for (int i = 0; i < _FD_LAST; i++) {
|
||||||
fsync(fds[i]);
|
if (fds[i] != -1)
|
||||||
|
fsync(fds[i]);
|
||||||
xclose(&fds[i]);
|
xclose(&fds[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -520,6 +520,38 @@ START_TEST(lua_disallowed_functions)
|
||||||
}
|
}
|
||||||
END_TEST
|
END_TEST
|
||||||
|
|
||||||
|
START_TEST(lua_gc_not_accessible)
|
||||||
|
{
|
||||||
|
_destroy_(tmpdir) *tmpdir = tmpdir_create(NULL);
|
||||||
|
const char *lua =
|
||||||
|
"libinput:register({1})\n"
|
||||||
|
"assert(libinput.__gc == nil)\n"
|
||||||
|
"function check_device_gc(device)\n"
|
||||||
|
" assert(device.__gc == nil)\n"
|
||||||
|
" libinput:log_info(\"gc_not_accessible: ok\")\n"
|
||||||
|
"end\n"
|
||||||
|
"libinput:connect(\"new-evdev-device\", check_device_gc)\n";
|
||||||
|
|
||||||
|
_autofree_ char *path = litest_write_plugin(tmpdir->path, lua);
|
||||||
|
_litest_context_destroy_ struct libinput *li =
|
||||||
|
litest_create_context_with_plugindir(tmpdir->path);
|
||||||
|
if (libinput_log_get_priority(li) > LIBINPUT_LOG_PRIORITY_INFO)
|
||||||
|
libinput_log_set_priority(li, LIBINPUT_LOG_PRIORITY_INFO);
|
||||||
|
|
||||||
|
litest_with_logcapture(li, capture) {
|
||||||
|
libinput_plugin_system_load_plugins(li,
|
||||||
|
LIBINPUT_PLUGIN_SYSTEM_FLAG_NONE);
|
||||||
|
litest_drain_events(li);
|
||||||
|
|
||||||
|
_destroy_(litest_device) *device = litest_add_device(li, LITEST_MOUSE);
|
||||||
|
litest_drain_events(li);
|
||||||
|
|
||||||
|
litest_assert_logcapture_no_errors(capture);
|
||||||
|
litest_assert_strv_substring(capture->infos, "gc_not_accessible: ok");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
END_TEST
|
||||||
|
|
||||||
START_TEST(lua_frame_handler)
|
START_TEST(lua_frame_handler)
|
||||||
{
|
{
|
||||||
_destroy_(tmpdir) *tmpdir = tmpdir_create(NULL);
|
_destroy_(tmpdir) *tmpdir = tmpdir_create(NULL);
|
||||||
|
|
@ -1044,10 +1076,79 @@ START_TEST(lua_disable_touchpad_jump_detection)
|
||||||
}
|
}
|
||||||
END_TEST
|
END_TEST
|
||||||
|
|
||||||
|
/* Pre-compiled Lua 5.4 bytecode for the following source:
|
||||||
|
*
|
||||||
|
* libinput:register({1})
|
||||||
|
* libinput:connect("new-evdev-device", function(device)
|
||||||
|
* libinput:log_info("loaded from binary lua file")
|
||||||
|
* end)
|
||||||
|
*
|
||||||
|
* To regenerate:
|
||||||
|
* luac5.4 -o /dev/stdout /tmp/plugin.lua | xxd -i
|
||||||
|
*/
|
||||||
|
static const unsigned char binary_lua_plugin[] = {
|
||||||
|
0x1b, 0x4c, 0x75, 0x61, 0x54, 0x00, 0x19, 0x93, 0x0d, 0x0a, 0x1a, 0x0a, 0x04,
|
||||||
|
0x08, 0x08, 0x78, 0x56, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x28, 0x77, 0x40, 0x01, 0x9b, 0x40, 0x74, 0x65, 0x73, 0x74, 0x2f,
|
||||||
|
0x31, 0x30, 0x2d, 0x62, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x2d, 0x70, 0x6c, 0x75,
|
||||||
|
0x67, 0x69, 0x6e, 0x2e, 0x6c, 0x75, 0x61, 0x80, 0x80, 0x00, 0x01, 0x04, 0x8e,
|
||||||
|
0x51, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x14, 0x80, 0x00, 0x01, 0x13,
|
||||||
|
0x01, 0x00, 0x01, 0x52, 0x00, 0x00, 0x00, 0x81, 0x01, 0x00, 0x80, 0x4e, 0x01,
|
||||||
|
0x01, 0x00, 0x44, 0x00, 0x03, 0x01, 0x0b, 0x00, 0x00, 0x00, 0x14, 0x80, 0x00,
|
||||||
|
0x02, 0x03, 0x81, 0x01, 0x00, 0xcf, 0x01, 0x00, 0x00, 0x44, 0x00, 0x04, 0x01,
|
||||||
|
0x46, 0x00, 0x01, 0x01, 0x84, 0x04, 0x89, 0x6c, 0x69, 0x62, 0x69, 0x6e, 0x70,
|
||||||
|
0x75, 0x74, 0x04, 0x89, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x04,
|
||||||
|
0x88, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x04, 0x91, 0x6e, 0x65, 0x77,
|
||||||
|
0x2d, 0x65, 0x76, 0x64, 0x65, 0x76, 0x2d, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65,
|
||||||
|
0x81, 0x01, 0x00, 0x00, 0x81, 0x80, 0x8d, 0x8f, 0x01, 0x00, 0x04, 0x85, 0x8b,
|
||||||
|
0x00, 0x00, 0x00, 0x94, 0x80, 0x01, 0x01, 0x83, 0x01, 0x01, 0x00, 0xc4, 0x00,
|
||||||
|
0x03, 0x01, 0xc7, 0x00, 0x01, 0x00, 0x83, 0x04, 0x89, 0x6c, 0x69, 0x62, 0x69,
|
||||||
|
0x6e, 0x70, 0x75, 0x74, 0x04, 0x89, 0x6c, 0x6f, 0x67, 0x5f, 0x69, 0x6e, 0x66,
|
||||||
|
0x6f, 0x04, 0x9c, 0x6c, 0x6f, 0x61, 0x64, 0x65, 0x64, 0x20, 0x66, 0x72, 0x6f,
|
||||||
|
0x6d, 0x20, 0x62, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x20, 0x6c, 0x75, 0x61, 0x20,
|
||||||
|
0x66, 0x69, 0x6c, 0x65, 0x81, 0x00, 0x00, 0x00, 0x80, 0x85, 0x01, 0x00, 0x00,
|
||||||
|
0x00, 0x01, 0x80, 0x81, 0x87, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x80, 0x85,
|
||||||
|
0x81, 0x85, 0x5f, 0x45, 0x4e, 0x56, 0x8e, 0x01, 0x0b, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x01, 0x00, 0x00, 0x02, 0xfe, 0x02, 0x80, 0x80, 0x81, 0x85, 0x5f,
|
||||||
|
0x45, 0x4e, 0x56,
|
||||||
|
};
|
||||||
|
|
||||||
|
START_TEST(lua_reject_precompiled_files)
|
||||||
|
{
|
||||||
|
_destroy_(tmpdir) *tmpdir = tmpdir_create(NULL);
|
||||||
|
|
||||||
|
/* Write the binary bytecode to a .lua file in the tmpdir.
|
||||||
|
* Binary (pre-compiled) Lua files must be rejected by the
|
||||||
|
* plugin loader for security reasons. */
|
||||||
|
_autofree_ char *path = strdup_printf("%s/10-binary-plugin.lua", tmpdir->path);
|
||||||
|
_autoclose_ int fd = open(path, O_WRONLY | O_CREAT, 0644);
|
||||||
|
litest_assert_errno_success(fd);
|
||||||
|
|
||||||
|
ssize_t written = write(fd, binary_lua_plugin, sizeof(binary_lua_plugin));
|
||||||
|
litest_assert_int_eq((int)written, (int)sizeof(binary_lua_plugin));
|
||||||
|
fsync(fd);
|
||||||
|
|
||||||
|
_litest_context_destroy_ struct libinput *li =
|
||||||
|
litest_create_context_with_plugindir(tmpdir->path);
|
||||||
|
|
||||||
|
litest_with_logcapture(li, capture) {
|
||||||
|
libinput_plugin_system_load_plugins(li,
|
||||||
|
LIBINPUT_PLUGIN_SYSTEM_FLAG_NONE);
|
||||||
|
litest_drain_events(li);
|
||||||
|
|
||||||
|
size_t index = 0;
|
||||||
|
litest_assert(
|
||||||
|
strv_find_substring(capture->errors, "Failed to load", &index));
|
||||||
|
litest_assert_str_in(path, capture->errors[index]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
END_TEST
|
||||||
|
|
||||||
TEST_COLLECTION(lua)
|
TEST_COLLECTION(lua)
|
||||||
{
|
{
|
||||||
/* clang-format off */
|
/* clang-format off */
|
||||||
litest_add_no_device(lua_load_failure);
|
litest_add_no_device(lua_load_failure);
|
||||||
|
litest_add_no_device(lua_reject_precompiled_files);
|
||||||
litest_with_parameters(params,
|
litest_with_parameters(params,
|
||||||
"content", 'I', 6,
|
"content", 'I', 6,
|
||||||
litest_named_i32(EMPTY),
|
litest_named_i32(EMPTY),
|
||||||
|
|
@ -1091,6 +1192,7 @@ TEST_COLLECTION(lua)
|
||||||
litest_add_no_device(lua_register_multiversions);
|
litest_add_no_device(lua_register_multiversions);
|
||||||
litest_add_no_device(lua_allowed_functions);
|
litest_add_no_device(lua_allowed_functions);
|
||||||
litest_add_no_device(lua_disallowed_functions);
|
litest_add_no_device(lua_disallowed_functions);
|
||||||
|
litest_add_no_device(lua_gc_not_accessible);
|
||||||
|
|
||||||
litest_add_no_device(lua_frame_handler);
|
litest_add_no_device(lua_frame_handler);
|
||||||
litest_add_no_device(lua_device_info);
|
litest_add_no_device(lua_device_info);
|
||||||
|
|
|
||||||
|
|
@ -7722,6 +7722,51 @@ START_TEST(tablet_eraser_button_disabled)
|
||||||
}
|
}
|
||||||
END_TEST
|
END_TEST
|
||||||
|
|
||||||
|
START_TEST(tablet_eraser_button_config_after_device_removal)
|
||||||
|
{
|
||||||
|
_litest_context_destroy_ struct libinput *li = litest_create_context();
|
||||||
|
struct litest_device *tablet = litest_add_device(li, LITEST_ELAN_TABLET);
|
||||||
|
struct axis_replacement axes[] = {
|
||||||
|
{ ABS_DISTANCE, 10 },
|
||||||
|
{ ABS_PRESSURE, 0 },
|
||||||
|
{ -1, -1 },
|
||||||
|
};
|
||||||
|
|
||||||
|
litest_drain_events(li);
|
||||||
|
|
||||||
|
litest_tablet_set_tool_type(tablet, BTN_TOOL_RUBBER);
|
||||||
|
litest_tablet_proximity_in(tablet, 10, 10, axes);
|
||||||
|
|
||||||
|
litest_dispatch(li);
|
||||||
|
auto event = libinput_get_event(li);
|
||||||
|
auto tev = litest_is_tablet_event(event, LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY);
|
||||||
|
auto tool = libinput_event_tablet_tool_get_tool(tev);
|
||||||
|
libinput_tablet_tool_ref(tool);
|
||||||
|
libinput_event_destroy(event);
|
||||||
|
|
||||||
|
litest_device_destroy(tablet);
|
||||||
|
litest_drain_events(li);
|
||||||
|
|
||||||
|
/* Tool isn't associated with a device but config should take effect anyway */
|
||||||
|
auto status = libinput_tablet_tool_config_eraser_button_set_mode(
|
||||||
|
tool,
|
||||||
|
LIBINPUT_CONFIG_ERASER_BUTTON_BUTTON);
|
||||||
|
litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS);
|
||||||
|
status =
|
||||||
|
libinput_tablet_tool_config_eraser_button_set_button(tool, BTN_STYLUS2);
|
||||||
|
litest_assert_enum_eq(status, LIBINPUT_CONFIG_STATUS_SUCCESS);
|
||||||
|
|
||||||
|
litest_assert_enum_eq(libinput_tablet_tool_config_eraser_button_get_mode(tool),
|
||||||
|
LIBINPUT_CONFIG_ERASER_BUTTON_BUTTON);
|
||||||
|
litest_assert_int_eq(libinput_tablet_tool_config_eraser_button_get_button(tool),
|
||||||
|
(unsigned)BTN_STYLUS2);
|
||||||
|
|
||||||
|
litest_drain_events(li);
|
||||||
|
|
||||||
|
libinput_tablet_tool_unref(tool);
|
||||||
|
}
|
||||||
|
END_TEST
|
||||||
|
|
||||||
TEST_COLLECTION(tablet)
|
TEST_COLLECTION(tablet)
|
||||||
{
|
{
|
||||||
/* clang-format off */
|
/* clang-format off */
|
||||||
|
|
@ -7886,6 +7931,8 @@ TEST_COLLECTION(tablet_eraser)
|
||||||
"with-motion-events", 'b') {
|
"with-motion-events", 'b') {
|
||||||
litest_add_parametrized(tablet_eraser_button_disabled, LITEST_TABLET, LITEST_TOTEM|LITEST_FORCED_PROXOUT, params);
|
litest_add_parametrized(tablet_eraser_button_disabled, LITEST_TABLET, LITEST_TOTEM|LITEST_FORCED_PROXOUT, params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
litest_add_no_device(tablet_eraser_button_config_after_device_removal);
|
||||||
/* clang-format on */
|
/* clang-format on */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3651,7 +3651,7 @@ START_TEST(touchpad_state_after_syn_dropped_2fg_change)
|
||||||
}
|
}
|
||||||
END_TEST
|
END_TEST
|
||||||
|
|
||||||
START_TEST(touchpad_dwt)
|
START_TEST(touchpad_dwt_single_key)
|
||||||
{
|
{
|
||||||
struct litest_device *touchpad = litest_current_device();
|
struct litest_device *touchpad = litest_current_device();
|
||||||
struct litest_device *keyboard;
|
struct litest_device *keyboard;
|
||||||
|
|
@ -3674,7 +3674,7 @@ START_TEST(touchpad_dwt)
|
||||||
|
|
||||||
litest_assert_only_typed_events(li, LIBINPUT_EVENT_KEYBOARD_KEY);
|
litest_assert_only_typed_events(li, LIBINPUT_EVENT_KEYBOARD_KEY);
|
||||||
|
|
||||||
litest_timeout_dwt_short(li);
|
litest_timeout_dwt_long(li);
|
||||||
|
|
||||||
/* after timeout - motion events*/
|
/* after timeout - motion events*/
|
||||||
litest_touch_down(touchpad, 0, 50, 50);
|
litest_touch_down(touchpad, 0, 50, 50);
|
||||||
|
|
@ -7160,7 +7160,8 @@ TEST_COLLECTION(touchpad)
|
||||||
TEST_COLLECTION(touchpad_dwt)
|
TEST_COLLECTION(touchpad_dwt)
|
||||||
{
|
{
|
||||||
/* clang-format off */
|
/* clang-format off */
|
||||||
litest_add(touchpad_dwt, LITEST_TOUCHPAD, LITEST_ANY);
|
litest_add(touchpad_dwt_single_key, LITEST_TOUCHPAD, LITEST_ANY);
|
||||||
|
|
||||||
litest_add_for_device(touchpad_dwt_ext_and_int_keyboard, LITEST_SYNAPTICS_I2C);
|
litest_add_for_device(touchpad_dwt_ext_and_int_keyboard, LITEST_SYNAPTICS_I2C);
|
||||||
litest_add(touchpad_dwt_enable_touch, LITEST_TOUCHPAD, LITEST_ANY);
|
litest_add(touchpad_dwt_enable_touch, LITEST_TOUCHPAD, LITEST_ANY);
|
||||||
litest_add(touchpad_dwt_touch_hold, LITEST_TOUCHPAD, LITEST_ANY);
|
litest_add(touchpad_dwt_touch_hold, LITEST_TOUCHPAD, LITEST_ANY);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue