diff options
Diffstat (limited to 'pugl/pugl_x11.c')
-rw-r--r-- | pugl/pugl_x11.c | 40 |
1 files changed, 19 insertions, 21 deletions
diff --git a/pugl/pugl_x11.c b/pugl/pugl_x11.c index b22b1ce..c180a9a 100644 --- a/pugl/pugl_x11.c +++ b/pugl/pugl_x11.c @@ -232,14 +232,14 @@ keySymToSpecial(KeySym sym) case XK_Home: return PUGL_KEY_HOME; case XK_End: return PUGL_KEY_END; case XK_Insert: return PUGL_KEY_INSERT; - case XK_Shift_L: return PUGL_KEY_SHIFT_L; - case XK_Shift_R: return PUGL_KEY_SHIFT_R; - case XK_Control_L: return PUGL_KEY_CTRL_L; - case XK_Control_R: return PUGL_KEY_CTRL_R; - case XK_Alt_L: return PUGL_KEY_ALT_L; - case XK_Alt_R: return PUGL_KEY_ALT_R; - case XK_Super_L: return PUGL_KEY_SUPER_L; - case XK_Super_R: return PUGL_KEY_SUPER_R; + case XK_Shift_L: return PUGL_KEY_SHIFT; + case XK_Shift_R: return PUGL_KEY_SHIFT; + case XK_Control_L: return PUGL_KEY_CTRL; + case XK_Control_R: return PUGL_KEY_CTRL; + case XK_Alt_L: return PUGL_KEY_ALT; + case XK_Alt_R: return PUGL_KEY_ALT; + case XK_Super_L: return PUGL_KEY_SUPER; + case XK_Super_R: return PUGL_KEY_SUPER; } return (PuglKey)0; } @@ -314,20 +314,18 @@ puglProcessEvents(PuglView* view) break; case KeyPress: setModifiers(view, event.xkey.state); - if (view->keyboardFunc) { - KeySym sym; - char str[5]; - int n = XLookupString(&event.xkey, str, 4, &sym, NULL); - PuglKey key = keySymToSpecial(sym); - if (!key) { - if (n == 1) { - view->keyboardFunc(view, true, str[0]); - } else { - fprintf(stderr, "warning: Unknown key %X\n", (int)sym); - } - } else if (view->specialFunc) { - view->specialFunc(view, true, key); + KeySym sym; + char str[5]; + int n = XLookupString(&event.xkey, str, 4, &sym, NULL); + PuglKey key = keySymToSpecial(sym); + if (!key && view->keyboardFunc) { + if (n == 1) { + view->keyboardFunc(view, true, str[0]); + } else { + fprintf(stderr, "warning: Unknown key %X\n", (int)sym); } + } else if (view->specialFunc) { + view->specialFunc(view, true, key); } break; case KeyRelease: { |