hedgewars/uInputHandler.pas
changeset 13490 4faebbf9c44f
parent 13459 08a3851aaf67
child 13499 c41b16ac2e05
equal deleted inserted replaced
13489:8935dcc0e130 13490:4faebbf9c44f
   512 
   512 
   513 if ControllerNumControllers > 0 then
   513 if ControllerNumControllers > 0 then
   514     begin
   514     begin
   515     for j:= 0 to pred(ControllerNumControllers) do
   515     for j:= 0 to pred(ControllerNumControllers) do
   516         begin
   516         begin
   517         WriteLnToConsole('Using game controller: ' + shortstring(SDL_JoystickName(j)));
   517         WriteLnToConsole('Game controller no. ' + IntToStr(j) + ', name "' + shortstring(SDL_JoystickNameForIndex(j)) + '":');
   518         Controller[j]:= SDL_JoystickOpen(j);
   518         Controller[j]:= SDL_JoystickOpen(j);
   519         if Controller[j] = nil then
   519         if Controller[j] = nil then
   520             WriteLnToConsole('* Failed to open game controller!')
   520             WriteLnToConsole('* Failed to open game controller no. ' + IntToStr(j) + '!')
   521         else
   521         else
   522             begin
   522             begin
   523             ControllerNumAxes[j]:= SDL_JoystickNumAxes(Controller[j]);
   523             ControllerNumAxes[j]:= SDL_JoystickNumAxes(Controller[j]);
   524             //ControllerNumBalls[j]:= SDL_JoystickNumBalls(Controller[j]);
   524             //ControllerNumBalls[j]:= SDL_JoystickNumBalls(Controller[j]);
   525             ControllerNumHats[j]:= SDL_JoystickNumHats(Controller[j]);
   525             ControllerNumHats[j]:= SDL_JoystickNumHats(Controller[j]);