aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/rootston/config.h9
-rw-r--r--include/rootston/input.h4
-rw-r--r--include/wlr/types/wlr_keyboard.h35
-rw-r--r--include/wlr/types/wlr_seat.h1
4 files changed, 43 insertions, 6 deletions
diff --git a/include/rootston/config.h b/include/rootston/config.h
index 0832d88d..ece11829 100644
--- a/include/rootston/config.h
+++ b/include/rootston/config.h
@@ -18,6 +18,14 @@ struct device_config {
struct wl_list link;
};
+struct binding_config {
+ uint32_t modifiers;
+ xkb_keysym_t *keysyms;
+ size_t keysyms_len;
+ char *command;
+ struct wl_list link;
+};
+
struct roots_config {
// TODO: Multiple cursors, multiseat
struct {
@@ -27,6 +35,7 @@ struct roots_config {
struct wl_list outputs;
struct wl_list devices;
+ struct wl_list bindings;
char *config_path;
};
diff --git a/include/rootston/input.h b/include/rootston/input.h
index ecd53f3b..6161eb7a 100644
--- a/include/rootston/input.h
+++ b/include/rootston/input.h
@@ -10,11 +10,15 @@
#include "rootston/view.h"
#include "rootston/server.h"
+#define ROOTS_KEYBOARD_PRESSED_KEYSYMS_CAP 32
+
struct roots_keyboard {
struct roots_input *input;
struct wlr_input_device *device;
struct wl_listener key;
struct wl_list link;
+
+ xkb_keysym_t pressed_keysyms[ROOTS_KEYBOARD_PRESSED_KEYSYMS_CAP];
};
struct roots_pointer {
diff --git a/include/wlr/types/wlr_keyboard.h b/include/wlr/types/wlr_keyboard.h
index af205c63..9ec8ddd4 100644
--- a/include/wlr/types/wlr_keyboard.h
+++ b/include/wlr/types/wlr_keyboard.h
@@ -6,11 +6,25 @@
#include <wayland-server.h>
#include <xkbcommon/xkbcommon.h>
-enum WLR_KEYBOARD_LED {
+#define WLR_LED_COUNT 3
+
+enum wlr_keyboard_led {
WLR_LED_NUM_LOCK = 1,
WLR_LED_CAPS_LOCK = 2,
WLR_LED_SCROLL_LOCK = 4,
- WLR_LED_LAST
+};
+
+#define WLR_MODIFIER_COUNT 8
+
+enum wlr_keyboard_modifier {
+ WLR_MODIFIER_SHIFT = 1,
+ WLR_MODIFIER_CAPS = 2,
+ WLR_MODIFIER_CTRL = 4,
+ WLR_MODIFIER_ALT = 8,
+ WLR_MODIFIER_MOD2 = 16,
+ WLR_MODIFIER_MOD3 = 32,
+ WLR_MODIFIER_LOGO = 64,
+ WLR_MODIFIER_MOD5 = 128,
};
struct wlr_keyboard_impl;
@@ -23,18 +37,25 @@ struct wlr_keyboard {
size_t keymap_size;
struct xkb_keymap *keymap;
struct xkb_state *xkb_state;
- xkb_led_index_t leds[WLR_LED_LAST];
+ xkb_led_index_t led_indexes[WLR_LED_COUNT];
+ xkb_mod_index_t mod_indexes[WLR_MODIFIER_COUNT];
+
+ struct {
+ xkb_mod_mask_t depressed;
+ xkb_mod_mask_t latched;
+ xkb_mod_mask_t locked;
+ xkb_mod_mask_t group;
+ } modifiers;
struct {
struct wl_signal key;
+ struct wl_signal modifiers;
struct wl_signal keymap;
} events;
void *data;
};
-void wlr_keyboard_led_update(struct wlr_keyboard *keyboard, uint32_t leds);
-
enum wlr_key_state {
WLR_KEY_RELEASED,
WLR_KEY_PRESSED,
@@ -48,6 +69,8 @@ struct wlr_event_keyboard_key {
};
void wlr_keyboard_set_keymap(struct wlr_keyboard *kb,
- struct xkb_keymap *keymap);
+ struct xkb_keymap *keymap);
+void wlr_keyboard_led_update(struct wlr_keyboard *keyboard, uint32_t leds);
+uint32_t wlr_keyboard_get_modifiers(struct wlr_keyboard *keyboard);
#endif
diff --git a/include/wlr/types/wlr_seat.h b/include/wlr/types/wlr_seat.h
index 6927cd16..489bd529 100644
--- a/include/wlr/types/wlr_seat.h
+++ b/include/wlr/types/wlr_seat.h
@@ -37,6 +37,7 @@ struct wlr_seat_keyboard {
struct wlr_seat *seat;
struct wlr_keyboard *keyboard;
struct wl_listener key;
+ struct wl_listener modifiers;
struct wl_listener keymap;
struct wl_listener destroy;
struct wl_list link;