From c21df94757db6c298f0481d1a7efb13698a29a78 Mon Sep 17 00:00:00 2001 From: Roman Pytkov Date: Mon, 17 Nov 2025 13:45:23 +0300 Subject: [PATCH] =?UTF-8?q?=D0=97=D0=B0=D0=BF=D1=83=D1=81=D0=BA=20=D0=BE?= =?UTF-8?q?=D0=BA=D0=BE=D0=BD=20wayland=20=D0=BD=D0=B0=20Return?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wayland/src/input-handle.c | 17 +++++++++++++++-- wayland/src/wayland-runtime.c | 2 -- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/wayland/src/input-handle.c b/wayland/src/input-handle.c index a774eb9..8305499 100644 --- a/wayland/src/input-handle.c +++ b/wayland/src/input-handle.c @@ -1,4 +1,5 @@ #include "input-handle.h" +#include "wayland-runtime.h" void keyboard_key_handle(xkb_keycode_t kc, xkb_keysym_t ks, enum keyboard_key_state state, struct wayland_window *window) { @@ -6,11 +7,23 @@ void keyboard_key_handle(xkb_keycode_t kc, xkb_keysym_t ks, enum keyboard_key_st { char buf[64]; int n = xkb_keysym_to_utf8(ks, buf, sizeof(buf)); - if (ks == XKB_KEY_Return) - sprintf(buf, "Return"); + if (n > 0) printf("keyboard: symbol '%s' (keysym 0x%x) on surface:%p\n", buf, ks, window); else printf("keyboard: keysym 0x%x (no UTF-8 representation)\n", ks); + + if(state == KEYBOARD_KEY_STATE_PRESSED) + { + switch (ks) + { + case XKB_KEY_Return: + run_window(); + break; + + default: + break; + } + } } } \ No newline at end of file diff --git a/wayland/src/wayland-runtime.c b/wayland/src/wayland-runtime.c index ef6e2ff..86a4984 100644 --- a/wayland/src/wayland-runtime.c +++ b/wayland/src/wayland-runtime.c @@ -53,7 +53,6 @@ static void *window_thread_main(void *arg) if (window_init(g_display, slot->queue, &slot->window) < 0) { - input_cleanup(); wl_event_queue_destroy(slot->queue); slot->queue = NULL; signal_thread_exit(slot); @@ -73,7 +72,6 @@ static void *window_thread_main(void *arg) } printf("Window #%d closed\n", slot->window.id); - input_cleanup(); window_destroy(&slot->window); if (slot->queue)