rnd-19981019-1
authorHolger Schemel <info@artsoft.org>
Mon, 19 Oct 1998 08:31:48 +0000 (10:31 +0200)
committerHolger Schemel <info@artsoft.org>
Sat, 30 Aug 2014 08:31:15 +0000 (10:31 +0200)
src/screens.c

index d728c42a24a4ac7ec2eeabd1fb9415f9b01937ba..37722a2468e215423cbd3b283ce6e689af6a31cb 100644 (file)
@@ -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__