home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 1999 September
/
Chip_1999-09_cd.bin
/
internet
/
Jeremy
/
tp
/
downloads
/
keybar.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1999-08-03
|
2KB
|
77 lines
unit keybar;
interface
procedure ReadKb(Klavesa, popis: string; znak: char; prikaz: word);
function GetKeyBar: word;
implementation
uses crt,vstupsav;
var
keys: array [1..12] of record
KKlavesa: string[5];
KPopis: string[10];
KZnak: char;
KPrikaz: word;
end;
const
KbCount: byte = 0;
Keybs: set of char = [];
StartPosKb: byte = 4;
KbCode=16*7+yellow;
KbPopis=16*7+white;
KbStand=16*7+black;
procedure ReadKb(Klavesa, popis: string; znak: char; prikaz: word);
begin
KbCount:=KbCount+1;
Keys[KbCount].KKlavesa:=klavesa;
Keys[KbCount].KPopis:=Popis;
Keys[KbCount].KZnak:=znak;
Keys[KbCount].KPrikaz:=prikaz;
Keybs:=Keybs+[znak];
end;
procedure KbNul;
begin
KbCount:=0;
StartPosKb:=4;
Keybs:=[];
end;
function GetKeyBar: word;
var
I,J,maxX: byte;
key: char;
begin
gotoxy(StartPosKb,25);
for I:=1 to KbCount do
begin
textattr:=KbCode;
write(keys[I].KKlavesa,' ');
textattr:=KbPopis;
write(keys[I].KPopis);
gotoxy(wherex+1,25);
end;
{maxX:=wherex;}
key:=GetLegalKey(keybs);
for I:=1 to kbCount do
begin
if key=keys[I].KZnak then
begin
GetKeyBar:=keys[I].KPrikaz;
textattr:=kbStand;
for J:=StartPosKb to 78 do
begin
gotoxy(j,25);
write(#205);
end;
KbNul;
exit;
end;
end;
end;
BEGIN
END.