AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Mouse move detection

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
tuna



Joined: 03 Oct 2007
Posts: 47
Location: Bristol, England

PostPosted: Wed Mar 12, 2008 8:51 pm    Post subject: Mouse move detection Reply with quote

Is there a windows message that I can use that lets me know when the mouse moves on the screen. The detection must be for the whole screen, not just the gui like 0x200 WM_MOUSEMOVE.

Many thanks
Back to top
View user's profile Send private message
BoBoĻ
Guest





PostPosted: Thu Mar 13, 2008 8:13 am    Post subject: Reply with quote

MouseGetPos
CoordMode
Back to top
tuna



Joined: 03 Oct 2007
Posts: 47
Location: Bristol, England

PostPosted: Thu Mar 13, 2008 5:25 pm    Post subject: Reply with quote

Thank Bobo, though I meant without the need of a timer - just catch a system message upon mouse movement
Back to top
View user's profile Send private message
Lexikos



Joined: 17 Oct 2006
Posts: 2737
Location: Australia, Qld

PostPosted: Fri Mar 14, 2008 10:49 am    Post subject: Reply with quote

Code:
#Persistent
MouseHook := DllCall("SetWindowsHookEx", "int", 14  ; WH_MOUSE_LL = 14
    , "uint", RegisterCallback("MouseProc"), "uint", 0, "uint", 0)
return
MouseProc(nCode, wParam, lParam)
{
    global MouseHook
    Critical
    if wParam = 0x200 ; WM_MOUSEMOVE
    {
        ToolTip % NumGet(lParam+0,0,"int") ", " NumGet(lParam+4,0,"int")
    }
    return DllCall("CallNextHookEx", "uint", MouseHook
                    , "int", nCode, "uint", wParam, "uint", lParam)
}
Windows 9x not supported.
Back to top
View user's profile Send private message
tuna



Joined: 03 Oct 2007
Posts: 47
Location: Bristol, England

PostPosted: Fri Mar 14, 2008 11:41 pm    Post subject: Reply with quote

Thanks, but that only works if the script gui is activated. Is there any way that the whole screen detection can work in the background?

Thanks
Back to top
View user's profile Send private message
Lexikos



Joined: 17 Oct 2006
Posts: 2737
Location: Australia, Qld

PostPosted: Fri Mar 14, 2008 11:57 pm    Post subject: Reply with quote

I guess you didn't try the script, since it does indeed work when the script GUI is not activated. In fact, it does not even have a GUI. Rolling Eyes
Back to top
View user's profile Send private message
tuna



Joined: 03 Oct 2007
Posts: 47
Location: Bristol, England

PostPosted: Sat Mar 15, 2008 1:48 pm    Post subject: Reply with quote

Yes I did try it out, and that's what I thought too, since it doesn't need a gui to work. Now I think the problem is when I activate Notpad++ and left click, it seems to stop the detection process, and if I left click again on my primary monitor (I have 2), it starts the detection again. If I then click anywhere in Notepad++ on my secondary monitor it stops the process again until I then click on my primary monitor. Any ideas why?
Back to top
View user's profile Send private message
Lexikos



Joined: 17 Oct 2006
Posts: 2737
Location: Australia, Qld

PostPosted: Sat Mar 15, 2008 3:28 pm    Post subject: Reply with quote

Does it happen only with Notepad++? I guess Notepad++ is doing something that prevents the hook from working properly. I'm not sure anything can be done about that...
Back to top
View user's profile Send private message
NLI-C
Guest





PostPosted: Sat Mar 15, 2008 7:30 pm    Post subject: Reply with quote

Quote:
Thanks, but that only works if the script gui is activated


Uh, the script doesn't have a gui. Shocked Confused Confused
Back to top
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group