hedgewars/uKeys.pas
changeset 4046 cfdbddc4b385
parent 3971 5c82ee165ed5
child 4131 e89d11f6361c
equal deleted inserted replaced
4045:e3a2a39a8277 4046:cfdbddc4b385
   262 KeyNames[4]:= 'wheelup';
   262 KeyNames[4]:= 'wheelup';
   263 KeyNames[5]:= 'wheeldown';
   263 KeyNames[5]:= 'wheeldown';
   264 
   264 
   265 for i:= 6 to cKeyMaxIndex do
   265 for i:= 6 to cKeyMaxIndex do
   266     begin
   266     begin
   267         s:= shortstring(sdl_getkeyname(i));
   267     s:= shortstring(sdl_getkeyname(i));
   268     //writeln(stdout,inttostr(i) + ': ' + s);
   268     //writeln(stdout,inttostr(i) + ': ' + s);
   269         if s = 'unknown key' then KeyNames[i]:= ''
   269     if s = 'unknown key' then KeyNames[i]:= ''
   270         else begin
   270     else 
       
   271         begin
   271         for t:= 1 to Length(s) do
   272         for t:= 1 to Length(s) do
   272             if s[t] = ' ' then s[t]:= '_';
   273             if s[t] = ' ' then s[t]:= '_';
   273             KeyNames[i]:= s
   274         KeyNames[i]:= s
   274         end;
   275         end;
   275 end;
   276     end;
   276 
   277 
   277 //for i:= 0 to cKeyMaxIndex do writeln(stdout,inttostr(i) + ': ' + KeyNames[i]);
   278 //for i:= 0 to cKeyMaxIndex do writeln(stdout,inttostr(i) + ': ' + KeyNames[i]);
   278 
   279 
   279 // get the size of keyboard array
   280 // get the size of keyboard array
   280 SDL_GetKeyState(@k);
   281 SDL_GetKeyState(@k);