hedgewars/uInputHandler.pas
changeset 7231 f484455dd055
parent 7196 4fba5519c37f
parent 7202 2d78dc517c91
child 7442 9bb6abdb5675
equal deleted inserted replaced
7198:5debd5fe526e 7231:f484455dd055
    82 end;
    82 end;
    83 
    83 
    84 procedure MaskModifier(Modifier: shortstring; var code: LongInt);
    84 procedure MaskModifier(Modifier: shortstring; var code: LongInt);
    85 var mod_ : shortstring;
    85 var mod_ : shortstring;
    86     ModifierCount, i: LongInt;
    86     ModifierCount, i: LongInt;
    87     c : char;
       
    88 begin
    87 begin
    89 if Modifier = '' then exit;
    88 if Modifier = '' then exit;
    90 ModifierCount:= 0;
    89 ModifierCount:= 0;
    91 for c in Modifier do
    90 
    92     if(c = ':') then inc(ModifierCount);
    91 for i:= 1 to Length(Modifier) do
       
    92     if(Modifier[i] = ':') then inc(ModifierCount);
    93 
    93 
    94 SplitByChar(Modifier, mod_, ':');//remove the first mod: part
    94 SplitByChar(Modifier, mod_, ':');//remove the first mod: part
    95 Modifier:= mod_;
    95 Modifier:= mod_;
    96 for i:= 0 to ModifierCount do
    96 for i:= 0 to ModifierCount do
    97     begin 
    97     begin 
   154 
   154 
   155 procedure ProcessKey(event: TSDL_KeyboardEvent); inline;
   155 procedure ProcessKey(event: TSDL_KeyboardEvent); inline;
   156 var code: LongInt;
   156 var code: LongInt;
   157 begin
   157 begin
   158     code:= event.keysym.sym;
   158     code:= event.keysym.sym;
   159     MaskModifier(code, event.keysym.modifier);
   159     //MaskModifier(code, event.keysym.modifier);
   160     ProcessKey(code, event.type_ = SDL_KEYDOWN);
   160     ProcessKey(code, event.type_ = SDL_KEYDOWN);
   161 end;
   161 end;
   162 
   162 
   163 procedure ProcessMouse(event: TSDL_MouseButtonEvent; ButtonDown: boolean);
   163 procedure ProcessMouse(event: TSDL_MouseButtonEvent; ButtonDown: boolean);
   164 begin
   164 begin