rnd-20091022-1-src
[rocksndiamonds.git] / src / game_sp / Input.c
index 42ad1201ae2c8d4e93d35c27545d02b8a032bd70..a846aaf6e047dd37e50748014dc5856d1420bb89 100644 (file)
@@ -37,12 +37,33 @@ int subCheckRightMouseButton()
   return subCheckRightMouseButton;
 }
 
-int subProcessKeyboardInput()
+int subProcessKeyboardInput(byte action)
 {
   int subProcessKeyboardInput;
 
   static int LastKey = 0;
 
+#if 1
+
+  if (action & KEY_BUTTON)
+  {
+    DemoKeyCode = (action & MV_UP      ? keySpaceUp    :
+                  action & MV_LEFT     ? keySpaceLeft  :
+                  action & MV_DOWN     ? keySpaceDown  :
+                  action & MV_RIGHT    ? keySpaceRight : keySpace);
+  }
+  else
+  {
+    DemoKeyCode = (action & MV_UP      ? keyUp         :
+                  action & MV_LEFT     ? keyLeft       :
+                  action & MV_DOWN     ? keyDown       :
+                  action & MV_RIGHT    ? keyRight      : keyNone);
+  }
+
+  return subProcessKeyboardInput;
+
+#else
+
   //  On Error GoTo NoKeyboardAccessEH
   //    Call DKeyboard.Acquire
   //  On Error GoTo 0
@@ -51,9 +72,9 @@ int subProcessKeyboardInput()
   if (DemoFlag != 0)
   {
     subGetNextDemoKey();
+
     if (ExitToMenuFlag != 0)
       return subProcessKeyboardInput;
-
   }
   else
   {
@@ -106,6 +127,8 @@ int subProcessKeyboardInput()
     }
   }
 
+#endif
+
   // demo recording
   if (RecordDemoFlag == 1)
     DemoBuffer.AddDemoKey(DemoKeyCode);