• MsMouse in xds

    From Jack Dawkins@21:1/5 to All on Wed May 31 03:32:48 2023
    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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From OrangeFish9737@21:1/5 to Jack Dawkins on Wed May 31 11:05:29 2023
    On 2023-05-31 06:32, 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.

    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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Jack Dawkins@21:1/5 to All on Wed May 31 09:35:58 2023
    On Wednesday, 31 May 2023 at 16:05:33 UTC+1, OrangeFish9737 wrote:
    On 2023-05-31 06:32, 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.
    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.
    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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Chris Burrows@21:1/5 to Jack Dawkins on Wed May 31 14:32:18 2023
    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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Jack Dawkins@21:1/5 to Chris Burrows on Thu Jun 1 02:12:25 2023
    On Wednesday, 31 May 2023 at 22:32:19 UTC+1, Chris Burrows wrote:
    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.

    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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Chris Burrows@21:1/5 to Jack Dawkins on Sat Jun 3 16:38:01 2023
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)