aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/sway/input.h18
-rw-r--r--meson.build1
-rw-r--r--sway/meson.build2
-rw-r--r--sway/server.c4
4 files changed, 25 insertions, 0 deletions
diff --git a/include/sway/input.h b/include/sway/input.h
new file mode 100644
index 00000000..21ed61c5
--- /dev/null
+++ b/include/sway/input.h
@@ -0,0 +1,18 @@
+#ifndef _SWAY_INPUT_H
+#define _SWAY_INPUT_H
+#include <libinput.h>
+#include "sway/server.h"
+#include "config.h"
+#include "list.h"
+
+struct sway_input {
+ list_t *input_devices;
+};
+
+struct input_config *new_input_config(const char* identifier);
+
+char* libinput_dev_unique_id(struct libinput_device *dev);
+
+struct sway_input *sway_input_create(struct sway_server *server);
+
+#endif
diff --git a/meson.build b/meson.build
index 8e7b98ed..029aea46 100644
--- a/meson.build
+++ b/meson.build
@@ -29,6 +29,7 @@ xkbcommon = dependency('xkbcommon')
pango = dependency('pango')
pixman = dependency('pixman-1')
libcap = dependency('libcap')
+libinput = dependency('libinput')
math = cc.find_library('m')
git = find_program('git', required: false)
a2x = find_program('a2x', required: false)
diff --git a/sway/meson.build b/sway/meson.build
index 84f48137..8631b9c3 100644
--- a/sway/meson.build
+++ b/sway/meson.build
@@ -2,6 +2,7 @@ sway_sources = files(
'main.c',
'server.c',
'commands.c',
+ 'input/input.c',
'commands/exit.c',
'commands/exec.c',
'commands/exec_always.c',
@@ -25,6 +26,7 @@ sway_deps = [
wlroots,
libcap,
math,
+ libinput,
]
executable(
diff --git a/sway/server.c b/sway/server.c
index 024d8429..3873e625 100644
--- a/sway/server.c
+++ b/sway/server.c
@@ -11,6 +11,7 @@
// TODO WLR: make Xwayland optional
#include <wlr/xwayland.h>
#include "sway/server.h"
+#include "sway/input.h"
#include "log.h"
bool server_init(struct sway_server *server) {
@@ -58,6 +59,9 @@ bool server_init(struct sway_server *server) {
wlr_backend_destroy(server->backend);
return false;
}
+
+ server->input = sway_input_create(server);
+
return true;
}