diff -r bc3306c59a08 -r 9bb6abdb5675 hedgewars/uInputHandler.pas --- a/hedgewars/uInputHandler.pas Fri Jul 13 16:39:20 2012 +0400 +++ b/hedgewars/uInputHandler.pas Thu Jul 26 21:56:47 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 @@ -248,6 +254,7 @@ DefaultBinds[KeyNameToCode(_S'0')]:= '+volup'; DefaultBinds[KeyNameToCode(_S'9')]:= '+voldown'; +DefaultBinds[KeyNameToCode(_S'8')]:= 'mute'; DefaultBinds[KeyNameToCode(_S'c')]:= 'capture'; DefaultBinds[KeyNameToCode(_S'r')]:= 'record'; DefaultBinds[KeyNameToCode(_S'h')]:= 'findhh';