AutoHotkey Community

It is currently May 26th, 2012, 10:16 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Boredom: Mouse Direction
PostPosted: May 5th, 2008, 11:20 pm 
Offline

Joined: July 15th, 2007, 1:43 am
Posts: 1320
Code:
Gui, +ToolWindow
Gui, Add, Text, w100 h20 Center vDirection
Gui, Show,, Mouse Direction
SetTimer, Update, 50
Return

Update:
MouseGetPos, X, Y
If (OldX <> X || OldY <> Y) {
   If (OldX > X)
      Direction = West
   If (OldX < X)
      Direction = East
   If (OldY < Y)
      Direction = South
   If (OldY > Y)
      Direction = North
   If (OldX > X && OldY > Y)
      Direction = NorthWest
   If (OldX > X && OldY < Y)
      Direction = SouthWest
   If (OldX < X && OldY > Y)
      Direction = NorthEast
   If (OldX < X && OldY < Y)
      Direction = SouthEast
}
MouseGetPos, OldX, OldY
GuiControl,, Direction, %Direction%
Return


Gets the current direction of the mouse and displays it..

_________________
Religion is false. >_>


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 24th, 2008, 7:22 pm 
Offline
User avatar

Joined: August 11th, 2004, 1:47 am
Posts: 5347
Location: UK
This would be a useful algorithm for mouse gesture scripts.

_________________
GitHubScriptsIronAHK Contact by email not private message.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], xXDarknessXx and 10 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group