Put unicode text input back into xlib demo

This commit is contained in:
vurtun 2016-04-14 21:01:38 +02:00
parent b2c87ed7c0
commit e418ae8c02
2 changed files with 3 additions and 6 deletions

View File

@ -140,7 +140,6 @@ main(void)
if (nk_option_label(ctx, "hard", op == HARD)) op = HARD;
nk_layout_row_dynamic(ctx, 22, 1);
nk_property_int(ctx, "Compression:", 0, &property, 100, 10, 1);
nk_layout_row_dynamic(ctx, 100, 1);
}
nk_end(ctx);}
if (nk_window_is_closed(ctx, "Demo")) break;

View File

@ -479,11 +479,9 @@ nk_xlib_handle_event(Display *dpy, int screen, Window win, XEvent *evt)
nk_input_key(ctx, NK_KEY_TEXT_LINE_END, down);
else if (!down) {
char buf[32];
if ((*code >= 'a' && *code <= 'z') || (*code >= 'A' && *code <= 'Z')) {
KeySym keysym = 0;
if (XLookupString((XKeyEvent*)evt, buf, 32, &keysym, NULL) != NoSymbol)
nk_input_glyph(ctx, buf);
}
KeySym keysym = 0;
if (XLookupString((XKeyEvent*)evt, buf, 32, &keysym, NULL) != NoSymbol)
nk_input_glyph(ctx, buf);
}
}
XFree(code);