From a3796fa6f3b5fb53e987bdd9b7497a562715af29 Mon Sep 17 00:00:00 2001 From: bi4k8 Date: Sun, 12 Dec 2021 22:12:30 +0000 Subject: [PATCH] implement libinput tapButtonMap setting this is a standard libinput setting that was not previously exposed --- include/config/libinput.h | 1 + src/config/libinput.c | 1 + src/config/rcxml.c | 8 ++++++++ src/seat.c | 1 + 4 files changed, 11 insertions(+) diff --git a/include/config/libinput.h b/include/config/libinput.h index 256633cd..d7831ed4 100644 --- a/include/config/libinput.h +++ b/include/config/libinput.h @@ -20,6 +20,7 @@ struct libinput_category { int natural_scroll; int left_handed; enum libinput_config_tap_state tap; + enum libinput_config_tap_button_map tap_button_map; enum libinput_config_accel_profile accel_profile; enum libinput_config_middle_emulation_state middle_emu; enum libinput_config_dwt_state dwt; diff --git a/src/config/libinput.c b/src/config/libinput.c index 119e68d3..9efa3437 100644 --- a/src/config/libinput.c +++ b/src/config/libinput.c @@ -12,6 +12,7 @@ libinput_category_init(struct libinput_category *l) l->natural_scroll = -1; l->left_handed = -1; l->tap = LIBINPUT_CONFIG_TAP_ENABLED; + l->tap_button_map = LIBINPUT_CONFIG_TAP_MAP_LRM; l->accel_profile = -1; l->middle_emu = -1; l->dwt = -1; diff --git a/src/config/rcxml.c b/src/config/rcxml.c index 55f46283..00ec1bae 100644 --- a/src/config/rcxml.c +++ b/src/config/rcxml.c @@ -177,6 +177,14 @@ fill_libinput_category(char *nodename, char *content) current_libinput_category->tap = get_bool(content) ? LIBINPUT_CONFIG_TAP_ENABLED : LIBINPUT_CONFIG_TAP_DISABLED; + } else if (!strcasecmp(nodename, "tapButtonMap")) { + if (!strcmp(content, "lrm")) { + current_libinput_category->tap_button_map = LIBINPUT_CONFIG_TAP_MAP_LRM; + } else if (!strcmp(content, "lmr")) { + current_libinput_category->tap_button_map = LIBINPUT_CONFIG_TAP_MAP_LMR; + } else { + wlr_log(WLR_ERROR, "invalid tapButtonMap"); + } } else if (!strcasecmp(nodename, "accelProfile")) { current_libinput_category->accel_profile = get_accel_profile(content); } else if (!strcasecmp(nodename, "middleEmulation")) { diff --git a/src/seat.c b/src/seat.c index aeb13d72..622a6c7f 100644 --- a/src/seat.c +++ b/src/seat.c @@ -58,6 +58,7 @@ configure_libinput(struct wlr_input_device *wlr_input_device) } else { wlr_log(WLR_INFO, "tap configured"); libinput_device_config_tap_set_enabled(libinput_dev, dc->tap); + libinput_device_config_tap_set_button_map(libinput_dev, dc->tap_button_map); } if (libinput_device_config_scroll_has_natural_scroll(libinput_dev) <= 0