home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD1.mdf
/
pascal
/
library
/
dos
/
tp_fast
/
version4
/
t_kbd.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1991-11-14
|
3KB
|
107 lines
{ -------------------------------------------------------------------------- }
{ t_kbd; }
{ demo of keyboard functions for TPFAST }
{ -------------------------------------------------------------------------- }
uses dos,crt,tpfast;
var ch :word;
{ -------------------------------------------------------------------------- }
procedure pollkeys;
begin
if capslockon then dspat('Capslock is ON ',1,3,lightcyan)
else dspat('Capslock is OFF',1,3,lightcyan);
if inskeyon then dspat('Insert key is ON ',1,4,lightcyan)
else dspat('Insert key is OFF',1,4,lightcyan);
if numlockon then dspat('Numlock key is ON ',1,5,lightcyan)
else dspat('Numlock key is OFF',1,5,lightcyan);
if scrolllockon then
dspat('Scroll lock key is ON ',1,6,lightcyan)
else dspat('Scroll lock key is OFF',1,6,lightcyan);
if altkeydown then dspat('ALT ',1,1,lightgreen)
else dspat(' ',1,1,lightgreen);
if capslockdown then dspat('CAPS ',6,1,lightgreen)
else dspat(' ',6,1,lightgreen);
if inskeydown then dspat('INS ',12,1,lightgreen)
else dspat(' ',12,1,lightgreen);
if leftshiftdown then dspat('LSHIFT ',17,1,lightgreen)
else dspat(' ',17,1,lightgreen);
if rightshiftdown then dspat('RSHIFT ',26,1,lightgreen)
else dspat(' ',26,1,lightgreen);
if ctrlkeydown then dspat('CTRL ',34,1,lightgreen)
else dspat(' ',34,1,lightgreen);
if scrolllockdown then dspat('SCROLL-LOCK ',40,1,lightgreen)
else dspat(' ',40,1,lightgreen);
if numlockdown then dspat('NUM-LOCK ',53,1,lightgreen)
else dspat(' ',53,1,lightgreen);
end;
{ -------------------------------------------------------------------------- }
procedure statusmsg;
begin
dspat('Press Alt, Shift, Ctrl, Ins, Numlock, Scrollock keys ....',1,22,
lightred);
dspat('Press F1 to set all keys ..',1,24,lightred);
dspat('Press F2 to clear all keys ..',1,25,lightred);
end;
{ -------------------------------------------------------------------------- }
procedure setkeys;
begin
setcapslock;
setnumlock;
setscrolllock;
setins;
end;
{ -------------------------------------------------------------------------- }
procedure clearkeys;
begin
clearcapslock;
clearnumlock;
clearscrolllock;
clearins;
end;
{ -------------------------------------------------------------------------- }
begin
textattr := white;
ch := NULL;
cursoroff;
clrscr;
statusmsg;
repeat
if keypressed then
begin
ch := getkey;
if ch = F1 then setkeys;
if ch = F2 then clearkeys;
end;
pollkeys;
until ch = Esc;
cursoron;
end.
{ -------------------------------------------------------------------------- }
These following procedure have no examples as yet ..............
clearbuffer;
freshcahr;
keypause;
lastkey;
nextkey;
{ -------------------------------------------------------------------------- }