Discussion:
MsMouse in xds
(too old to reply)
Jack Dawkins
2023-05-31 10:32:48 UTC
Permalink
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
2023-05-31 15:05:29 UTC
Permalink
Post by Jack Dawkins
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.
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
2023-05-31 16:35:58 UTC
Permalink
Post by OrangeFish9737
Post by Jack Dawkins
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.
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.)
https://github.com/excelsior-oss/xds/blob/cfd20e209193c9cfcee94ad2ca30d8c32ead48c9/Sources/Lib/src/TSlibs/Win32/MsMouse.mod
O.F.
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
2023-05-31 21:32:18 UTC
Permalink
Post by Jack Dawkins
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
2023-06-01 09:12:25 UTC
Permalink
Post by Chris Burrows
Post by Jack Dawkins
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.
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
2023-06-03 23:38:01 UTC
Permalink
Post by Jack Dawkins
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

Loading...