mirror of
https://github.com/labwc/labwc.git
synced 2026-03-18 05:33:53 -04:00
libinput: implement threeFingerDrag feature
This commit is contained in:
parent
22d319cce8
commit
e96b5af42d
7 changed files with 47 additions and 1 deletions
|
|
@ -959,6 +959,7 @@ extending outward from the snapped edge.
|
||||||
<tapButtonMap></tapButtonMap>
|
<tapButtonMap></tapButtonMap>
|
||||||
<tapAndDrag></tapAndDrag>
|
<tapAndDrag></tapAndDrag>
|
||||||
<dragLock>sticky</dragLock>
|
<dragLock>sticky</dragLock>
|
||||||
|
<threeFingerDrag></threeFingerDrag>
|
||||||
<middleEmulation></middleEmulation>
|
<middleEmulation></middleEmulation>
|
||||||
<disableWhileTyping></disableWhileTyping>
|
<disableWhileTyping></disableWhileTyping>
|
||||||
<clickMethod></clickMethod>
|
<clickMethod></clickMethod>
|
||||||
|
|
@ -1033,6 +1034,16 @@ extending outward from the snapped edge.
|
||||||
drag lock, but if *yes* is set, the drag lock expires after a timeout.
|
drag lock, but if *yes* is set, the drag lock expires after a timeout.
|
||||||
Default is *sticky*.
|
Default is *sticky*.
|
||||||
|
|
||||||
|
*<libinput><device><threeFingerDrag>* [yes|no|3|4]
|
||||||
|
Enable or disable the three-finger drag feature. When enabled, three
|
||||||
|
fingers down will result in a button down event and subsequent finger
|
||||||
|
motions triggers a drag.
|
||||||
|
|
||||||
|
The available options are:
|
||||||
|
- *no* - Disable three-finger drag.
|
||||||
|
- *yes* | *3* - Enable three-finger drag for 3 fingers.
|
||||||
|
- *4* - Enable three-finger drag for 4 fingers.
|
||||||
|
|
||||||
*<libinput><device><middleEmulation>* [yes|no]
|
*<libinput><device><middleEmulation>* [yes|no]
|
||||||
Enable or disable middle button emulation for this category. Middle
|
Enable or disable middle button emulation for this category. Middle
|
||||||
emulation processes a simultaneous left and right click as a press of
|
emulation processes a simultaneous left and right click as a press of
|
||||||
|
|
|
||||||
|
|
@ -633,6 +633,7 @@
|
||||||
<tapButtonMap></tapButtonMap>
|
<tapButtonMap></tapButtonMap>
|
||||||
<tapAndDrag></tapAndDrag>
|
<tapAndDrag></tapAndDrag>
|
||||||
<dragLock>sticky</dragLock>
|
<dragLock>sticky</dragLock>
|
||||||
|
<threeFingerDrag></threeFingerDrag>
|
||||||
<middleEmulation></middleEmulation>
|
<middleEmulation></middleEmulation>
|
||||||
<disableWhileTyping></disableWhileTyping>
|
<disableWhileTyping></disableWhileTyping>
|
||||||
<clickMethod></clickMethod>
|
<clickMethod></clickMethod>
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@ struct libinput_category {
|
||||||
enum libinput_config_tap_button_map tap_button_map;
|
enum libinput_config_tap_button_map tap_button_map;
|
||||||
int tap_and_drag; /* -1 or libinput_config_drag_state */
|
int tap_and_drag; /* -1 or libinput_config_drag_state */
|
||||||
int drag_lock; /* -1 or libinput_config_drag_lock_state */
|
int drag_lock; /* -1 or libinput_config_drag_lock_state */
|
||||||
|
int three_finger_drag; /* -1 or libinput_config_3fg_drag_state */
|
||||||
int accel_profile; /* -1 or libinput_config_accel_profile */
|
int accel_profile; /* -1 or libinput_config_accel_profile */
|
||||||
int middle_emu; /* -1 or libinput_config_middle_emulation_state */
|
int middle_emu; /* -1 or libinput_config_middle_emulation_state */
|
||||||
int dwt; /* -1 or libinput_config_dwt_state */
|
int dwt; /* -1 or libinput_config_dwt_state */
|
||||||
|
|
|
||||||
|
|
@ -110,7 +110,7 @@ conf_data.set10('HAVE_RSVG', have_rsvg)
|
||||||
|
|
||||||
conf_data.set10('HAVE_LIBSFDO', have_libsfdo)
|
conf_data.set10('HAVE_LIBSFDO', have_libsfdo)
|
||||||
|
|
||||||
foreach sym : ['LIBINPUT_CONFIG_DRAG_LOCK_ENABLED_STICKY']
|
foreach sym : ['LIBINPUT_CONFIG_DRAG_LOCK_ENABLED_STICKY', 'LIBINPUT_CONFIG_3FG_DRAG_ENABLED_3FG']
|
||||||
conf_data.set10('HAVE_' + sym, cc.has_header_symbol('libinput.h', sym, dependencies: input))
|
conf_data.set10('HAVE_' + sym, cc.has_header_symbol('libinput.h', sym, dependencies: input))
|
||||||
endforeach
|
endforeach
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,7 @@ libinput_category_init(struct libinput_category *l)
|
||||||
#else
|
#else
|
||||||
l->drag_lock = -1;
|
l->drag_lock = -1;
|
||||||
#endif
|
#endif
|
||||||
|
l->three_finger_drag = -1;
|
||||||
l->accel_profile = -1;
|
l->accel_profile = -1;
|
||||||
l->middle_emu = -1;
|
l->middle_emu = -1;
|
||||||
l->dwt = -1;
|
l->dwt = -1;
|
||||||
|
|
|
||||||
|
|
@ -788,6 +788,27 @@ fill_libinput_category(char *nodename, char *content, struct parser_state *state
|
||||||
state->current_libinput_category->drag_lock = ret
|
state->current_libinput_category->drag_lock = ret
|
||||||
? LIBINPUT_CONFIG_DRAG_LOCK_ENABLED
|
? LIBINPUT_CONFIG_DRAG_LOCK_ENABLED
|
||||||
: LIBINPUT_CONFIG_DRAG_LOCK_DISABLED;
|
: LIBINPUT_CONFIG_DRAG_LOCK_DISABLED;
|
||||||
|
} else if (!strcasecmp(nodename, "threeFingerDrag")) {
|
||||||
|
#if HAVE_LIBINPUT_CONFIG_3FG_DRAG_ENABLED_3FG
|
||||||
|
if (!strcmp(content, "3")) {
|
||||||
|
state->current_libinput_category->three_finger_drag =
|
||||||
|
LIBINPUT_CONFIG_3FG_DRAG_ENABLED_3FG;
|
||||||
|
} else if (!strcmp(content, "4")) {
|
||||||
|
state->current_libinput_category->three_finger_drag =
|
||||||
|
LIBINPUT_CONFIG_3FG_DRAG_ENABLED_4FG;
|
||||||
|
} else {
|
||||||
|
int ret = parse_bool(content, -1);
|
||||||
|
if (ret < 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
state->current_libinput_category->three_finger_drag = ret
|
||||||
|
? LIBINPUT_CONFIG_3FG_DRAG_ENABLED_3FG
|
||||||
|
: LIBINPUT_CONFIG_3FG_DRAG_DISABLED;
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
wlr_log(WLR_ERROR, "<threeFingerDrag> is only"
|
||||||
|
" supported in libinput >= 1.28");
|
||||||
|
#endif
|
||||||
} else if (!strcasecmp(nodename, "accelProfile")) {
|
} else if (!strcasecmp(nodename, "accelProfile")) {
|
||||||
state->current_libinput_category->accel_profile =
|
state->current_libinput_category->accel_profile =
|
||||||
get_accel_profile(content);
|
get_accel_profile(content);
|
||||||
|
|
|
||||||
11
src/seat.c
11
src/seat.c
|
|
@ -164,6 +164,17 @@ configure_libinput(struct wlr_input_device *wlr_input_device)
|
||||||
libinput_dev, dc->drag_lock);
|
libinput_dev, dc->drag_lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if HAVE_LIBINPUT_CONFIG_3FG_DRAG_ENABLED_3FG
|
||||||
|
if (libinput_device_config_tap_get_finger_count(libinput_dev) <= 0
|
||||||
|
|| dc->three_finger_drag < 0) {
|
||||||
|
wlr_log(WLR_INFO, "three-finger drag not configured");
|
||||||
|
} else {
|
||||||
|
wlr_log(WLR_INFO, "three-finger drag configured");
|
||||||
|
libinput_device_config_3fg_drag_set_enabled(
|
||||||
|
libinput_dev, dc->three_finger_drag);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (libinput_device_config_scroll_has_natural_scroll(libinput_dev) <= 0
|
if (libinput_device_config_scroll_has_natural_scroll(libinput_dev) <= 0
|
||||||
|| dc->natural_scroll < 0) {
|
|| dc->natural_scroll < 0) {
|
||||||
wlr_log(WLR_INFO, "natural scroll not configured");
|
wlr_log(WLR_INFO, "natural scroll not configured");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue