Make KeyPressed act hand by hand with ReadKey (#3036)

This commit is contained in:
bormant 2024-02-01 22:08:40 +03:00 committed by GitHub
parent 087a00b636
commit e17dd66fd5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -155,9 +155,9 @@ function ReadKey: char;// TODO продумать это
var
KeyInfo: ConsoleKeyInfo;
begin
if NextKey <> Chr(0) then
if NextKey <> #0 then
begin
ReadKey := nextkey;
ReadKey := NextKey;
NextKey := #0;
end
else
@ -172,7 +172,7 @@ end;
function KeyPressed: boolean;
begin
KeyPressed := Console.KeyAvailable;
KeyPressed := (NextKey <> #0) or Console.KeyAvailable;
end;
function WindowWidth: integer;
@ -300,4 +300,4 @@ end;
begin
//zdes oshibka ISConsoleApplication u nas nikogda ne inicializiruetsja
__InitModule;
end.
end.