Add support for key press and release events.

This commit is contained in:
2022-12-23 10:18:26 +01:00
parent ffffffaa79
commit 61cfdbccf3
5 changed files with 147 additions and 4 deletions

View File

@ -21,9 +21,10 @@
#include <GLES3/gl32.h>
#include <X11/Xlib.h>
static Display * rk_display = nullptr;
Display * rk_display = nullptr;
Window rk_window = 0;
extern unsigned rk_events_mask;
static Colormap rk_colormap = 0;
static Window rk_window = 0;
static GLXContext rk_context = nullptr;
static bool rk_error_occured = false;
@ -146,7 +147,7 @@ rk_window_t rk_create_context(
swa.colormap = rk_colormap;
swa.background_pixmap = None;
swa.border_pixel = 0;
swa.event_mask = StructureNotifyMask;
swa.event_mask = rk_events_mask;
rk_window = XCreateWindow(rk_display, RootWindow(rk_display, vi->screen),
0, 0, width, height, 0, vi->depth, InputOutput, vi->visual,
CWBorderPixel | CWColormap | CWEventMask, &swa);