Файл для обработки ввода
This commit is contained in:
16
wayland/src/input-handle.c
Normal file
16
wayland/src/input-handle.c
Normal file
@@ -0,0 +1,16 @@
|
||||
#include "input-handle.h"
|
||||
|
||||
void keyboard_key_handle(xkb_keycode_t kc, xkb_keysym_t ks, enum keyboard_key_state state, struct wayland_window *window)
|
||||
{
|
||||
if (ks != XKB_KEY_NoSymbol)
|
||||
{
|
||||
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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user