Make the delete key insert the delete character unused function keys insert a null.

This commit is contained in:
CrazyEttin 2022-08-16 13:35:39 +03:00
parent 2b92cf26a5
commit 7316f8ad79
1 changed files with 29 additions and 5 deletions

View File

@ -139,17 +139,24 @@ begin
//Non-ASCII //Non-ASCII
if keypressed then begin if keypressed then begin
Scan := ReadKey; Scan := ReadKey;
//The delete key inserts the delete character
if Scan = ansichar ($53) then begin
Ch := ansichar ($7f);
ASCII := true;
end
{$ifdef tape} {$ifdef tape}
//Insert a tape in the tape reader //The insert key sets a tape to be read
if Scan = ansichar ($52) then begin else if Scan = ansichar ($52) then begin
writeln (); writeln ();
write ('Tape to be read: '); write ('Tape to be read: ');
readln (TapeInFile); readln (TapeInFile);
if TapeInFile = '' then TapeInFile := ' '; if TapeInFile = '' then TapeInFile := ' ';
TapeInPos := 0 TapeInPos := 0;
end; ASCII := false;
end
{$endif} {$endif}
ASCII := false; //Unused function keys insert a null
else ASCII := true;
end end
//Null //Null
else ASCII := true; else ASCII := true;
@ -157,6 +164,23 @@ begin
//Other ASCII //Other ASCII
else ASCII := true; else ASCII := true;
until ASCII = true; until ASCII = true;
//Bodge for the home and end keys
if Ch = ansichar ($37) then begin
if keypressed then begin
Scan := ReadKey;
Scan := ReadKey;
Scan := ReadKey;
Ch := ansichar (0);
end;
end
else if Ch = ansichar ($38) then begin
if keypressed then begin
Scan := ReadKey;
Scan := ReadKey;
Scan := ReadKey;
Ch := ansichar (0);
end;
end;
//Process the keypress //Process the keypress
write (Ch); //Local echo write (Ch); //Local echo
R [X] := byte (Ch); R [X] := byte (Ch);