mirror of
https://github.com/labwc/labwc.git
synced 2026-04-12 08:21:13 -04:00
config: add click method libinput option
This commit is contained in:
parent
72f3ce6b41
commit
909593cdd5
4 changed files with 22 additions and 0 deletions
|
|
@ -28,6 +28,7 @@ struct libinput_category {
|
|||
int accel_profile; /* -1 or libinput_config_accel_profile */
|
||||
int middle_emu; /* -1 or libinput_config_middle_emulation_state */
|
||||
int dwt; /* -1 or libinput_config_dwt_state */
|
||||
enum libinput_config_click_method click_method;
|
||||
};
|
||||
|
||||
enum lab_libinput_device_type get_device_type(const char *s);
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ libinput_category_init(struct libinput_category *l)
|
|||
l->accel_profile = -1;
|
||||
l->middle_emu = -1;
|
||||
l->dwt = -1;
|
||||
l->click_method = LIBINPUT_CONFIG_CLICK_METHOD_BUTTON_AREAS;
|
||||
}
|
||||
|
||||
enum lab_libinput_device_type
|
||||
|
|
|
|||
|
|
@ -544,6 +544,19 @@ fill_libinput_category(char *nodename, char *content)
|
|||
current_libinput_category->dwt = ret
|
||||
? LIBINPUT_CONFIG_DWT_ENABLED
|
||||
: LIBINPUT_CONFIG_DWT_DISABLED;
|
||||
} else if (!strcasecmp(nodename, "clickMethod")) {
|
||||
if (!strcmp(content, "none")) {
|
||||
current_libinput_category->click_method =
|
||||
LIBINPUT_CONFIG_CLICK_METHOD_NONE;
|
||||
} else if (!strcmp(content, "clickfinger")) {
|
||||
current_libinput_category->click_method =
|
||||
LIBINPUT_CONFIG_CLICK_METHOD_CLICKFINGER;
|
||||
} else if (!strcmp(content, "buttonAreas")) {
|
||||
current_libinput_category->click_method =
|
||||
LIBINPUT_CONFIG_CLICK_METHOD_BUTTON_AREAS;
|
||||
} else {
|
||||
wlr_log(WLR_ERROR, "invalid clickMethod");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@
|
|||
#include "input/keyboard.h"
|
||||
#include "input/key-state.h"
|
||||
#include "labwc.h"
|
||||
#include "libinput.h"
|
||||
#include "view.h"
|
||||
|
||||
static void
|
||||
|
|
@ -189,6 +190,12 @@ configure_libinput(struct wlr_input_device *wlr_input_device)
|
|||
wlr_log(WLR_INFO, "dwt configured");
|
||||
libinput_device_config_dwt_set_enabled(libinput_dev, dc->dwt);
|
||||
}
|
||||
if (libinput_device_config_click_set_method(libinput_dev,
|
||||
dc->click_method) > 0) {
|
||||
wlr_log(WLR_INFO, "click method not configured");
|
||||
} else {
|
||||
wlr_log(WLR_INFO, "click method configured");
|
||||
}
|
||||
}
|
||||
|
||||
static struct wlr_output *
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue