begin
if IsMouse and (NMouseItemOO) then begin
NItem := NMouseItem;
Move(ItemsList",Items,NMouseItem*SizeOf(MouseItemType)) end end; {GetMouseItem} ^——————————————_/
Function KeyOrMousePressed: Boolean;
{Возвращает TRUE, если нажата клавиша клавиатуры или кнопка ыыши} vac
b,k: Integer;
MouseActive: Boolean;
begin
(Сначала проверяем клавиатуру} if KeyPressed then
KeyOrMousePressed := True
{Если не нажата никакая клавиша/ проверяем нажатие кнопок юани} else with Reg do begin
ax :- $3;
Intr($33,Reg);
if (bx<>0) and (NMouseItemOO) then
{Да, кнопка нажата. Организуем цикл проверки по всем элементам} begin
MouseActive :» False;
for k := 1 to NMouseItem do if not MouseActive then
with ItemsList^k] do begin
case Butt of
LeftButton : b :=bx and LeftButton;
RightButton : b :=bx and RightButton;
CenterButton: b :-=bx and CenterButton;
AnyButton : b :- bx else b :« 0;
end; {caaef MouseActive := (b<>0) and
MouseIn(MouseGraphCooX<Xl),MouseGraphCooY(YD,
MouseGraphCooX(X2),MouseGraphCooY(Y2)) end; /for, if}
KeyOrMousePressed := MouseActive end {if (bx<>0) and...}
{Если не активна клавиатура яди не выбран элемент, возвращаем False} else {Ьх=0 или NMouseItemOO}
KeyOrMousePressed := False end {with Reg} end; {KeyOrMousePressed} ^————.—————————;
Function ReadKeyOrMouse: Char;
(Возвращает символ нажатой клавиши или выбранного элемента} var
k: Byte;
b,bb: Word;
MouseActive: Boolean;
label
loop;
begin