]> git.mdlowis.com Git - proto/labwc.git/commitdiff
implement libinput tapButtonMap setting
authorbi4k8 <bi4k8@github>
Sun, 12 Dec 2021 22:12:30 +0000 (22:12 +0000)
committerARDiDo <90479315+ARDiDo@users.noreply.github.com>
Mon, 13 Dec 2021 00:00:58 +0000 (19:00 -0500)
this is a standard libinput setting that was not previously exposed

include/config/libinput.h
src/config/libinput.c
src/config/rcxml.c
src/seat.c

index 256633cdeb7a35a73c6f3309970b9e4eeefb9944..d7831ed4275b01f11d850ccea954b61eb4876bd2 100644 (file)
@@ -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;
index 119e68d38da8cd016626dc51684656e7877048b3..9efa343742aa5df5c0287ff6f407514b0409c71a 100644 (file)
@@ -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;
index 55f4628396768d833dbd7af49cbe7e3e5a3f2b98..00ec1bae1909b81ae2999ac8b9209c24d7a61d38 100644 (file)
@@ -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")) {
index aeb13d7200277cc19d2316c5256aaa66e5c6ce1f..622a6c7f46ffca03b94f62eabddeb77008ab2b55 100644 (file)
@@ -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