А какие коды соответствуют клавишам
<--- , --->?
Case ReadKey Of
#0: Begin
Case ReadKey Of
#72: { Вверх }
#80: { Вниз }
#75: { Влево }
#77: { Вправо }
End;
End;
Uses Crt;
Var ch :Char;
kod :Integer;
Begin
ClrScr;
WriteLn('ASCII');
kod := 0;
While(kod <> 27) Do
Begin
ch := ReadKey;
kod := Ord(ch);
WriteLn(ch,' = ',kod);
End;
End.
Uses Crt;
Const Up = #72;
Down = #80;
Left = #75;
Right = #77;
Esc = #27;
Var x, y :Integer;
ch :Char;
Begin
ClrScr;
x:=5;
y:=5;
While(ch <> Esc) Do
Begin
ClrScr;
GotoXY(x,y);
Write('0');
ch := ReadKey;
If ch = #0 Then
Begin
ch := ReadKey;
Case ch of
Up : y:=y-1;
Down : y:=y+1;
Left : x:=x-1;
Right : x:=x+1;
End;
End;
End;
End.
Uses Crt;
Var ch :Char;
Begin
ClrScr;
WriteLn('ASCII');
While(ch <> #27) Do
Begin
ch := ReadKey;
If ch = #0 then
Begin
ch := ReadKey;
End
Else
Begin
Write('Char = ');
If ch < #32 Then Write('^',Chr(Ord(ch)+64),' ')
Else Write(ch,' ');
End;
WriteLn('ASCII = ',Ord(ch));
End;
End.