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 

Right mouse button added functionality- Doubleclick it!
Goto page Previous  1, 2
 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
Riccardo
Guest





PostPosted: Tue Apr 04, 2006 1:54 pm    Post subject: Reply with quote

Laszlo wrote:
If you only want to use double right-click, it is much simpler. I use the following script to pop up a menu with my personal data I have to enter often into fields on Web forms, but you can use it for anything else. It does not affect right-dragging.
Code:
~RButton::
   If (A_PriorHotKey = A_ThisHotKey and A_TimeSincePriorHotkey < 500) {
      Sleep 200   ; wait for right-click menu, fine tune for your PC
      Send {Esc}  ; close it
      MsgBox OK   ; your double-right-click action here
   }
Return


This script disables the right button mouse context menu.
That shouldn't be.

How can I use the right mouse button double click without loosing the context menu?

cu

Richard
Back to top
PhiLho



Joined: 27 Dec 2005
Posts: 6721
Location: France (near Paris)

PostPosted: Tue Apr 04, 2006 2:20 pm    Post subject: Reply with quote

1) The comments are explicit...
2) If you single right click, the context menu is here.
3) If you double right click, it is to perform some special function (like a hotkey), so the original function of the right click (context menu) must be disabled. Or so I think.
_________________
vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2")
Back to top
View user's profile Send private message Visit poster's website
TheIrishThug



Joined: 19 Mar 2006
Posts: 381

PostPosted: Tue Apr 25, 2006 5:38 pm    Post subject: Reply with quote

Found this script and can't get enough of the copy/paste with the right button. Then I realized it was kinda silly to exclude cut from the excitement that is mouse functions. I opted for a two button hold instead of a triple click because I'm impatient and don't want to wait for the right click menu.
Code:
#SingleInstance force
Rbutton::
keywait, rbutton, t0.2
if errorlevel = 1
{
;
;'press-n-hold'
; If middle button is pressed, Cut
; Else Copy
;
if GetKeyState("mbutton")
  send, ^x
else
  send, ^c
return
}
else
keywait, rbutton, d, t0.2
if errorlevel = 0
{
;
; 'double click'
;
send, ^v
return
}
else
;
; regular single click
;
mouseclick, right
return
Back to top
View user's profile Send private message Visit poster's website AIM Address
robiandi
Guest





PostPosted: Wed Apr 26, 2006 1:17 pm    Post subject: Reply with quote

@TheIrishThug
Your script is very useful for me, thank you
(TheGermanThug)
Back to top
rdk
Guest





PostPosted: Mon Jan 15, 2007 6:26 pm    Post subject: Reply with quote

Finally! I have been so much looking for closing windows on double-right-click. And now it can be done!

This is the only thing I am missing from Lotus Notes behavior - closing window on mouse right double-click.

So I am using this code:

Code:


~RButton::
   If (A_PriorHotKey = A_ThisHotKey and A_TimeSincePriorHotkey < 500) {
      Sleep 200   ; wait for right-click menu, fine tune for your PC
      Send {Esc}  ; close it
      Send !{F4}  ; close window ALT-F4
   }
Return



Thanks a lot.
Back to top
Laszlo



Joined: 14 Feb 2005
Posts: 4078
Location: Pittsburgh

PostPosted: Mon Jan 15, 2007 7:56 pm    Post subject: Reply with quote

The following script should be a little more robust, but much depends on the applications you are running. Choose the one which works better for you.
Code:
~RButton Up::
   If (A_PriorHotKey = A_ThisHotKey and A_TimeSincePriorHotkey < 500) {
        ControlSend,,{ESC}, ahk_id %ID%
        WinClose ahk_id %ID%
   }
   Else WinGet ID, ID, A
Return
Back to top
View user's profile Send private message
sabot7726



Joined: 27 Nov 2006
Posts: 22

PostPosted: Mon Jan 15, 2007 11:14 pm    Post subject: Add a buffer for cases of accidental drag? Reply with quote

I was playing around with shimanov's version of this as I think it will add some functionality to an app I use all the time. The problem is, most people who are right clicking will also inadvertanatly move the mouse a couple pixels in any direction.

The way this script is right now, it picks that up as a "right click and drag" function, even if someone is simply trying to double click. Is there any way to add a 5 or 10 pixel buffer in any direction without flagging it as a drag operation?
Back to top
View user's profile Send private message
ZeLen1y



Joined: 11 Oct 2006
Posts: 7

PostPosted: Tue Jan 16, 2007 1:40 am    Post subject: Reply with quote

Some my functions
Code:
VarBetween(Var, Low, High) {
  If Var between %Low% and %High%
    Return, True
}

DoubleClickTime() {
  Return, DllCall("GetDoubleClickTime")
}

KeyIsDoublePressed() {
  If (A_PriorHotKey = A_ThisHotKey and VarBetween(A_TimeSincePriorHotkey, "100", DoubleClickTime()))
    Return, A_TimeSincePriorHotkey
}


Last edited by ZeLen1y on Wed Jan 17, 2007 12:18 am; edited 2 times in total
Back to top
View user's profile Send private message
rdk
Guest





PostPosted: Tue Jan 16, 2007 6:03 pm    Post subject: Reply with quote

Laszlo wrote:
The following script should be a little more robust, but much depends on the applications you are running. Choose the one which works better for you.
Code:
~RButton Up::
   If (A_PriorHotKey = A_ThisHotKey and A_TimeSincePriorHotkey < 500) {
        ControlSend,,{ESC}, ahk_id %ID%
        WinClose ahk_id %ID%
   }
   Else WinGet ID, ID, A
Return


Thank you Laszlo. I just updated that a little bit in order to close tabs in Firefox instead of the whole window...
Code:

~RButton Up::
   If (A_PriorHotKey = A_ThisHotKey and A_TimeSincePriorHotkey < 500) {
        ControlSend,,{ESC}, ahk_id %ID%
        WinGetClass class, A
        If (class = "MozillaUIWindowClass") {
          ControlSend,,^w, ahk_id %ID%
        }
        Else WinClose ahk_id %ID%
   }
   Else WinGet ID, ID, A
Return
Back to top
Funnyjunk
Guest





PostPosted: Wed Dec 26, 2007 1:29 am    Post subject: can someone make it? Reply with quote

Can someone make it for closing opera tabs please?? the shortcut to close the tabs is CTRL+W. I am not a programer but the using of right button is very usefull. Thnaks a lot, hope you enjoy too Smile




rdk wrote:
Laszlo wrote:
The following script should be a little more robust, but much depends on the applications you are running. Choose the one which works better for you.
Code:
~RButton Up::
   If (A_PriorHotKey = A_ThisHotKey and A_TimeSincePriorHotkey < 500) {
        ControlSend,,{ESC}, ahk_id %ID%
        WinClose ahk_id %ID%
   }
   Else WinGet ID, ID, A
Return


Thank you Laszlo. I just updated that a little bit in order to close tabs in Firefox instead of the whole window...
Code:

~RButton Up::
   If (A_PriorHotKey = A_ThisHotKey and A_TimeSincePriorHotkey < 500) {
        ControlSend,,{ESC}, ahk_id %ID%
        WinGetClass class, A
        If (class = "MozillaUIWindowClass") {
          ControlSend,,^w, ahk_id %ID%
        }
        Else WinClose ahk_id %ID%
   }
   Else WinGet ID, ID, A
Return
Back to top
Livonet



Joined: 17 Nov 2008
Posts: 5
Location: Norway

PostPosted: Tue Nov 18, 2008 8:05 am    Post subject: Mouse click Reply with quote

I am trying to find a routine that can give me an idea of how to link a routine that I already have, by clicking with the leftbutton of the mouse in a specific position of a window, I dont want the routine to start just clicking because it will be a disaster. Someone that can help me..! Thanks
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 
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