hedgewars/uKeys.pas
changeset 2716 b9ca1bfca24f
parent 2714 c85ffe57d971
child 2754 ad4f81fbfb76
--- a/hedgewars/uKeys.pas	Tue Jan 26 04:13:37 2010 +0000
+++ b/hedgewars/uKeys.pas	Tue Jan 26 21:55:51 2010 +0000
@@ -25,6 +25,9 @@
 type TBinds = array[0..cKeyMaxIndex] of shortstring;
 type TKeyboardState = array[0..cKeyMaxIndex] of Byte;
 
+procedure init_uKeys;
+procedure free_uKeys;
+
 function  KeyNameToCode(name: string): word;
 procedure ProcessKbd;
 procedure ResetKbd;
@@ -41,27 +44,23 @@
 procedure ControllerButtonEvent(joy, button: Byte; pressed: Boolean);
 
 var	hideAmmoMenu: boolean;
-	wheelUp: boolean = false;
-	wheelDown: boolean = false;
-{$IFDEF TOUCHINPUT}
-	leftClick: boolean = false;
-	middleClick: boolean = false;
-	rightClick: boolean = false;
+	wheelUp: boolean;
+	wheelDown: boolean;
+{$IFDEF IPHONEOS}
+	leftClick: boolean;
+	middleClick: boolean;
+	rightClick: boolean;
 
-	upKey: boolean = false;
-	downKey: boolean = false;
-	rightKey: boolean = false;
-	leftKey: boolean = false;
+	upKey: boolean;
+	downKey: boolean;
+	rightKey: boolean;
+	leftKey: boolean;
 
-	backspaceKey: boolean = false;
-	spaceKey: boolean = false;
-	enterKey: boolean = false;
-	tabKey: boolean = false;
+	backspaceKey: boolean;
+	spaceKey: boolean;
+	enterKey: boolean;
+	tabKey: boolean;
 
-	isAttacking: boolean = false;
-	isWalking: boolean = false;
-{$ENDIF}
-{$IFDEF IPHONEOS}
 	theJoystick: PSDL_Joystick;
 {$ENDIF}
 	ControllerNumControllers: Integer;
@@ -130,7 +129,7 @@
 tkbdn[5]:= ord(wheelUp);
 wheelUp:= false;
 wheelDown:= false;
-{$IFDEF TOUCHINPUT}
+{$IFDEF IPHONEOS}
 tkbdn[1]:= ord(leftClick);
 tkbdn[2]:= ord(middleClick);
 tkbdn[3]:= ord(rightClick);
@@ -331,7 +330,7 @@
 		end;
 	end;
 
-{$IFDEF TOUCHINPUT}
+{$IFDEF IPHONEOS}
 DefaultBinds[  1]:= '/put';
 DefaultBinds[  3]:= 'ammomenu';
 DefaultBinds[  8]:= 'hjump';
@@ -469,8 +468,34 @@
 
 procedure ControllerButtonEvent(joy, button: Byte; pressed: Boolean);
 begin
-	if pressed then ControllerButtons[joy][button]:= 1 else ControllerButtons[joy][button]:= 0;
+	if pressed then ControllerButtons[joy][button]:= 1
+	else ControllerButtons[joy][button]:= 0;
 end;
 
+procedure init_uKeys;
+begin
+	wheelUp:= false;
+	wheelDown:= false;
+{$IFDEF IPHONEOS}
+	leftClick:= false;
+	middleClick:= false;
+	rightClick:= false;
+
+	upKey:= false;
+	downKey:= false;
+	rightKey:= false;
+	leftKey:= false;
+
+	backspaceKey:= false;
+	spaceKey:= false;
+	enterKey:= false;
+	tabKey:= false;
+{$ENDIF}
+end;
+
+procedure free_uKeys;
+begin
+
+end;
 
 end.