Jump to content

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

Cannot stop right click menu from displaying


  • Please log in to reply
2 replies to this topic
ZirePhoenix
  • Members
  • 16 posts
  • Last active: Oct 07 2010 01:35 AM
  • Joined: 08 Apr 2009
Hello. I want to create a hotkey using the Right Mouse button. However, I haven't figured out a way to reliably disable the default context menu from showing up.

If I a blank hotkey like this:

RButton::
return

Right click is effectively disabled.

However, if I do something that uses Menu, like this:

RButton::
Menu,DirMenu,show
return

The menu does show up all the time, but the default context menu will also show up if I right click, drag the mouse away from the custom menu, and release the button. The RButton release seems to trigger the default context menu, and I don't know how to disable that.

The above code is an implementation of this script:

<!-- m -->http://www.autohotke...topic.php?t=772<!-- m -->

sinkfaze
  • Moderators
  • 6367 posts
  • Last active: Nov 30 2018 08:50 PM
  • Joined: 18 Mar 2008
RButton:
Sleep, 50 ; give the default context menu an oppotunity to show up
Send {CTRLDOWN}{ALTDOWN}{ALTUP}{CTRLUP} ; should close the default context menu if it exists
Menu, DirMenu, Show 
return

Idea taken from this thread:

How to detect and close a context menu?

ZirePhoenix
  • Members
  • 16 posts
  • Last active: Oct 07 2010 01:35 AM
  • Joined: 08 Apr 2009
Hmm, I found out that if I bound the key as RButton Up, it works a lot better.