Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

MsMouse in xds

41 views
Skip to first unread message

Jack Dawkins

unread,
May 31, 2023, 6:32:49 AM5/31/23
to
I'm using xds Win32 which has a module MsMouse in the topspeed compatibility pack. However, it wasn't part of the original topspeed as far as I'm aware and I can't find any documentation about how to use the modules other than in the definition file. Has anyone used MsMouse? Thanks for any help.

OrangeFish9737

unread,
May 31, 2023, 11:05:33 AM5/31/23
to
It appears, from the XDS source to the TSCP documentation
(https://github.com/excelsior-oss/xds/blob/cfd20e209193c9cfcee94ad2ca30d8c32ead48c9/Sources/Doc/Comp/src/tscp.tex),
that they meant to include documentation but never did. (The header
appears to contain a to-do list that includes MsMouse.)

The actual implementation, if of any help, is here:
https://github.com/excelsior-oss/xds/blob/cfd20e209193c9cfcee94ad2ca30d8c32ead48c9/Sources/Lib/src/TSlibs/Win32/MsMouse.mod

O.F.

Jack Dawkins

unread,
May 31, 2023, 12:36:00 PM5/31/23
to
Thanks for the links. I'll try posting a new issue asking for docs or an example using the module. I've had some success using the GetPress procedure but it's not working the way I expected. I'll post the code later.

Chris Burrows

unread,
May 31, 2023, 5:32:19 PM5/31/23
to
On Wednesday, May 31, 2023 at 8:02:49 PM UTC+9:30, Jack Dawkins wrote:
> I'm using xds Win32 which has a module MsMouse in the topspeed compatibility pack. However, it wasn't part of the original topspeed as far as I'm aware and I can't find any documentation about how to use the modules other than in the definition file. Has anyone used MsMouse? Thanks for any help.

MsMouse was in v3.1 of TopSpeed Modula-2 and is documented in the Reference Manual. The source code of the module was included but I can't find any example code.

Jack Dawkins

unread,
Jun 1, 2023, 5:12:26 AM6/1/23
to
Thanks Chris. I found some code (see URL below) which explained why my first attempt wasn't working properly. When using GetPress the actions variable is set to 1 once after a click, so you need to check for this otherwise whatever you want to happen after a click will keep occurring until the next click. Here's some code which increments n and prints its value when you click within lines 0-5 of the console, and quits when the click is located > line 20.

MODULE mouse;
IMPORT MsMouse, IO, Lib;
VAR
n : INTEGER;
gm : MsMouse.MsData;
BEGIN
MsMouse.InitMouse();
n := 0;
REPEAT
Lib.Delay(100); (* look for a click every 0.1 secs *)
MsMouse.GetPress(0, gm);
IF (gm.row >= 0) & (gm.row <= 5) & (gm.actions = 1) THEN
INC(n);
IO.WrInt(n,0);
IO.WrLn;
END;
UNTIL gm.row > 20;
END mouse.

There is some other code demonstrating mouse usage at
http://parallel.vub.ac.be/education/modula2/technology/index.html

You will also find a library (a wrapper for the Windows API) called "WimDows" here.
It was written for XDS and is supposed to be easy to use. Might be worth checking out.

Chris Burrows

unread,
Jun 3, 2023, 7:38:03 PM6/3/23
to
On Thursday, June 1, 2023 at 6:42:26 PM UTC+9:30, Jack Dawkins wrote:
> Thanks Chris. I found some code (see URL below) which explained why my first attempt wasn't working properly. When using GetPress the actions variable is set to 1 once after a click, so you need to check for this otherwise whatever you want to happen after a click will keep occurring until the next click.

Good to hear you are making progress. This behaviour, and other useful relevant information, is documented here:

https://digitalmars.com/rtl/msmouse.html


0 new messages