Implement keyboard LEDs

This commit is contained in:
Drew DeVault 2017-06-19 15:15:37 -04:00
parent ecb04afcad
commit 632a04f1b7
6 changed files with 59 additions and 1 deletions

View file

@ -23,6 +23,7 @@ void wlr_output_free(struct wlr_output *output);
struct wlr_keyboard_impl {
void (*destroy)(struct wlr_keyboard_state *state);
void (*led_update)(struct wlr_keyboard_state *state, uint32_t leds);
};
struct wlr_keyboard *wlr_keyboard_create(struct wlr_keyboard_impl *impl,

View file

@ -53,18 +53,28 @@ void wlr_output_destroy(struct wlr_output *output);
void wlr_output_effective_resolution(struct wlr_output *output,
int *width, int *height);
enum WLR_KEYBOARD_LED {
WLR_LED_NUM_LOCK = 1,
WLR_LED_CAPS_LOCK = 2,
WLR_LED_SCROLL_LOCK = 4,
WLR_LED_LAST
};
struct wlr_keyboard_state;
struct wlr_keyboard_impl;
struct wlr_keyboard {
struct wlr_keyboard_state *state;
struct wlr_keyboard_impl *impl;
uint32_t leds;
struct {
struct wl_signal key;
} events;
};
void wlr_keyboard_led_update(struct wlr_keyboard *keyboard, uint32_t leds);
enum wlr_key_state {
WLR_KEY_RELEASED,
WLR_KEY_PRESSED,