Amiga.org

Operating System Specific Discussions => Amiga OS => Amiga OS -- Development => Topic started by: ChaosLord on July 22, 2004, 07:33:58 PM

Title: Disengage the mouse?
Post by: ChaosLord on July 22, 2004, 07:33:58 PM
What is the best way to disengage the mouse via software?

I need to know how to do this so I can code tutorials which move the mouse around and do stuff to teach the user how to do things.

I know how to move the pointer around by feeding fake input events thru the OS.  But if the user bumps the mouse during this time they knock my plans off wack.

How do I temporarily disengage the physical mouse
(The thing you roll around on the table)
from the mousepointer on the screen?

What is the easiest way to disengage the mouse via software?



I know how to make the mousepointer go blank, but the pointer is still "there" and still moves with the mouse, you just can't see it.

I know how to use Intuition WINDOW_INACTIVE to detect when my window is no longer active (so I can re-engage the mouse once you teach me how to disengage it :)

I speak C+asm.  I can read many other languages such as E, BB2, Arexx, etc.  so feel free to explain this in the language you like best.

Bonus Spells will be awarded if you post some example code that actually disengages the mouse.

My compiler is SASC.  My Assembler is DevPac.

Thank you very much for any help you provide.

P.S.  The first person who replies "Just put up a requester that says
'Please unplug your mouse now'"
will receive, absolutely free of charge, a RKRM upside the head.  :D


Title: Re: Disengage the mouse?
Post by: Steady on July 23, 2004, 09:47:04 AM
Maybe you could try making your training program a Commodity as described in Libraries RKRM.

You could use the Commodity to let the mouse information though to Intuition when you need to, and you can also use it to swallow mouse messages and supply fake messages when you need to as well.

Perhaps it can be installed when your tutorial runs. It would wait for instructions from your main program in the form of exec messages (ie: enable_mouse, disable_mouse, insert_event, quit etc)

After the tutorial part, the Commodity can be shut down.
Title: Re: Disengage the mouse?
Post by: Thomas on July 23, 2004, 01:07:02 PM

Yes, a commodity is the OS2.0+ style of doing it. The 1.3 style is to install an input handler which removes the mouse events from the input stream. IMHO this is easier.

Still the RKRMs will tell you how to do it.

There are two other methods which will more or less annoy the user:

1. always move the pointer to an absolute position whenever you need it. So the user can move around the pointer but you will force it to the desired position when needed.

2. let the user move his pointer as he likes (or make it invisible) and draw your own pointer into your application's window.

Bye,
Thomas