2019-03-16 15:31:58 +00:00
|
|
|
/* Copyright (c), Charlotte Meyer <dev@buffet.sh>
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
|
|
|
* You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef KIWMI_INPUT_KEYBOARD_H
|
|
|
|
#define KIWMI_INPUT_KEYBOARD_H
|
|
|
|
|
2020-08-27 20:48:15 +00:00
|
|
|
#include <stdint.h>
|
|
|
|
|
2019-03-16 15:31:58 +00:00
|
|
|
#include <wayland-server.h>
|
2020-01-04 23:22:45 +00:00
|
|
|
#include <xkbcommon/xkbcommon.h>
|
2019-03-16 15:31:58 +00:00
|
|
|
|
|
|
|
struct kiwmi_keyboard {
|
|
|
|
struct wl_list link;
|
|
|
|
struct kiwmi_server *server;
|
|
|
|
struct wlr_input_device *device;
|
|
|
|
struct wl_listener modifiers;
|
|
|
|
struct wl_listener key;
|
2020-01-15 22:47:29 +00:00
|
|
|
struct wl_listener device_destroy;
|
2020-01-04 23:22:45 +00:00
|
|
|
|
|
|
|
struct {
|
|
|
|
struct wl_signal key_down;
|
|
|
|
struct wl_signal key_up;
|
2020-01-15 22:47:29 +00:00
|
|
|
struct wl_signal destroy;
|
2020-01-04 23:22:45 +00:00
|
|
|
} events;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct kiwmi_keyboard_key_event {
|
2020-08-27 20:48:15 +00:00
|
|
|
const xkb_keysym_t *raw_syms;
|
|
|
|
const xkb_keysym_t *translated_syms;
|
|
|
|
int raw_syms_len;
|
|
|
|
int translated_syms_len;
|
|
|
|
uint32_t keycode;
|
2020-01-04 23:22:45 +00:00
|
|
|
struct kiwmi_keyboard *keyboard;
|
|
|
|
bool handled;
|
2019-03-16 15:31:58 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct kiwmi_keyboard *
|
|
|
|
keyboard_create(struct kiwmi_server *server, struct wlr_input_device *device);
|
2021-12-04 17:25:31 +00:00
|
|
|
void keyboard_destroy(struct kiwmi_keyboard *keyboard);
|
2019-03-16 15:31:58 +00:00
|
|
|
|
|
|
|
#endif /* KIWMI_INPUT_KEYBOARD_H */
|