Documentation for <wlr/types/wlr_keyboard.h>

Back to index

Table of contents

struct wlr_keyboard

struct wlr_keyboard {
	struct wlr_input_device base;
	const struct wlr_keyboard_impl *impl;
	struct wlr_keyboard_group *group;
	char *keymap_string;
	size_t keymap_size;
	int keymap_fd;
	struct xkb_keymap *keymap;
	struct xkb_state *xkb_state;
	xkb_led_index_t led_indexes[];
	xkb_mod_index_t mod_indexes[];
	uint32_t keycodes[];
	size_t num_keycodes;
	struct wlr_keyboard_modifiers modifiers;
	struct {
		int32_t rate;
		int32_t delay;
	} repeat_info;
	struct {
		struct wl_signal key;
		struct wl_signal modifiers;
		struct wl_signal keymap;
		struct wl_signal repeat_info;
	} events;
	void *data;
};

wlr_keyboard_get_modifiers()

uint32_t wlr_keyboard_get_modifiers(​struct wlr_keyboard *keyboard);

struct wlr_keyboard_key_event

struct wlr_keyboard_key_event {
	uint32_t time_msec;
	uint32_t keycode;
	bool update_state;
	enum wl_keyboard_key_state state;
};

wlr_keyboard_keymaps_match()

bool wlr_keyboard_keymaps_match(​struct xkb_keymap *km1, struct xkb_keymap *km2);

enum wlr_keyboard_led

enum wlr_keyboard_led {
	WLR_LED_NUM_LOCK,
	WLR_LED_CAPS_LOCK,
	WLR_LED_SCROLL_LOCK,
};

wlr_keyboard_led_update()

void wlr_keyboard_led_update(​struct wlr_keyboard *keyboard, uint32_t leds);

enum wlr_keyboard_modifier

enum wlr_keyboard_modifier {
	WLR_MODIFIER_SHIFT,
	WLR_MODIFIER_CAPS,
	WLR_MODIFIER_CTRL,
	WLR_MODIFIER_ALT,
	WLR_MODIFIER_MOD2,
	WLR_MODIFIER_MOD3,
	WLR_MODIFIER_LOGO,
	WLR_MODIFIER_MOD5,
};

struct wlr_keyboard_modifiers

struct wlr_keyboard_modifiers {
	xkb_mod_mask_t depressed;
	xkb_mod_mask_t latched;
	xkb_mod_mask_t locked;
	xkb_mod_mask_t group;
};

wlr_keyboard_set_keymap()

bool wlr_keyboard_set_keymap(​struct wlr_keyboard *kb, struct xkb_keymap *keymap);

wlr_keyboard_set_repeat_info()

void wlr_keyboard_set_repeat_info(​struct wlr_keyboard *kb, int32_t rate, int32_t delay);

Sets the keyboard repeat info. `rate` is in key repeats/second and delay is in milliseconds.