From 4a4fdf1976866fca93e74c53e2817542bb52bfa0 Mon Sep 17 00:00:00 2001 From: vurtun Date: Mon, 14 Nov 2016 19:10:36 +0100 Subject: [PATCH] Added missing X11 key up and down event handling --- demo/x11_opengl2/nuklear_xlib_gl2.h | 2 ++ demo/x11_opengl3/nuklear_xlib_gl3.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/demo/x11_opengl2/nuklear_xlib_gl2.h b/demo/x11_opengl2/nuklear_xlib_gl2.h index 38787df..a814455 100644 --- a/demo/x11_opengl2/nuklear_xlib_gl2.h +++ b/demo/x11_opengl2/nuklear_xlib_gl2.h @@ -241,6 +241,8 @@ nk_x11_handle_event(XEvent *evt) else if (*code == XK_Tab) nk_input_key(ctx, NK_KEY_TAB, down); else if (*code == XK_Left) nk_input_key(ctx, NK_KEY_LEFT, down); else if (*code == XK_Right) nk_input_key(ctx, NK_KEY_RIGHT, down); + else if (*code == XK_Up) nk_input_key(ctx, NK_KEY_UP, down); + else if (*code == XK_Down) nk_input_key(ctx, NK_KEY_DOWN, down); else if (*code == XK_BackSpace) nk_input_key(ctx, NK_KEY_BACKSPACE, down); else if (*code == XK_space && !down) nk_input_char(ctx, ' '); else if (*code == XK_Page_Up) nk_input_key(ctx, NK_KEY_SCROLL_UP, down); diff --git a/demo/x11_opengl3/nuklear_xlib_gl3.h b/demo/x11_opengl3/nuklear_xlib_gl3.h index f176c5f..b0f56b9 100644 --- a/demo/x11_opengl3/nuklear_xlib_gl3.h +++ b/demo/x11_opengl3/nuklear_xlib_gl3.h @@ -611,6 +611,8 @@ nk_x11_handle_event(XEvent *evt) else if (*code == XK_Tab) nk_input_key(ctx, NK_KEY_TAB, down); else if (*code == XK_Left) nk_input_key(ctx, NK_KEY_LEFT, down); else if (*code == XK_Right) nk_input_key(ctx, NK_KEY_RIGHT, down); + else if (*code == XK_Up) nk_input_key(ctx, NK_KEY_UP, down); + else if (*code == XK_Down) nk_input_key(ctx, NK_KEY_DOWN, down); else if (*code == XK_BackSpace) nk_input_key(ctx, NK_KEY_BACKSPACE, down); else if (*code == XK_space && !down) nk_input_char(ctx, ' '); else if (*code == XK_Page_Up) nk_input_key(ctx, NK_KEY_SCROLL_UP, down);