hedgewars/uInputHandler.pas
changeset 7049 35d762458d66
parent 7048 0a4c88935902
child 7071 c431a4a8ab0f
equal deleted inserted replaced
7048:0a4c88935902 7049:35d762458d66
   173         ProcessKey(KeyNameToCode('wheelup'), ButtonDown);
   173         ProcessKey(KeyNameToCode('wheelup'), ButtonDown);
   174     end;
   174     end;
   175 end;
   175 end;
   176 
   176 
   177 procedure ResetKbd;
   177 procedure ResetKbd;
   178 var j, k, t: LongInt;
   178 var j, t: LongInt;
   179     i: LongInt;
   179     i: LongInt;
   180     pkbd: PByteArray;
   180     pkbd: PByteArray;
   181 begin
   181 begin
   182 
   182 
   183 k:= SDL_GetMouseState(nil, nil);
   183 //k:= SDL_GetMouseState(nil, nil);
   184 pkbd:=SDL_GetKeyState(@j);
   184 pkbd:=SDL_GetKeyState(@j);
   185 
   185 
   186 //TryDo(j < cKeyMaxIndex, 'SDL keys number is more than expected (' + IntToStr(j) + ')', true);
   186 //TryDo(j < cKeyMaxIndex, 'SDL keys number is more than expected (' + IntToStr(j) + ')', true);
   187 
   187 
   188 for i:= 1 to pred(j) do
   188 for i:= 1 to pred(j) do
   189     tkbdn[i]:= pkbd^[i];
   189     tkbdn[i]:= pkbd^[i];
   190 
   190 
   191 {$IFNDEF MOBILE}
   191 (*
       
   192 // TODO: reimplement
   192 // Controller(s)
   193 // Controller(s)
   193 k:= j; // should we test k for hitting the limit? sounds rather unlikely to ever reach it
   194 k:= j; // should we test k for hitting the limit? sounds rather unlikely to ever reach it
   194 for j:= 0 to Pred(ControllerNumControllers) do
   195 for j:= 0 to Pred(ControllerNumControllers) do
   195     begin
   196     begin
   196     for i:= 0 to Pred(ControllerNumAxes[j]) do
   197     for i:= 0 to Pred(ControllerNumAxes[j]) do
   217         begin
   218         begin
   218         tkbdn[k]:= ControllerButtons[j][i];
   219         tkbdn[k]:= ControllerButtons[j][i];
   219         inc(k, 1);
   220         inc(k, 1);
   220         end;
   221         end;
   221     end;
   222     end;
   222 {$ENDIF}
   223 *)
   223 
   224 
   224 // what is this final loop for?
   225 // what is this final loop for?
   225 for t:= 0 to cKeyMaxIndex do
   226 for t:= 0 to cKeyMaxIndex do
   226     tkbd[t]:= tkbdn[t]
   227     tkbd[t]:= tkbdn[t]
   227 end;
   228 end;