home *** CD-ROM | disk | FTP | other *** search
- interface
-
- {$DEFINE NOCRT}
-
- { Remove the above line if you are using the CRT unit and do not want the
- last four routines defined in the interface section to interfere with the
- routines normally defined in the CRT unit. }
-
- const
- alt=132; { Alt + letter will return the character 132 above the letter }
- home=#128; uparrow=#129; pgup=#130; { numeric }
- leftarrow=#131; rightarrow=#132; { keypad }
- end_=#133; downarrow=#134; pgdn=#135; { keys }
- ins=#136; del=#137;
- F1=#138; F2=#139; F3=#140; F4=#141; F5=#142;
- F6=#143; F7=#144; F8=#145; F9=#146; F10=#147;
- shiftF1=#148; shiftF2=#149; shiftF3=#150; shiftF4=#151; shiftF5=#152;
- shiftF6=#153; shiftF7=#154; shiftF8=#155; shiftF9=#156; shiftF10=#157;
- cntlF1=#158; cntlF2=#159; cntlF3=#160; cntlF4=#161; cntlF5=#162;
- cntlF6=#163; cntlF7=#164; cntlF8=#165; cntlF9=#166; cntlF10=#167;
- altF1=#168; altF2=#169; altF3=#170; altF4=#171; altF5=#172;
- altF6=#173; altF7=#174; altF8=#175; altF9=#176; altF10=#177;
- { Regular, shifted, control, and alternate sets of function keys }
- cntlhome=#183; cntlpgup=#178;
- cntlleftarrow=#179; cntlrightarrow=#180;
- cntlend=#181; cntlpgdn=#182; { Control + keypad keys }
- alt1=#184; alt2=#185; alt3=#186; alt4=#187; alt5=#188;
- alt6=#189; alt7=#190; alt8=#191; alt9=#192; alt0=#193;
- { Alt + numbers from top row of keyboard }
- altminus=#194; altequal=#195; { Alt + "-" or "=" from middle of keyboard }
- reversetab=#196; { Shift + tab key }
- on=true; { Boolean constans for GetCapslock, GetNumLock, }
- off=false; { GetScrollLock, SetCapsLock, SetNumLock, and SetScrollLock }
- nonnumeric:boolean=false; { Disallow numbers on numeric keypad }
-
- type charset=set of char;
-
- var alttyped:boolean; { TRUE if the last key returned by getkey was entered
- on the numeric keypad. This can be done by holding down the alt key and
- typing the key's ASCII code on the numeric keypad. Undefined before the
- first call to getkey. }
-
- function getkey:char; { enhanced readkey }
- procedure readno(var number:word; lobound,hibound:word);
- procedure readint(var number:integer; lobound,hibound:integer);
- procedure readreal(var number:real; lobound,hibound:real; decimals:byte);
- { Read an unsigned integer, signed integer, or real number between lobound
- and hibound, and with maximum number of decimal places for real number. }
- procedure readstr(var s:string; maxlen:byte; charstoexclude:charset);
- { Read a new string into s, starting with an empty string; allow no more
- than maxlen chars; do not allow any characters in the charstoexclude set
- to be entered into the string. }
- procedure editstr(var s:string; maxlen:byte; charstoexclude:charset);
- { Edit the string currently in s; same rules as readstr. }
- procedure flushbuffer; { Flush all typed-ahead keystrokes from buffer. }
- procedure setcapslock(state:boolean); { Set the caps lock, num lock, }
- procedure setnumlock(state:boolean); { scroll lock, or insert key state }
- procedure setscrolllock(state:boolean); { on or off. State=TRUE means turn }
- procedure setinsert(state:boolean); { on; state=FALSE means turn off. }
- function getcapslock:boolean; { \ }
- function getnumlock:boolean; { \Return current caps lock, num lock, }
- function getscrolllock:boolean; { /scroll lock, or insert state. }
- function getinsert:boolean; { / }
- function screenwidth:byte; { Tell how many characters wide the screen is. }
- function leftshiftdown:boolean; { Returns true if left shift key is down. }
- function rightshiftdown:boolean; { Returns true if right shift key is down. }
- function shiftdown:boolean; { Returns true if either shift key is down. }
- function controldown:boolean; { Returns true if control key is down. }
- function altdown:boolean; { Returns true if alt key is down. }
- procedure chgcursor(startline,endline:byte);
- { Change the cursor so it starts at startline and ends at endline. }
- { Chgcursor ($20,0) will completely erase the cursor. }
- procedure getcursor(var startline,endline:byte);
- { Get the current starting and ending line of the cursor. }
- {$IFDEF NOCRT}
- function keypressed:boolean; { Returns true if a key is waiting in buffer. }
- function wherex:byte; { Returns x-coordinate of cursor. }
- function wherey:byte; { Returns y-coordinate of cursor. }
- procedure gotoxy(x,y:byte); { Positions cursor at (x,y). }
- {$ENDIF}