Added missing X11 key up and down event handling

This commit is contained in:
vurtun 2016-11-14 19:10:36 +01:00
parent 34b12bd402
commit 4a4fdf1976
2 changed files with 4 additions and 0 deletions

View File

@ -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_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_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_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_BackSpace) nk_input_key(ctx, NK_KEY_BACKSPACE, down);
else if (*code == XK_space && !down) nk_input_char(ctx, ' '); 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); else if (*code == XK_Page_Up) nk_input_key(ctx, NK_KEY_SCROLL_UP, down);

View File

@ -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_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_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_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_BackSpace) nk_input_key(ctx, NK_KEY_BACKSPACE, down);
else if (*code == XK_space && !down) nk_input_char(ctx, ' '); 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); else if (*code == XK_Page_Up) nk_input_key(ctx, NK_KEY_SCROLL_UP, down);