[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MiNT] event_multi() (was Re: AES-Messages)



Stanislav Opichal wrote:
> 
> Hi All!
> 
> Please give me an advice about how to use $subj function in connection to
> concurrent handling of AES messages and mouse movement using MU_MESSAG |
> MU_M? mode.
> When I use it in single TOS or in Magic everything is fine. But in MiNT it
> eats nearly all processor time. It is definitelly caused by the MU_M?
> mode, because it generates the events non-stop when the mouse pointer is
> in the desired area. Is there any other way how to scan mouse movement
> without any button pressed? (this does the MU_BUTTON mode)
> May be setiing of any other parameter of event_multi does this, but I
> didn't find any description anywhere.

The MU_M? event needs five parameters: x,y,width,height for the
rectangel
to be area and a flag if the event should appear if the mouse enters or
leaves this area. To track mouse pointer movement you have to do the
following in your event loop:

1) Set the flag to the mode for leave the area and width/height to 1/1
(not
   0/0, this would cause always an event). Than get the actual mouse
pointer
   position (AFAIR graf_mstate).

2) Save the mouse pointer position as x/y for the area.

3) Do your other stuff for the loop.

4) Call evnt_multi.

5) If there was a MU_M? event, do for what you need it for, get the
actual
   mouse pointer position from the event struct and go to 2). Else go to
3).

This let your program return from the evnt_multi only if there was
really
a mouse pointer movement.

Regards,
	Ralph


---
ATARI Falcon CenTURBO IIB 4/32MB 1.2/2.1GB
------------------------------------------
mailto://AltF4@atari.org