How to hide or close context-menu functionally.

Get help with using AutoHotkey and its commands and hotkeys
dsewq1LYJ
Posts: 114
Joined: 26 Aug 2014, 23:21

How to hide or close context-menu functionally.

06 Sep 2015, 14:03

Hi

It must be the weirdest problem...
but it's really useful for me !

Here is my code:

Code: Select all

~RButton::
RB++
SetTimer,Clean,-250
MouseGetPos,cx,cy ;~ currentX,currentY
if(RB=2)
{	
	RB:=0
    if(...)
	{	
		Send,{Esc Down}
		Sleep,1
		Send,{Esc Up}
		funcFoo()
	}
}
else if RB=1
	MouseGetPos,px,py ;~ previousX,previousY
Exit

Clean:
RB:=0
Exit
This Hotkey must activated by RButton.(I need it as RButton :wtf: )
and the -

Code: Select all

Send,{Esc Down}
Sleep,1
Send,{Esc Up}
Just for closing the context-menu.
( I did not even know how to make a if condition to detect a context-menu is "Exist", so I make this hotkey cancel always. )
and then after closed the context-menu then call the "funcFoo()".
That's all, but ... sometime the Escape mess up something( Cancel the wrong stuff or trigger built-in hotkeys ).

Please help me :headwall:

Return to “Ask For Help”

Who is online

Users browsing this forum: Bing [Bot], CarPiotr and 64 guests