Category : Pascal Source Code
Archive   : TDMENU.ZIP
Filename : TPPDMOUS.PAS
{$IFDEF Ver40}
{$F-}
{$ELSE}
{$F+}
{$O-}
{$ENDIF}
{$IFDEF Debug}
{$D+}
{$ENDIF}
{Conditional defines that may affect this unit}
{$I TPDEFINE.INC}
{*********************************************************}
{* TPPDMOUS.PAS 5.06 *}
{* Copyright (c) Ken Henderson 1989, 1990. *}
{* *}
{* *}
{* *}
{*********************************************************}
unit TpPdMous;
{-Mouse support for TpPdMenu.}
interface
uses
TpCrt, {Turbo Professional CRT unit}
Dos, {DOS interface - standard unit}
TpMouse, {Turbo Professional mouse routines}
TpInline;
var
MouseWasMoved : Boolean;
SaveInt33 : Pointer;
CmdStringWord : Word;
MouseWasX, MouseWasY, MouseIsX, MouseIsY, MouseSenX, MouseSenY, SlowMouseSenX, SlowMouseSenY : Byte;
const
MStatus : ButtonStatus = NoButton;
procedure AllPurposeEventHandler;
{-Event handler}
procedure InitMouseSettings;
{-Reinitializes mouse and sets MouseInstalled}
{==========================================================================}
implementation
var
MousePosX, MousePosY : Byte;
Ch : Char;
procedure AllPurposeEventHandler;
begin
MouseWasX := MouseIsX;
MouseWasY := MouseIsY;
MouseWhereXY(MouseIsX, MouseIsY, MStatus);
if MouseIsY > MouseWasY then StuffKey($5000);
if MouseIsY < MouseWasY then StuffKey($4800);
if MouseIsX > MouseWasX then StuffKey($4D00);
if MouseIsX < MouseWasX then StuffKey($4B00);
if MStatus <> NoButton then
begin
case MStatus of
LeftButton :
begin {Left button}
StuffKey($000D); {Insert
end;
RightButton :
begin {Right button}
StuffKey($001B); {Insert
end;
BothButtons..All3Buttons :
begin {Insert
StuffKey($3B00);
end;
end;
end;
if (MouseIsX = Succ(MouseXLo)) or (MouseIsX = MouseXHi) or
(MouseIsY = Succ(MouseYLo)) or (MouseIsY = MouseYHi) then
begin
MouseWasX := 40;
MouseWasY := 12;
MouseIsX := MouseWasX;
MouseIsY := MouseWasY;
MouseGotoXy(MouseWasX, MouseWasY);
end;
end;
procedure InitMouseSettings;
var
strnum : String;
num, res : Integer;
MouseCharacter : Byte;
begin
{no need to install exit handler if not installed}
if MouseInstalled then
begin
FullMouseWindow;
MouseWasX := 40;
MouseWasY := 12;
MouseIsX := MouseWasX;
MouseIsY := MouseWasY;
MouseSenX := 8;
MouseSenY := 24;
SlowMouseSenX := 88;
SlowMouseSenY := 48;
MouseGotoXy(MouseWasX, MouseWasY);
SetMickeyToPixelRatio(SlowMouseSenX, SlowMouseSenY);
SetMouseEventHandler(AllMouseEvents, @AllPurposeEventHandler);
end;
end;
begin
GetIntVec($33, SaveInt33); {Save off the mouse interrupt}
{initialize the mouse if one is installed (sets MouseInstalled)}
if MouseInstalled then InitMouseSettings;
end.
Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!
This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.
But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/