# HG changeset patch # User Stepan777 # Date 1339108874 -14400 # Node ID 4fba5519c37fd10e72f985742b068e761bd428cd # Parent d8e68cbca7ee4e7e651778db0ba51a0405352b7c# Parent 65a022bf6bde6d645a32b6631c09a601ecd3532c merge diff -r d8e68cbca7ee -r 4fba5519c37f hedgewars/SDLh.pas --- a/hedgewars/SDLh.pas Thu Jun 07 17:42:32 2012 +0400 +++ b/hedgewars/SDLh.pas Fri Jun 08 02:41:14 2012 +0400 @@ -275,8 +275,8 @@ KMOD_RSHIFT = $0002; KMOD_LCTRL = $0040; KMOD_RCTRL = $0080; - KMOD_LALT = $0100; - KMOD_RALT = $0200; + KMOD_LALT = $0400; + KMOD_RALT = $0800; KMOD_LMETA = $0400; KMOD_RMETA = $0800; KMOD_NUM = $1000; diff -r d8e68cbca7ee -r 4fba5519c37f hedgewars/uInputHandler.pas --- a/hedgewars/uInputHandler.pas Thu Jun 07 17:42:32 2012 +0400 +++ b/hedgewars/uInputHandler.pas Fri Jun 08 02:41:14 2012 +0400 @@ -47,6 +47,14 @@ implementation uses uConsole, uCommands, uMisc, uVariables, uConsts, uUtils, uDebug; +const + LSHIFT = $0200; + RSHIFT = $0400; + LALT = $0800; + RALT = $1000; + LCTRL = $2000; + RCTRL = $4000; + var tkbd: array[0..cKbdMaxIndex] of boolean; quitKeyCode: Byte; KeyNames: array [0..cKeyMaxIndex] of string[15]; @@ -65,7 +73,12 @@ procedure MaskModifier(var code: LongInt; Modifier: LongWord); begin - code:= code or (modifier shl 10); + if(Modifier and KMOD_LSHIFT) <> 0 then code:= code or LSHIFT; + if(Modifier and KMOD_RSHIFT) <> 0 then code:= code or LSHIFT; + if(Modifier and KMOD_LALT) <> 0 then code:= code or LALT; + if(Modifier and KMOD_RALT) <> 0 then code:= code or LALT; + 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); @@ -84,12 +97,12 @@ begin mod_:= ''; SplitByChar(Modifier, mod_, ':'); - if (Modifier = 'lshift') then code:= code or (KMOD_LSHIFT shl 10); - if (Modifier = 'rshift') then code:= code or (KMOD_RSHIFT shl 10); - if (Modifier = 'lalt') then code:= code or (KMOD_LALT shl 10); - if (Modifier = 'ralt') then code:= code or (KMOD_RALT shl 10); - if (Modifier = 'lctrl') or (mod_ = 'lmeta') then code:= code or (KMOD_LCTRL shl 10); - if (Modifier = 'rctrl') or (mod_ = 'rmeta') then code:= code or (KMOD_RCTRL shl 10); + if (Modifier = 'lshift') then code:= code or LSHIFT; + if (Modifier = 'rshift') then code:= code or RSHIFT; + if (Modifier = 'lalt') then code:= code or LALT; + if (Modifier = 'ralt') then code:= code or RALT; + if (Modifier = 'lctrl') or (mod_ = 'lmeta') then code:= code or LCTRL; + if (Modifier = 'rctrl') or (mod_ = 'rmeta') then code:= code or RCTRL; Modifier:= mod_; end; end; @@ -144,7 +157,6 @@ begin code:= event.keysym.sym; MaskModifier(code, event.keysym.modifier); - ProcessKey(code, event.type_ = SDL_KEYDOWN); end;