Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Right mouse button added functionality- Doubleclick it!


  • Please log in to reply
29 replies to this topic
Riccardo
  • Guests
  • Last active:
  • Joined: --

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.

~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

PhiLho
  • Moderators
  • 6850 posts
  • Last active: Jan 02 2012 10:09 PM
  • Joined: 27 Dec 2005
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.

TheIrishThug
  • Members
  • 419 posts
  • Last active: Jan 18 2012 02:51 PM
  • Joined: 19 Mar 2006
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.
#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


robiandi
  • Guests
  • Last active:
  • Joined: --
@TheIrishThug
Your script is very useful for me, thank you
(TheGermanThug)

rdk
  • Guests
  • Last active:
  • Joined: --
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:


~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.

Laszlo
  • Moderators
  • 4713 posts
  • Last active: Mar 31 2012 03:17 AM
  • Joined: 14 Feb 2005
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.
~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


sabot7726
  • Members
  • 69 posts
  • Last active: Aug 12 2013 03:29 AM
  • Joined: 27 Nov 2006
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?

ZeLen1y
  • Members
  • 44 posts
  • Last active: Oct 13 2014 09:43 PM
  • Joined: 11 Oct 2006
Some my functions
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
}


rdk
  • Guests
  • Last active:
  • Joined: --

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.

~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...
~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


Funnyjunk
  • Guests
  • Last active:
  • Joined: --
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 :)




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.

~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...
~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



Livonet
  • Members
  • 5 posts
  • Last active: Nov 18 2008 08:25 AM
  • Joined: 17 Nov 2008
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

geor
  • Members
  • 70 posts
  • Last active: Oct 02 2013 10:27 PM
  • Joined: 16 Jun 2008

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



i reply to this older thread,
because i was having this same problem also,
and want to maybe help others who wish to enjoy this functionality --->

i also use StrokeIt configed to activate w/ the RButton,
and this script doesn't interfere with that, or with any Rclick-drag.

********************

i use Ditto clipboard manager, and set Alt-C as my hotkey to activate it out of the systray.

i wanted to further bind Alt-C so i could activate it with a Rclick but not have the context menu messed up,
so i experimented with this script and changed the line

If (A_PriorHotKey = A_ThisHotKey and A_TimeSincePriorHotkey < 500) {

to the value of 100 ms instead of 500 ms, like so :

If (A_PriorHotKey = A_ThisHotKey and A_TimeSincePriorHotkey < 100) {

thinking that it would require a faster double-click, and it does work!

so, if i only single click, the context menu comes up like normal,

but if i double-click (relatively) fast -
(obviously fine-tuned for my neuromuscular system 100 ms is fine),

then it sends Alt-C and fires up Ditto.

This greatly increases my productivity & enjoyment,
and i surely thank the people who contribute here on AHK :D

james062
  • Members
  • 75 posts
  • Last active: Jan 11 2014 07:36 PM
  • Joined: 05 Oct 2009
This is a very helpful script , I modified it a little to use middle mouse button instead of right button . It gave me lots more functions with my 8 key game mouse.
Extra functions can also be routed to extra buttons on mouse ( Buttons 4 and 5)
:)

rkayd
  • Members
  • 21 posts
  • Last active: Mar 10 2014 09:09 PM
  • Joined: 13 Jun 2012
I don't know the policies of bringing up old threads but my question has to do with the script sample in this thread.

I couldn't get shimanov's script to work at first but after I found a link to the latest AHK it worked. I was wondering if there was some way to add to this to get the same functionality to the left & middle buttons. Using Jak's script I could get the middle button working but the left button didn't work, especially since you often need to drag with the left button. I also got some multibutton hotkeys working with Jak's script (Rbutton&MButton, MButton&LButton, etc), but it wouldn't work with LButton&Rbutton or LButton&Mbutton and it disabled the hold single clicks. I tried setting up the multi-button scripts together with shimanov's script but that basically disables shimanov's script. So, I was wondering if there was a way to keep the functionality of the right button as shimanov has it, but somehow add multi-button support besides, and ideally with left button hold

Pulover
  • Members
  • 1596 posts
  • Last active: Sep 13 2014 08:44 PM
  • Joined: 20 Apr 2012

So, I was wondering if there was a way to keep the functionality of the right button as shimanov has it, but somehow add multi-button support besides, and ideally with left button hold

Hi, there!
I couldn't get shimanov's script to work, but after I read this thread I decided to try to create one myself based on another script I had made to this thread.
I've created a function that should allow you to select a subroutine to trigger for holding and another for double clicking any button of the mouse you choose, and it works with combinations. I have tested with msgboxes and it seems to work fine.
I posted the code here: <!-- l --><a class="postlink-local" href="http://www.autohotkey.com/community/viewtopic.php?f=13&t=87625">viewtopic.php?f=13&t=87625</a><!-- l -->