aboutsummaryrefslogtreecommitdiff
path: root/dwl.c
diff options
context:
space:
mode:
authorDevin J. Pohly <djpohly@gmail.com>2020-12-24 18:55:06 -0500
committerGitHub <noreply@github.com>2020-12-24 18:55:06 -0500
commitb6a3891ce6eeef0167c55acc0e89236572c1ae42 (patch)
tree60ede221ca888c7af296b8a5b206c30c62911d61 /dwl.c
parenta42613db9d9f6debfa4fb2363d75af9457d238ed (diff)
parent7ad14a966087178cee752ac4bb63b14bd64ce5ec (diff)
Merge pull request #62 from Java-boi/master
Added basic tap-to-click for touchpad users
Diffstat (limited to 'dwl.c')
-rw-r--r--dwl.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/dwl.c b/dwl.c
index 00b544f..c4c78f1 100644
--- a/dwl.c
+++ b/dwl.c
@@ -10,6 +10,7 @@
#include <sys/wait.h>
#include <time.h>
#include <unistd.h>
+#include <libinput.h>
#include <wayland-server-core.h>
#include <wlr/backend.h>
#include <wlr/render/wlr_renderer.h>
@@ -33,6 +34,7 @@
#include <wlr/types/wlr_xdg_decoration_v1.h>
#include <wlr/types/wlr_xdg_output_v1.h>
#include <wlr/types/wlr_xdg_shell.h>
+#include <wlr/backend/libinput.h>
#include <wlr/util/log.h>
#include <xkbcommon/xkbcommon.h>
#ifdef XWAYLAND
@@ -603,6 +605,15 @@ createnotify(struct wl_listener *listener, void *data)
void
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