Add KeyPress & KeyRelease events to X11 debug events logging

Compiled out by default, just used for debugging local builds.
This commit is contained in:
PouleyKetchoupp 2021-10-27 10:08:09 -07:00
parent 24fdedfe94
commit 0b17d4e57d

View file

@ -3367,11 +3367,18 @@ void DisplayServerX11::process_events() {
} break; } break;
case KeyPress: case KeyPress:
case KeyRelease: { case KeyRelease: {
#ifdef DISPLAY_SERVER_X11_DEBUG_LOGS_ENABLED
if (event.type == KeyPress) {
DEBUG_LOG_X11("[%u] KeyPress window=%lu (%u), keycode=%u, time=%lu \n", frame, event.xkey.window, window_id, event.xkey.keycode, event.xkey.time);
} else {
DEBUG_LOG_X11("[%u] KeyRelease window=%lu (%u), keycode=%u, time=%lu \n", frame, event.xkey.window, window_id, event.xkey.keycode, event.xkey.time);
}
#endif
last_timestamp = event.xkey.time; last_timestamp = event.xkey.time;
// key event is a little complex, so // key event is a little complex, so
// it will be handled in its own function. // it will be handled in its own function.
_handle_key_event(window_id, (XKeyEvent *)&event, events, event_index); _handle_key_event(window_id, &event.xkey, events, event_index);
} break; } break;
case SelectionNotify: case SelectionNotify: