65 ControllerEnabled: Integer; |
65 ControllerEnabled: Integer; |
66 ControllerNumAxes: array[0..5] of Integer; |
66 ControllerNumAxes: array[0..5] of Integer; |
67 //ControllerNumBalls: array[0..5] of Integer; |
67 //ControllerNumBalls: array[0..5] of Integer; |
68 ControllerNumHats: array[0..5] of Integer; |
68 ControllerNumHats: array[0..5] of Integer; |
69 ControllerNumButtons: array[0..5] of Integer; |
69 ControllerNumButtons: array[0..5] of Integer; |
70 ControllerAxes: array[0..5] of array[0..19] of Integer; |
70 //ControllerAxes: array[0..5] of array[0..19] of Integer; |
71 //ControllerBalls: array[0..5] of array[0..19] of array[0..1] of Integer; |
71 //ControllerBalls: array[0..5] of array[0..19] of array[0..1] of Integer; |
72 ControllerHats: array[0..5] of array[0..19] of Byte; |
72 //ControllerHats: array[0..5] of array[0..19] of Byte; |
73 ControllerButtons: array[0..5] of array[0..19] of Byte; |
73 //ControllerButtons: array[0..5] of array[0..19] of Byte; |
74 usingDBinds: boolean; |
74 usingDBinds: boolean; |
75 |
75 |
76 function KeyNameToCode(name: shortstring): LongInt; inline; |
76 function KeyNameToCode(name: shortstring): LongInt; inline; |
77 begin |
77 begin |
78 KeyNameToCode:= KeyNameToCode(name, ''); |
78 KeyNameToCode:= KeyNameToCode(name, ''); |
398 ControllerNumHats[j]:= 20; |
398 ControllerNumHats[j]:= 20; |
399 |
399 |
400 if ControllerNumButtons[j] > 20 then |
400 if ControllerNumButtons[j] > 20 then |
401 ControllerNumButtons[j]:= 20; |
401 ControllerNumButtons[j]:= 20; |
402 |
402 |
403 // reset all buttons/axes |
403 (*// reset all buttons/axes |
404 for i:= 0 to pred(ControllerNumAxes[j]) do |
404 for i:= 0 to pred(ControllerNumAxes[j]) do |
405 ControllerAxes[j][i]:= 0; |
405 ControllerAxes[j][i]:= 0; |
406 (*for i:= 0 to pred(ControllerNumBalls[j]) do |
406 for i:= 0 to pred(ControllerNumBalls[j]) do |
407 begin |
407 begin |
408 ControllerBalls[j][i][0]:= 0; |
408 ControllerBalls[j][i][0]:= 0; |
409 ControllerBalls[j][i][1]:= 0; |
409 ControllerBalls[j][i][1]:= 0; |
410 end;*) |
410 end; |
411 for i:= 0 to pred(ControllerNumHats[j]) do |
411 for i:= 0 to pred(ControllerNumHats[j]) do |
412 ControllerHats[j][i]:= SDL_HAT_CENTERED; |
412 ControllerHats[j][i]:= SDL_HAT_CENTERED; |
413 for i:= 0 to pred(ControllerNumButtons[j]) do |
413 for i:= 0 to pred(ControllerNumButtons[j]) do |
414 ControllerButtons[j][i]:= 0; |
414 ControllerButtons[j][i]:= 0;*) |
415 end; |
415 end; |
416 end; |
416 end; |
417 // enable event generation/controller updating |
417 // enable event generation/controller updating |
418 SDL_JoystickEventState(1); |
418 SDL_JoystickEventState(1); |
419 end |
419 end |