hedgewars/uKeys.pas
changeset 2786 85f6425a4d74
parent 2754 ad4f81fbfb76
child 2805 36a8cebb91e8
equal deleted inserted replaced
2785:de6406cd6b25 2786:85f6425a4d74
    55 	ControllerNumButtons: array[0..5] of Integer;
    55 	ControllerNumButtons: array[0..5] of Integer;
    56 	ControllerAxes: array[0..5] of array[0..19] of Integer;
    56 	ControllerAxes: array[0..5] of array[0..19] of Integer;
    57 	//ControllerBalls: array[0..5] of array[0..19] of array[0..1] of Integer;
    57 	//ControllerBalls: array[0..5] of array[0..19] of array[0..1] of Integer;
    58 	ControllerHats: array[0..5] of array[0..19] of Byte;
    58 	ControllerHats: array[0..5] of array[0..19] of Byte;
    59 	ControllerButtons: array[0..5] of array[0..19] of Byte;
    59 	ControllerButtons: array[0..5] of array[0..19] of Byte;
    60 	
    60 
       
    61 	DefaultBinds, CurrentBinds: TBinds;
       
    62 
    61 {$IFDEF IPHONEOS}
    63 {$IFDEF IPHONEOS}
    62 	leftClick: boolean;
    64 	leftClick: boolean;
    63 	middleClick: boolean;
    65 	middleClick: boolean;
    64 	rightClick: boolean;
    66 	rightClick: boolean;
    65 
    67 
    84 uses uTeams, uConsole, uMisc, uStore;
    86 uses uTeams, uConsole, uMisc, uStore;
    85 const KeyNumber = 1024;
    87 const KeyNumber = 1024;
    86 
    88 
    87 var tkbd, tkbdn: TKeyboardState;
    89 var tkbd, tkbdn: TKeyboardState;
    88     KeyNames: array [0..cKeyMaxIndex] of string[15];
    90     KeyNames: array [0..cKeyMaxIndex] of string[15];
    89     DefaultBinds, CurrentBinds: TBinds;
       
    90 	
    91 	
    91 function KeyNameToCode(name: string): word;
    92 function KeyNameToCode(name: string): word;
    92 var code: Word;
    93 var code: Word;
    93 begin
    94 begin
    94 	code:= cKeyMaxIndex;
    95 	code:= cKeyMaxIndex;
   319 DefaultBinds[KeyNameToCode('wheelup')]:= 'zoomout';
   320 DefaultBinds[KeyNameToCode('wheelup')]:= 'zoomout';
   320 DefaultBinds[KeyNameToCode('wheeldown')]:= 'zoomin';
   321 DefaultBinds[KeyNameToCode('wheeldown')]:= 'zoomin';
   321 
   322 
   322 DefaultBinds[KeyNameToCode('f12')]:= 'fullscr';
   323 DefaultBinds[KeyNameToCode('f12')]:= 'fullscr';
   323 
   324 
   324 {$IFDEF IPHONEOS}
   325 
       
   326 
   325 DefaultBinds[ 1]:= '/put';
   327 DefaultBinds[ 1]:= '/put';
   326 DefaultBinds[ 3]:= 'ammomenu';
   328 DefaultBinds[ 3]:= 'ammomenu';
   327 DefaultBinds[ 8]:= 'hjump';
   329 DefaultBinds[ 8]:= 'hjump';
   328 DefaultBinds[ 9]:= 'switch';
   330 DefaultBinds[ 9]:= 'switch';
   329 DefaultBinds[13]:= 'ljump';
   331 DefaultBinds[13]:= 'ljump';
       
   332 DefaultBinds[32]:= '+attack';
       
   333 {$IFDEF IPHONEOS}
   330 DefaultBinds[23]:= '+up';
   334 DefaultBinds[23]:= '+up';
   331 DefaultBinds[24]:= '+down';
   335 DefaultBinds[24]:= '+down';
   332 DefaultBinds[25]:= '+left';
   336 DefaultBinds[25]:= '+left';
   333 DefaultBinds[26]:= '+right';
   337 DefaultBinds[26]:= '+right';
   334 DefaultBinds[32]:= '+attack';
       
   335 DefaultBinds[44]:= 'chat';
   338 DefaultBinds[44]:= 'chat';
       
   339 {$ELSE}
       
   340 DefaultBinds[KeyNameToCode('up')]:= '+up';
       
   341 DefaultBinds[KeyNameToCode('down')]:= '+down';
       
   342 DefaultBinds[KeyNameToCode('left')]:= '+left';
       
   343 DefaultBinds[KeyNameToCode('right')]:= '+right';
       
   344 DefaultBinds[KeyNameToCode('left_shift')]:= '+precise';
   336 {$ENDIF}
   345 {$ENDIF}
   337 
   346 
   338 SetDefaultBinds();
   347 SetDefaultBinds();
   339 end;
   348 end;
   340 
   349