mirror of
https://github.com/wizbright/waybox.git
synced 2026-03-11 05:34:15 -04:00
Fixed oversights in libinput configuration
This commit is contained in:
parent
6c6d0214b4
commit
e4b603a082
9 changed files with 19 additions and 5 deletions
|
|
@ -186,6 +186,7 @@ bool init_config(struct wb_server *server) {
|
|||
config->libinput_config.left_handed = parse_xpath_expr("//ob:mouse//ob:libinput/ob:leftHanded", ctxt);
|
||||
config->libinput_config.middle_emulation = parse_xpath_expr("//ob:mouse//ob:libinput/ob:middleEmulation", ctxt);
|
||||
config->libinput_config.natural_scroll = parse_xpath_expr("//ob:mouse//ob:libinput/ob:naturalScroll", ctxt);
|
||||
config->libinput_config.scroll_button = parse_xpath_expr("//ob:mouse//ob:libinput/ob:scrollButton", ctxt);
|
||||
config->libinput_config.scroll_button_lock = parse_xpath_expr("//ob:mouse//ob:libinput/ob:scrollButtonLock", ctxt);
|
||||
config->libinput_config.scroll_method = parse_xpath_expr("//ob:mouse//ob:libinput/ob:scrollMethod", ctxt);
|
||||
config->libinput_config.tap = parse_xpath_expr("//ob:mouse//ob:libinput/ob:tap", ctxt);
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ struct wb_config {
|
|||
char *left_handed;
|
||||
char *middle_emulation;
|
||||
char *natural_scroll;
|
||||
char *scroll_button;
|
||||
char *scroll_button_lock;
|
||||
char *scroll_method;
|
||||
char *tap;
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ wb_src = files(
|
|||
)
|
||||
|
||||
wb_dep = [
|
||||
libevdev,
|
||||
libinput,
|
||||
libxml2,
|
||||
wayland_server,
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
#include <libevdev/libevdev.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <wlr/backend/libinput.h>
|
||||
|
|
@ -287,7 +288,7 @@ static void handle_new_pointer(struct wb_server *server, struct wlr_input_device
|
|||
enum libinput_config_click_method click_method = LIBINPUT_CONFIG_CLICK_METHOD_BUTTON_AREAS;
|
||||
if (strcmp(config->libinput_config.click_method, "clickfinger") == 0)
|
||||
click_method = LIBINPUT_CONFIG_CLICK_METHOD_CLICKFINGER;
|
||||
else if (strcmp(config->libinput_config.scroll_method, "none") == 0)
|
||||
else if (strcmp(config->libinput_config.click_method, "none") == 0)
|
||||
click_method = LIBINPUT_CONFIG_CLICK_METHOD_NONE;
|
||||
libinput_device_config_click_set_method(libinput_handle, click_method);
|
||||
}
|
||||
|
|
@ -311,6 +312,12 @@ static void handle_new_pointer(struct wb_server *server, struct wlr_input_device
|
|||
libinput_device_config_scroll_set_natural_scroll_enabled(libinput_handle,
|
||||
libinput_config_get_enabled(config->libinput_config.natural_scroll));
|
||||
}
|
||||
if (config->libinput_config.scroll_button) {
|
||||
int button = libevdev_event_code_from_name(EV_KEY, config->libinput_config.scroll_button);
|
||||
if (button != -1) {
|
||||
libinput_device_config_scroll_set_button(libinput_handle, button);
|
||||
}
|
||||
}
|
||||
if (config->libinput_config.scroll_button_lock) {
|
||||
libinput_device_config_scroll_set_button_lock(libinput_handle,
|
||||
libinput_config_get_enabled(config->libinput_config.scroll_button_lock));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue