mirror of
https://github.com/labwc/labwc.git
synced 2025-11-02 09:01:47 -05:00
implement libinput tapButtonMap setting
this is a standard libinput setting that was not previously exposed
This commit is contained in:
parent
859495a8be
commit
a3796fa6f3
4 changed files with 11 additions and 0 deletions
|
|
@ -20,6 +20,7 @@ struct libinput_category {
|
||||||
int natural_scroll;
|
int natural_scroll;
|
||||||
int left_handed;
|
int left_handed;
|
||||||
enum libinput_config_tap_state tap;
|
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_accel_profile accel_profile;
|
||||||
enum libinput_config_middle_emulation_state middle_emu;
|
enum libinput_config_middle_emulation_state middle_emu;
|
||||||
enum libinput_config_dwt_state dwt;
|
enum libinput_config_dwt_state dwt;
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@ libinput_category_init(struct libinput_category *l)
|
||||||
l->natural_scroll = -1;
|
l->natural_scroll = -1;
|
||||||
l->left_handed = -1;
|
l->left_handed = -1;
|
||||||
l->tap = LIBINPUT_CONFIG_TAP_ENABLED;
|
l->tap = LIBINPUT_CONFIG_TAP_ENABLED;
|
||||||
|
l->tap_button_map = LIBINPUT_CONFIG_TAP_MAP_LRM;
|
||||||
l->accel_profile = -1;
|
l->accel_profile = -1;
|
||||||
l->middle_emu = -1;
|
l->middle_emu = -1;
|
||||||
l->dwt = -1;
|
l->dwt = -1;
|
||||||
|
|
|
||||||
|
|
@ -177,6 +177,14 @@ fill_libinput_category(char *nodename, char *content)
|
||||||
current_libinput_category->tap = get_bool(content) ?
|
current_libinput_category->tap = get_bool(content) ?
|
||||||
LIBINPUT_CONFIG_TAP_ENABLED :
|
LIBINPUT_CONFIG_TAP_ENABLED :
|
||||||
LIBINPUT_CONFIG_TAP_DISABLED;
|
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")) {
|
} else if (!strcasecmp(nodename, "accelProfile")) {
|
||||||
current_libinput_category->accel_profile = get_accel_profile(content);
|
current_libinput_category->accel_profile = get_accel_profile(content);
|
||||||
} else if (!strcasecmp(nodename, "middleEmulation")) {
|
} else if (!strcasecmp(nodename, "middleEmulation")) {
|
||||||
|
|
|
||||||
|
|
@ -58,6 +58,7 @@ configure_libinput(struct wlr_input_device *wlr_input_device)
|
||||||
} else {
|
} else {
|
||||||
wlr_log(WLR_INFO, "tap configured");
|
wlr_log(WLR_INFO, "tap configured");
|
||||||
libinput_device_config_tap_set_enabled(libinput_dev, dc->tap);
|
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
|
if (libinput_device_config_scroll_has_natural_scroll(libinput_dev) <= 0
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue