Файл для обработки ввода

This commit is contained in:
2025-11-17 13:41:46 +03:00
parent bc5bf92fee
commit b8ebf31762
8 changed files with 69 additions and 33 deletions

View File

@@ -0,0 +1,10 @@
#ifndef INPUT_HANDLE_H
#define INPUT_HANDLE_H
#include <xkbcommon/xkbcommon.h>
#include "window.h"
#include "input.h"
void keyboard_key_handle(xkb_keycode_t kc, xkb_keysym_t ks, enum keyboard_key_state state, struct wayland_window* window);
#endif

View File

@@ -8,7 +8,19 @@ void input_register_seat(struct wl_seat *seat);
/* Очистка input (разрушить keyboard и xkb state) */
void input_cleanup(void);
/* Возвращает wl_surface, имеющую фокус клавиатуры или NULL */
struct wl_surface *input_get_keyboard_focus(void);
enum keyboard_key_state {
/**
* key is not pressed
*/
KEYBOARD_KEY_STATE_RELEASED = 0,
/**
* key is pressed
*/
KEYBOARD_KEY_STATE_PRESSED = 1,
/**
* key was repeated
*/
KEYBOARD_KEY_STATE_REPEATED = 2,
};
#endif

View File

@@ -15,4 +15,7 @@ void wait_for_windows(void);
/* Остановить оконные потоки, очистить input и закрыть соединение Wayland */
void destroy_wayland(void);
/* Поиск окна по wl_surface */
struct wayland_window* get_window_by_surface(struct wl_surface* surf);
#endif