home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Best of Select: Games 4
/
CD_1.iso
/
games
/
warrisk
/
cursor.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
2000-01-04
|
666b
|
35 lines
Function cursor:integer;
{This function will read the cursor movement keys and return 1-Cursor left,
2-Cursor right, 3-cursor up, 4-cursor down, 5-end, 13- return. Otherwise,
the character read is returned.}
Var
c,d:char;
i,j,l:integer;
Begin
l:=0;
Repeat until keypressed;
Read(kbd,c);
if (c='q') or (c='Q') then quitsw:=1;
i:=ord(c);
case i of
27 : begin
Read(kbd,d);
j:=ord(d);
case j of
75 : l:=1;
77 : l:=2;
72 : l:=3;
80 : l:=4;
79 : l:=5;
end;
end;
13 : l:=13;
end;
if l>0 then cursor:=l
else cursor:=i;
end;