add ctrl support for x11 demos
This commit is contained in:
parent
5d81d324c4
commit
7fafcb3ac7
@ -704,6 +704,7 @@ nk_xlib_handle_event(Display *dpy, int screen, Window win, XEvent *evt)
|
|||||||
int ret, down = (evt->type == KeyPress);
|
int ret, down = (evt->type == KeyPress);
|
||||||
KeySym *code = XGetKeyboardMapping(xlib.surf->dpy, (KeyCode)evt->xkey.keycode, 1, &ret);
|
KeySym *code = XGetKeyboardMapping(xlib.surf->dpy, (KeyCode)evt->xkey.keycode, 1, &ret);
|
||||||
if (*code == XK_Shift_L || *code == XK_Shift_R) nk_input_key(ctx, NK_KEY_SHIFT, down);
|
if (*code == XK_Shift_L || *code == XK_Shift_R) nk_input_key(ctx, NK_KEY_SHIFT, down);
|
||||||
|
else if (*code == XK_Control_L || *code == XK_Control_R) nk_input_key(ctx, NK_KEY_CTRL, down);
|
||||||
else if (*code == XK_Delete) nk_input_key(ctx, NK_KEY_DEL, down);
|
else if (*code == XK_Delete) nk_input_key(ctx, NK_KEY_DEL, down);
|
||||||
else if (*code == XK_Return) nk_input_key(ctx, NK_KEY_ENTER, down);
|
else if (*code == XK_Return) nk_input_key(ctx, NK_KEY_ENTER, down);
|
||||||
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);
|
||||||
|
@ -249,6 +249,7 @@ nk_x11_handle_event(XEvent *evt)
|
|||||||
int ret, down = (evt->type == KeyPress);
|
int ret, down = (evt->type == KeyPress);
|
||||||
KeySym *code = XGetKeyboardMapping(x11.dpy, (KeyCode)evt->xkey.keycode, 1, &ret);
|
KeySym *code = XGetKeyboardMapping(x11.dpy, (KeyCode)evt->xkey.keycode, 1, &ret);
|
||||||
if (*code == XK_Shift_L || *code == XK_Shift_R) nk_input_key(ctx, NK_KEY_SHIFT, down);
|
if (*code == XK_Shift_L || *code == XK_Shift_R) nk_input_key(ctx, NK_KEY_SHIFT, down);
|
||||||
|
else if (*code == XK_Control_L || *code == XK_Control_R) nk_input_key(ctx, NK_KEY_CTRL, down);
|
||||||
else if (*code == XK_Delete) nk_input_key(ctx, NK_KEY_DEL, down);
|
else if (*code == XK_Delete) nk_input_key(ctx, NK_KEY_DEL, down);
|
||||||
else if (*code == XK_Return) nk_input_key(ctx, NK_KEY_ENTER, down);
|
else if (*code == XK_Return) nk_input_key(ctx, NK_KEY_ENTER, down);
|
||||||
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);
|
||||||
|
@ -618,6 +618,7 @@ nk_x11_handle_event(XEvent *evt)
|
|||||||
int ret, down = (evt->type == KeyPress);
|
int ret, down = (evt->type == KeyPress);
|
||||||
KeySym *code = XGetKeyboardMapping(x11.dpy, (KeyCode)evt->xkey.keycode, 1, &ret);
|
KeySym *code = XGetKeyboardMapping(x11.dpy, (KeyCode)evt->xkey.keycode, 1, &ret);
|
||||||
if (*code == XK_Shift_L || *code == XK_Shift_R) nk_input_key(ctx, NK_KEY_SHIFT, down);
|
if (*code == XK_Shift_L || *code == XK_Shift_R) nk_input_key(ctx, NK_KEY_SHIFT, down);
|
||||||
|
else if (*code == XK_Control_L || *code == XK_Control_R) nk_input_key(ctx, NK_KEY_CTRL, down);
|
||||||
else if (*code == XK_Delete) nk_input_key(ctx, NK_KEY_DEL, down);
|
else if (*code == XK_Delete) nk_input_key(ctx, NK_KEY_DEL, down);
|
||||||
else if (*code == XK_Return) nk_input_key(ctx, NK_KEY_ENTER, down);
|
else if (*code == XK_Return) nk_input_key(ctx, NK_KEY_ENTER, down);
|
||||||
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);
|
||||||
|
@ -175,6 +175,7 @@ nk_xlib_handle_event(Display *dpy, int screen, Window win, XEvent *evt, struct r
|
|||||||
int ret, down = (evt->type == KeyPress);
|
int ret, down = (evt->type == KeyPress);
|
||||||
KeySym *code = XGetKeyboardMapping(xlib.dpy, (KeyCode)evt->xkey.keycode, 1, &ret);
|
KeySym *code = XGetKeyboardMapping(xlib.dpy, (KeyCode)evt->xkey.keycode, 1, &ret);
|
||||||
if (*code == XK_Shift_L || *code == XK_Shift_R) nk_input_key(&rawfb->ctx, NK_KEY_SHIFT, down);
|
if (*code == XK_Shift_L || *code == XK_Shift_R) nk_input_key(&rawfb->ctx, NK_KEY_SHIFT, down);
|
||||||
|
else if (*code == XK_Control_L || *code == XK_Control_R) nk_input_key(&rawfb->ctx, NK_KEY_CTRL, down);
|
||||||
else if (*code == XK_Delete) nk_input_key(&rawfb->ctx, NK_KEY_DEL, down);
|
else if (*code == XK_Delete) nk_input_key(&rawfb->ctx, NK_KEY_DEL, down);
|
||||||
else if (*code == XK_Return) nk_input_key(&rawfb->ctx, NK_KEY_ENTER, down);
|
else if (*code == XK_Return) nk_input_key(&rawfb->ctx, NK_KEY_ENTER, down);
|
||||||
else if (*code == XK_Tab) nk_input_key(&rawfb->ctx, NK_KEY_TAB, down);
|
else if (*code == XK_Tab) nk_input_key(&rawfb->ctx, NK_KEY_TAB, down);
|
||||||
|
@ -782,6 +782,7 @@ nk_xlib_handle_event(Display *dpy, int screen, Window win, XEvent *evt)
|
|||||||
int ret, down = (evt->type == KeyPress);
|
int ret, down = (evt->type == KeyPress);
|
||||||
KeySym *code = XGetKeyboardMapping(xlib.surf->dpy, (KeyCode)evt->xkey.keycode, 1, &ret);
|
KeySym *code = XGetKeyboardMapping(xlib.surf->dpy, (KeyCode)evt->xkey.keycode, 1, &ret);
|
||||||
if (*code == XK_Shift_L || *code == XK_Shift_R) nk_input_key(ctx, NK_KEY_SHIFT, down);
|
if (*code == XK_Shift_L || *code == XK_Shift_R) nk_input_key(ctx, NK_KEY_SHIFT, down);
|
||||||
|
else if (*code == XK_Control_L || *code == XK_Control_R) nk_input_key(ctx, NK_KEY_CTRL, down);
|
||||||
else if (*code == XK_Delete) nk_input_key(ctx, NK_KEY_DEL, down);
|
else if (*code == XK_Delete) nk_input_key(ctx, NK_KEY_DEL, down);
|
||||||
else if (*code == XK_Return) nk_input_key(ctx, NK_KEY_ENTER, down);
|
else if (*code == XK_Return) nk_input_key(ctx, NK_KEY_ENTER, down);
|
||||||
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);
|
||||||
|
Loading…
Reference in New Issue
Block a user