From 315b13e4fd4d0117dca62455fbf294951add0ea3 Mon Sep 17 00:00:00 2001 From: Jamie Wilkinson Date: Mon, 23 Dec 2002 13:50:44 +0000 Subject: [PATCH] - Don't need the extra comparision, the switch statement has already done it. (Closes: #23) --- src/rw_x11.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/rw_x11.c b/src/rw_x11.c index 69cb80f..760abe9 100644 --- a/src/rw_x11.c +++ b/src/rw_x11.c @@ -928,7 +928,10 @@ int XLateKey(XKeyEvent *ev) /* Check to see if this is a repeated key. * (shamelessly lifted from icculus quake2 who * shamelessly lifted from SDL who - * shamelessly lifted from GII -- thanks guys! :) */ + * shamelessly lifted from GII -- thanks guys! :) + * + * This has bugs if two keys are being pressed simultaneously and the events + * start getting interleaved */ int X11_KeyRepeat(Display * dpy, XEvent * evt) { XEvent peekevt; int repeated = 0; @@ -961,12 +964,12 @@ void HandleEvents(void) case KeyPress: myxtime = event.xkey.time; if (in_state && in_state->Key_Event_fp) - in_state->Key_Event_fp(XLateKey(&event.xkey), event.type == KeyPress); + in_state->Key_Event_fp(XLateKey(&event.xkey), true); break; case KeyRelease: if (!X11_KeyRepeat(dpy, &event)) { if (in_state && in_state->Key_Event_fp) - in_state->Key_Event_fp (XLateKey(&event.xkey), event.type == KeyPress); + in_state->Key_Event_fp(XLateKey(&event.xkey), false); } break;