hedgewars/uInputHandler.pas
changeset 7426 55b49cc1f33a
parent 7403 e8d0b21efa82
child 7442 9bb6abdb5675
--- a/hedgewars/uInputHandler.pas	Tue Jul 24 18:53:42 2012 -0400
+++ b/hedgewars/uInputHandler.pas	Wed Jul 25 10:56:14 2012 -0400
@@ -25,8 +25,9 @@
 procedure initModule;
 procedure freeModule;
 
-function  KeyNameToCode(name: shortstring; Modifier: shortstring = ''): LongInt;
-procedure MaskModifier(var code: LongInt; modifier: LongWord);
+function  KeyNameToCode(name: shortstring): LongInt; inline;
+function  KeyNameToCode(name: shortstring; Modifier: shortstring): LongInt;
+//procedure MaskModifier(var code: LongInt; modifier: LongWord);
 procedure MaskModifier(Modifier: shortstring; var code: LongInt);
 procedure ProcessMouse(event: TSDL_MouseButtonEvent; ButtonDown: boolean);
 procedure ProcessKey(event: TSDL_KeyboardEvent); inline;
@@ -60,6 +61,11 @@
     KeyNames: array [0..cKeyMaxIndex] of string[15];
     CurrentBinds: TBinds;
 
+function  KeyNameToCode(name: shortstring): LongInt; inline;
+begin
+    KeyNameToCode:= KeyNameToCode(name, '');
+end;
+
 function KeyNameToCode(name: shortstring; Modifier: shortstring): LongInt;
 var code: LongInt;
 begin
@@ -70,7 +76,7 @@
     MaskModifier(Modifier, code);
     KeyNameToCode:= code;
 end;
-
+(*
 procedure MaskModifier(var code: LongInt; Modifier: LongWord);
 begin
     if(Modifier and KMOD_LSHIFT) <> 0 then code:= code or LSHIFT; 
@@ -80,7 +86,7 @@
     if(Modifier and KMOD_LCTRL) <> 0 then code:= code or LCTRL; 
     if(Modifier and KMOD_RCTRL) <> 0 then code:= code or LCTRL; 
 end;
-
+*)
 procedure MaskModifier(Modifier: shortstring; var code: LongInt);
 var mod_ : shortstring;
     ModifierCount, i: LongInt;
@@ -133,7 +139,7 @@
 
 if CurrentBinds[code][0] <> #0 then
     begin
-    if (code > 3) and KeyDown and not ((CurrentBinds[code] = 'put') or (CurrentBinds[code] = 'ammomenu') or (CurrentBinds[code] = '+cur_u') or (CurrentBinds[code] = '+cur_d') or (CurrentBinds[code] = '+cur_l') or (CurrentBinds[code] = '+cur_r')) then hideAmmoMenu:= true;
+    if (code > 3) and KeyDown and (not ((CurrentBinds[code] = 'put')) or (CurrentBinds[code] = 'ammomenu') or (CurrentBinds[code] = '+cur_u') or (CurrentBinds[code] = '+cur_d') or (CurrentBinds[code] = '+cur_l') or (CurrentBinds[code] = '+cur_r')) then hideAmmoMenu:= true;
 
     if KeyDown then
         begin