AutoHotkey Community

It is currently May 27th, 2012, 4:57 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: April 14th, 2010, 9:33 am 
Offline

Joined: September 25th, 2008, 9:33 am
Posts: 10
Location: Germany
This almost entirely nicked from TheIrishThug, from his post in
www.autohotkey.com/forum/topic8357-15.html

His script gives you, on top of additional RButton double- and long clicks, a RButton & MButton combo.

I just replaced that single combo by 4 mini Gestures, one for any diagonal direction. I chose diags
because that is the simplest maths.

Mine does not work for the RButton or LButton, because it interferes with dragging.
It does work for the MButton, but in my opinion, it is best when used with the XButtons.

Code:
;  Mainly nicked from
;  TheIrishThug, in www.autohotkey.com/forum/topic8357-15.html   
;  from Tue Apr 25, 2006.
;  miniGestures added by
;  SoerenB, Apr 14, 2010
#Persistent
#singleinstance force

SetMouseDelay, 0

Ti = 4      ; Doesn't detect gesturing when moved VERY little

XButton1::
MouseGetPos,mGX1,mGY1   ; get coords to start with
keywait, XButton1, t0.2   ; to identify long Clicks
if errorlevel = 1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
{
MouseGetPos,mGX2,mGY2   ; get second coords when Button is released
         ;
         ;'press-n-hold'
         ;
;;;;;;;;;;;;; If GESTURE, -> ACTION (replace MsgBoxLines with YOUR actions);;;;;;;;;;;
         ;            
   if(mGX2>mGX1+Ti and mGY2<mGY1-Ti)
   {
   msgBox, , ,XButton1 Act 1`nUPRIGHT!, 0.6
   return
   }
   if(mGX2<mGX1-Ti and mGY2>mGY1+Ti)
   {
   msgBox, , ,XButton1 Act 2`nDOWNLLEFT!, 0.6
   return
   }
   if(mGX2<mGX1-Ti and mGY2<mGY1-Ti)
   {
   msgBox, , ,XButton1 Act 3`nUPLEFT!, 0.6
   return
   }            ;
   if(mGX2>mGX1+Ti and mGY2>mGY1+Ti)
   {
   msgBox, , ,XButton1 Act 4`nDOWNRIGHT!, 0.6
   }
else
msgBox, , ,XButton1 LONG`nUNMOVED, 0.6
return
}
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
   else
keywait, XButton1, d, t0.24
if errorlevel = 0
{         ; 'double click'
         ;;;;;;;  I think it is here that an additional GesturesBlock ;;;;;;
         ;; could go in for double-click MiniGestures. I'm quite sure
         ;; the timing would be more critical - can't memorize so many
         ;; actions, anyway, so I won't try to implement.
   {
   msgBox, , ,XButton1`nDOUBLE CLICK, 0.6
   }
   return
}
else         ; regular single click
         ;         
mouseclick, X1      ; does a "BrowserBack" with my mouse
return

_________________
Cheers,
SoerenB


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 9 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