aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pugl/pugl_x11.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/pugl/pugl_x11.c b/pugl/pugl_x11.c
index 47a5738..2d0dd76 100644
--- a/pugl/pugl_x11.c
+++ b/pugl/pugl_x11.c
@@ -248,15 +248,15 @@ keySymToSpecial(KeySym sym)
}
static void
-translateKey(PuglView* view, XEvent* xevent, PuglEvent* event)
+translateKey(PuglView* view, XEvent* xevent, PuglEventKey* event)
{
KeySym sym = 0;
- char* str = (char*)event->key.utf8;
+ char* str = (char*)event->utf8;
memset(str, 0, 8);
- event->key.filter = XFilterEvent(xevent, None);
- if (xevent->type == KeyRelease || event->key.filter || !view->impl->xic) {
+ event->filter = XFilterEvent(xevent, None);
+ if (xevent->type == KeyRelease || event->filter || !view->impl->xic) {
if (XLookupString(&xevent->xkey, str, 7, &sym, NULL) == 1) {
- event->key.character = str[0];
+ event->character = str[0];
}
} else {
/* TODO: Not sure about this. On my system, some characters work with
@@ -271,11 +271,11 @@ translateKey(PuglView* view, XEvent* xevent, PuglEvent* event)
view->impl->xic, &xevent->xkey, str, 7, &sym, &status);
#endif
if (n > 0) {
- event->key.character = puglDecodeUTF8((const uint8_t*)str);
+ event->character = puglDecodeUTF8((const uint8_t*)str);
}
}
- event->key.special = keySymToSpecial(sym);
- event->key.keycode = xevent->xkey.keycode;
+ event->special = keySymToSpecial(sym);
+ event->keycode = xevent->xkey.keycode;
}
static uint32_t
@@ -389,7 +389,7 @@ translateEvent(PuglView* view, XEvent xevent)
event.key.x_root = xevent.xkey.x_root;
event.key.y_root = xevent.xkey.y_root;
event.key.state = translateModifiers(xevent.xkey.state);
- translateKey(view, &xevent, &event);
+ translateKey(view, &xevent, &event.key);
break;
case EnterNotify:
case LeaveNotify: