aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwill <william.calliari@gmail.com>2020-10-17 16:18:44 +0200
committerwill <william.calliari@gmail.com>2020-10-17 16:18:44 +0200
commit7ad14a966087178cee752ac4bb63b14bd64ce5ec (patch)
tree3fedf0b8a773ca3be0498b8f3194fac32a02acf7
parent598516d808784c928700d4416488f3574c55244d (diff)
Added support for natural scrolling
-rw-r--r--config.def.h1
-rw-r--r--dwl.c5
2 files changed, 6 insertions, 0 deletions
diff --git a/config.def.h b/config.def.h
index c1ad7d6..2c11fd3 100644
--- a/config.def.h
+++ b/config.def.h
@@ -44,6 +44,7 @@ static const struct xkb_rule_names xkb_rules = {
/* Trackpad */
int tap_to_click = 1;
+int natural_scrolling = 1;
static const int repeat_rate = 25;
static const int repeat_delay = 600;
diff --git a/dwl.c b/dwl.c
index 69485ec..5895c65 100644
--- a/dwl.c
+++ b/dwl.c
@@ -607,8 +607,13 @@ createpointer(struct wlr_input_device *device)
{
struct libinput_device *libinput_device = (struct libinput_device*)
wlr_libinput_get_device_handle(device);
+
if (tap_to_click && libinput_device_config_tap_get_finger_count(libinput_device))
libinput_device_config_tap_set_enabled(libinput_device, LIBINPUT_CONFIG_TAP_ENABLED);
+
+ if (libinput_device_config_scroll_has_natural_scroll(libinput_device))
+ libinput_device_config_scroll_set_natural_scroll_enabled(libinput_device, natural_scrolling);
+
/* We don't do anything special with pointers. All of our pointer handling
* is proxied through wlr_cursor. On another compositor, you might take this
* opportunity to do libinput configuration on the device to set