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 movement

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





PostPosted: Thu Jul 17, 2008 9:58 pm    Post subject: mouse movement Reply with quote

i need a code fragment to detect any mouse movement and if the mouse does move to goto one label "if it doesnt" to goto the other.

im trying to write a script for a "security alarm" all i need now is that
thx for any help
Back to top
SpiderGames



Joined: 09 Jun 2008
Posts: 290
Location: Canada

PostPosted: Fri Jul 18, 2008 12:15 am    Post subject: Reply with quote

how about something like...
Code:

s::  ;hotkey is s
MouseGetPos, MouseX, MouseY ;gets start position
Loop,
{
Sleep, 5000  ; 5 second intervols
MouseGetPos, MouseX2, MouseY2 ;checks position
if %MouseX2% = %MouseX%
{
Continue
}
else if %MouseX2% != %MouseX%
{
; do whater your alarm event is....
Break,
}
if %MouseY2% = %MouseY%
{
Continue
}
else if %MouseY2% != %MouseY%
{
; do whater your alarm event is....
Break,
}
}


Edit:: You can make the hotkey anything... A Gui button would work too.
_________________
http://www.spider-games77.piczo.com
Join the Elite few...


Last edited by SpiderGames on Fri Jul 18, 2008 12:16 am; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
jaco0646



Joined: 07 Oct 2006
Posts: 559
Location: MN, USA

PostPosted: Fri Jul 18, 2008 12:16 am    Post subject: Reply with quote

A_TimeIdle
_________________
http://autohotkey.net/~jaco0646/
Back to top
View user's profile Send private message Visit poster's website
SpiderGames



Joined: 09 Jun 2008
Posts: 290
Location: Canada

PostPosted: Fri Jul 18, 2008 12:18 am    Post subject: Reply with quote

wow... I didn't know AHKhad that... poo...
_________________
http://www.spider-games77.piczo.com
Join the Elite few...
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
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