hedgewars/uKeys.pas
changeset 2328 e74f2db28b21
parent 2312 3b59f1251ead
child 2379 d62b1f224982
equal deleted inserted replaced
2327:4832b77ec958 2328:e74f2db28b21
    62           and (not CurrentTeam^.ExtDriven)
    62           and (not CurrentTeam^.ExtDriven)
    63           and (CurrentHedgehog^.BotLevel = 0);
    63           and (CurrentHedgehog^.BotLevel = 0);
    64 
    64 
    65 {$IFDEF SDL13}
    65 {$IFDEF SDL13}
    66 pkbd := SDL_GetKeyboardState(nil);
    66 pkbd := SDL_GetKeyboardState(nil);
    67 i	 := SDL_GetMouseState(0, nil, nil);
    67 i    := SDL_GetMouseState(0, nil, nil);
    68 {$ELSE}
    68 {$ELSE}
    69 pkbd := SDL_GetKeyState(nil);
    69 pkbd := SDL_GetKeyState(nil);
    70 i	 := SDL_GetMouseState(nil, nil);
    70 i    := SDL_GetMouseState(nil, nil);
    71 {$ENDIF}
    71 {$ENDIF}
    72 
    72 
       
    73 
       
    74 {$IFDEF DARWIN}
       
    75 pkbd^[1]:= ((i and 1) and not (pkbd^[306] or pkbd^[305]));
       
    76 pkbd^[3]:= ((i and 1) and (pkbd^[306] or pkbd^[305])) or (i and 4);
       
    77 {$ELSE}
    73 pkbd^[1]:= (i and 1);
    78 pkbd^[1]:= (i and 1);
       
    79 pkbd^[3]:= ((i shr 2) and 1);
       
    80 {$ENDIF}
    74 pkbd^[2]:= ((i shr 1) and 1);
    81 pkbd^[2]:= ((i shr 1) and 1);
    75 
    82 
    76 {$IFDEF DARWIN}
       
    77 //    normal right click     ||      ctrl (left/right) + left click	  
       
    78 pkbd^[3]:= ((i shr 2) and 1) or ((i and 1) and (pkbd^[306] or pkbd^[305]));
       
    79 {$ELSE}
       
    80 pkbd^[3]:= ((i shr 2) and 1);
       
    81 {$ENDIF}
       
    82 
    83 
    83 for i:= 1 to cKeyMaxIndex do
    84 for i:= 1 to cKeyMaxIndex do
    84 if CurrentBinds[i][0] <> #0 then
    85 if CurrentBinds[i][0] <> #0 then
    85 	begin
    86 	begin
    86 	if (i > 3) and (pkbd^[i] <> 0) then KbdKeyPressed:= true;
    87 	if (i > 3) and (pkbd^[i] <> 0) then KbdKeyPressed:= true;
   129            if s[t] = ' ' then s[t]:= '_';
   130            if s[t] = ' ' then s[t]:= '_';
   130        KeyNames[i]:= s
   131        KeyNames[i]:= s
   131        end;
   132        end;
   132     end;
   133     end;
   133 
   134 
   134 DefaultBinds[ 27]:= 'quit';
   135 DefaultBinds[ 27]:= 'quit';		// esc
   135 DefaultBinds[ 48]:= '+volup';
   136 DefaultBinds[ 48]:= '+volup';		// 0
   136 DefaultBinds[ 57]:= '+voldown';
   137 DefaultBinds[ 57]:= '+voldown';		// 9
   137 DefaultBinds[ 44]:= 'history';	// , instead of `
   138 DefaultBinds[ 96]:= 'history';		// `
   138 DefaultBinds[ 96]:= 'history';
   139 DefaultBinds[ 99]:= 'capture';		// c
   139 DefaultBinds[ 99]:= 'capture';
   140 DefaultBinds[104]:= 'findhh';		// h
   140 DefaultBinds[104]:= 'findhh';
   141 DefaultBinds[112]:= 'pause';		// p
   141 DefaultBinds[112]:= 'pause';
   142 DefaultBinds[115]:= '+speedup';		// s
   142 DefaultBinds[115]:= '+speedup';
   143 DefaultBinds[116]:= 'chat';		// t
   143 DefaultBinds[116]:= 'chat';
   144 DefaultBinds[121]:= 'confirm';		// y
   144 DefaultBinds[121]:= 'confirm';
   145 DefaultBinds[127]:= 'rotmask';		// canc
   145 DefaultBinds[127]:= 'rotmask';
       
   146 
   146 
   147 DefaultBinds[KeyNameToCode('f12')]:= 'fullscr';
   147 DefaultBinds[KeyNameToCode('f12')]:= 'fullscr';
   148 
   148 
   149 SetDefaultBinds
   149 SetDefaultBinds
   150 end;
   150 end;