69 upKey: boolean; |
69 upKey: boolean; |
70 downKey: boolean; |
70 downKey: boolean; |
71 rightKey: boolean; |
71 rightKey: boolean; |
72 leftKey: boolean; |
72 leftKey: boolean; |
73 preciseKey: boolean; |
73 preciseKey: boolean; |
74 |
74 |
75 backspaceKey: boolean; |
75 backspaceKey: boolean; |
76 spaceKey: boolean; |
76 spaceKey: boolean; |
77 enterKey: boolean; |
77 enterKey: boolean; |
78 tabKey: boolean; |
78 tabKey: boolean; |
79 |
79 |
80 chatAction: boolean; |
80 chatAction: boolean; |
81 pauseAction: boolean; |
81 pauseAction: boolean; |
82 |
82 |
83 {$IFDEF IPHONEOS} |
83 {$IFDEF IPHONEOS} |
84 procedure setiPhoneBinds; |
84 procedure setiPhoneBinds; |
85 {$ENDIF} |
85 {$ENDIF} |
86 {$ENDIF} |
86 {$ENDIF} |
87 implementation |
87 implementation |
88 uses uTeams, uConsole, uMisc; |
88 uses uTeams, uConsole, uMisc; |
89 //const KeyNumber = 1024; |
89 //const KeyNumber = 1024; |
90 |
90 |
91 var tkbd, tkbdn: TKeyboardState; |
91 var tkbd, tkbdn: TKeyboardState; |
92 KeyNames: array [0..cKeyMaxIndex] of string[15]; |
92 KeyNames: array [0..cKeyMaxIndex] of string[15]; |
93 |
93 |
94 function KeyNameToCode(name: shortstring): word; |
94 function KeyNameToCode(name: shortstring): word; |
95 var code: Word; |
95 var code: Word; |
96 begin |
96 begin |
97 code:= cKeyMaxIndex; |
97 code:= cKeyMaxIndex; |
98 while (code > 0) and (KeyNames[code] <> name) do dec(code); |
98 while (code > 0) and (KeyNames[code] <> name) do dec(code); |
384 tkbdn[13]:= ord(enterKey); |
384 tkbdn[13]:= ord(enterKey); |
385 tkbdn[32]:= ord(spaceKey); |
385 tkbdn[32]:= ord(spaceKey); |
386 |
386 |
387 tkbdn[44]:= ord(chatAction); |
387 tkbdn[44]:= ord(chatAction); |
388 tkbdn[55]:= ord(pauseAction); |
388 tkbdn[55]:= ord(pauseAction); |
389 |
389 |
390 // set to false the keys that only need one stoke |
390 // set to false the keys that only need one stoke |
391 leftClick:= false; |
391 leftClick:= false; |
392 middleClick:= false; |
392 middleClick:= false; |
393 rightClick:= false; |
393 rightClick:= false; |
394 |
394 |
395 tabKey:= false; |
395 tabKey:= false; |
396 enterKey:= false; |
396 enterKey:= false; |
397 backspaceKey:= false; |
397 backspaceKey:= false; |
398 |
398 |
399 chatAction:= false; |
399 chatAction:= false; |
400 pauseAction:= false; |
400 pauseAction:= false; |
401 end; |
401 end; |
402 {$ENDIF} |
402 {$ENDIF} |
403 |
403 |
440 WriteLnToConsole('* Number of axes: ' + inttostr(ControllerNumAxes[j])); |
440 WriteLnToConsole('* Number of axes: ' + inttostr(ControllerNumAxes[j])); |
441 //WriteLnToConsole('* Number of balls: ' + inttostr(ControllerNumBalls[j])); |
441 //WriteLnToConsole('* Number of balls: ' + inttostr(ControllerNumBalls[j])); |
442 WriteLnToConsole('* Number of hats: ' + inttostr(ControllerNumHats[j])); |
442 WriteLnToConsole('* Number of hats: ' + inttostr(ControllerNumHats[j])); |
443 WriteLnToConsole('* Number of buttons: ' + inttostr(ControllerNumButtons[j])); |
443 WriteLnToConsole('* Number of buttons: ' + inttostr(ControllerNumButtons[j])); |
444 ControllerEnabled:= 1; |
444 ControllerEnabled:= 1; |
445 |
445 |
446 if ControllerNumAxes[j] > 20 then ControllerNumAxes[j]:= 20; |
446 if ControllerNumAxes[j] > 20 then ControllerNumAxes[j]:= 20; |
447 //if ControllerNumBalls[j] > 20 then ControllerNumBalls[j]:= 20; |
447 //if ControllerNumBalls[j] > 20 then ControllerNumBalls[j]:= 20; |
448 if ControllerNumHats[j] > 20 then ControllerNumHats[j]:= 20; |
448 if ControllerNumHats[j] > 20 then ControllerNumHats[j]:= 20; |
449 if ControllerNumButtons[j] > 20 then ControllerNumButtons[j]:= 20; |
449 if ControllerNumButtons[j] > 20 then ControllerNumButtons[j]:= 20; |
450 |
450 |
451 // reset all buttons/axes |
451 // reset all buttons/axes |
452 for i:= 0 to pred(ControllerNumAxes[j]) do |
452 for i:= 0 to pred(ControllerNumAxes[j]) do |
453 ControllerAxes[j][i]:= 0; |
453 ControllerAxes[j][i]:= 0; |
454 (*for i:= 0 to pred(ControllerNumBalls[j]) do |
454 (*for i:= 0 to pred(ControllerNumBalls[j]) do |
455 begin |
455 begin |