Skip to content

Commit

Permalink
Put unicode text input back into xlib demo
Browse files Browse the repository at this point in the history
  • Loading branch information
vurtun committed Apr 14, 2016
1 parent b2c87ed commit e418ae8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
1 change: 0 additions & 1 deletion demo/x11/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
8 changes: 3 additions & 5 deletions demo/x11/nuklear_xlib.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit e418ae8

Please sign in to comment.