How to hide or close context-menu functionally.

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
dsewq1LYJ
Posts: 116
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 (v1)”

Who is online

Users browsing this forum: Marium0505 and 354 guests