[solved] Is it possible to activate a Window just by moving the mouse on it ?

12 posts / 0 new
Last post
zzd10h
zzd10h's picture
Offline
Last seen: 6 years 11 months ago
Joined: 2012-08-24 20:56
[solved] Is it possible to activate a Window just by moving the mouse on it ?

Hi,
I would like to know if it's possible to activate a window only by moving the mouse in it (without clicking) ?

Or is an inactive window can analyze the MouseX/MouseY coordinates ?

Thank you by advance.

broadblues
broadblues's picture
Offline
Last seen: 4 years 8 months ago
Joined: 2012-05-02 21:48
Use a commodity and use which

Use a commodity and use which extreme care making it user option as this is not good style.

jabirulo
jabirulo's picture
Offline
Last seen: 6 hours 39 min ago
Joined: 2013-05-30 00:53
AutoPoint commodity activates

AutoPoint commodity activates window when you move/hover pointer over it. So it could be possible.

AOS4.1/SAM460ex/PPC460EX-1155MHZ/2048MB/RadeonHD6570/SSD120GB/DVDRW :-P

broadblues
broadblues's picture
Offline
Last seen: 4 years 8 months ago
Joined: 2012-05-02 21:48
@jabirulo It is indeed

@jabirulo

It is indeed possible, zzdh10 needs to make his app a commodity, then monitor raw mouse events for the position of the mouse and when over his apps window activate it (if appropriate).

It's really not friendlt thing to do though as you steal focus from the active application and not even if you deactivate straght away you still mess up the users active app if it does expect to lose focus at that point.

This is an issue in the toolbox window type, where the focus is not always correctly returned to some gadgets in the main window.

zzd10h
zzd10h's picture
Offline
Last seen: 6 years 11 months ago
Joined: 2012-08-24 20:56
Thank you very much. I will

Thank you very much. I will explore Commodity chapter in Wiki.

thomas
thomas's picture
Offline
Last seen: 2 months 7 hours ago
Joined: 2011-05-16 14:23
An easier way would be to

An easier way would be to establish a timer which lets you regularly check the MouseX and MouseY fields of your window.

In any case you also have to check if the mouse pointer is really over a visible area of your window and not only inside the range of your window but over another window which overlaps yours.

zzd10h
zzd10h's picture
Offline
Last seen: 6 years 11 months ago
Joined: 2012-08-24 20:56
"if the mouse pointer is

"if the mouse pointer is really over a visible area of your window"

It's possible to determine if the mouse is on a visible area of a window ?
Very interesting ! Could you say more on that please ?

Thank you

mritter0
mritter0's picture
Offline
Last seen: 2 years 4 months ago
Joined: 2014-04-21 21:15
HeliosMouse on Aminet with

HeliosMouse on Aminet with source code. Many more on there. I used to use one back in the day.

zzd10h
zzd10h's picture
Offline
Last seen: 6 years 11 months ago
Joined: 2012-08-24 20:56
Thank you very much Thomas

Thank you very much Thomas and mritter0,

with a timer and WhichLayer(), I can activate my window only when a area is visible !

Very nice.

broadblues
broadblues's picture
Offline
Last seen: 4 years 8 months ago
Joined: 2012-05-02 21:48
If you are using the timer

If you are using the timer approach you might as well just listen to intuiticks in IDCMP (add IDCMP_INTUITICKS to IDCMP flags and listen for WMHI_INTUITICK )

One tick every 1/10 of a second.

thomas
thomas's picture
Offline
Last seen: 2 months 7 hours ago
Joined: 2011-05-16 14:23
You don't get INTUITICKS if

You don't get INTUITICKS if your window is not active.

zzd10h
zzd10h's picture
Offline
Last seen: 6 years 11 months ago
Joined: 2012-08-24 20:56
I just tested and I confirm,

I just tested and I confirm, no intuiticks when my window is inactive.

Log in or register to post comments