From: Holger Schemel Date: Mon, 19 Oct 1998 08:31:48 +0000 (+0200) Subject: rnd-19981019-1 X-Git-Tag: 1.2.0^2~52 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=c9d8e4e56f2c15baf85f2344043899c9782bddd2;p=rocksndiamonds.git rnd-19981019-1 --- diff --git a/src/screens.c b/src/screens.c index d728c42a..37722a24 100644 --- a/src/screens.c +++ b/src/screens.c @@ -1135,6 +1135,61 @@ void HandleSetupScreen(int mx, int my, int dx, int dy, int button) DoAnimation(); } +static int readJoystick_TEST() +{ + int result = -1; + + InitAnimation(); + + while(result < 0) + { + DoAnimation(); + Delay(10); + + if (XPending(display)) + { + XEvent event; + + XNextEvent(display, &event); + switch(event.type) + { + case Expose: + HandleExposeEvent((XExposeEvent *) &event); + break; + case UnmapNotify: + SleepWhileUnmapped(); + break; + case KeyPress: + switch(XLookupKeysym((XKeyEvent *)&event, + ((XKeyEvent *)&event)->state)) + { + case XK_Return: + result = 1; + break; + case XK_Escape: + result = 0; + break; + } + break; + case KeyRelease: + key_joystick_mapping = 0; + break; + case FocusIn: + case FocusOut: + HandleFocusEvent((XFocusChangeEvent *) &event); + break; + case ClientMessage: + HandleClientMessageEvent((XClientMessageEvent *) &event); + break; + default: + break; + } + } + } + + StopAnimation(); +} + void CalibrateJoystick() { #ifdef __FreeBSD__