Annoying menu showing up Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
virtualauto
Posts: 26
Joined: 19 Jun 2016, 01:04

Annoying menu showing up

19 Apr 2018, 23:04

I have this very simple script that opens a folder named "Z" but then the menu (the one that says "Copy" "View" "Properties", etc) shows up as if I had right clicked over the folder. This seems to happen AFTER the script finishes, so I can't do anything inside of it to prevent this behaviour. If I remove the ~ the right click is disabled in the windows explorer (among other things)

Code: Select all

~RButton & LButton::
	Run, "Z:"
	WinActivate, Z (Z:)
	WinWaitActive, Z (Z:)
	WinMaximize, Z (Z:)
	Return
Rohwedder
Posts: 7628
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Annoying menu showing up

20 Apr 2018, 00:37

Hallo,
try:

Code: Select all

~RButton & LButton::
	Run, "Z:"
	WinActivate, Z (Z:)
	WinWaitActive, Z (Z:)
	WinMaximize, Z (Z:)
	WinWait, ahk_class #32768,, 3
	Sleep, 100
	WinClose
Return
virtualauto
Posts: 26
Joined: 19 Jun 2016, 01:04

Re: Annoying menu showing up

20 Apr 2018, 01:31

Rohwedder wrote:Hallo...
LOL your script hides the menu because it closes the Z folder too :lol: The problem is that the annoying menu seems to be triggered AFTER the script finishes (after the "return", a vicious right click is executed over the folder Z), so anything inside the script is probably useless (at least that is what I think).
User avatar
jeeswg
Posts: 6902
Joined: 19 Dec 2016, 01:58
Location: UK

Re: Annoying menu showing up

20 Apr 2018, 04:03

How about this? Cheers.

Code: Select all

LButton & RButton::
RButton & LButton::
MsgBox
return
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
Rohwedder
Posts: 7628
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Annoying menu showing up

20 Apr 2018, 04:22

Hallo,
try:

Code: Select all

~RButton & LButton::
KeyWait, RButton
Send, {Esc}
MsgBox
return
virtualauto
Posts: 26
Joined: 19 Jun 2016, 01:04

Re: Annoying menu showing up

20 Apr 2018, 08:58

jeeswg wrote:How about this? ...
:o That code left my mouse like a brick, not working.
virtualauto
Posts: 26
Joined: 19 Jun 2016, 01:04

Re: Annoying menu showing up

20 Apr 2018, 09:03

Rohwedder wrote:Hallo...
Not working. The problem seems to be that a right click is generated after the script finishes, and the ~ is the one to blame. Unfortunately I can't delete it because it disables the right click functionality in the windows explorer (among other things).
virtualauto
Posts: 26
Joined: 19 Jun 2016, 01:04

Re: Annoying menu showing up  Topic is solved

06 May 2018, 22:09

For anyone looking for an answer to the same problem: you should use a timer https://autohotkey.com/docs/commands/SetTimer.htm. Then use a

Code: Select all

Send, {Esc}
or some other sorcery to exit that annoying menu showing up as a result of the tilde being used.
User avatar
BriHecato
Posts: 124
Joined: 18 Jul 2017, 07:17

Re: Annoying menu showing up

07 May 2018, 03:38

That's why one avoid hotkeys for left/right/middle mouse buttons they for sure have "built in" functions in OS.

Better chordings are

Code: Select all

XButton4 & RButton::
Ctrl & RButton::
WheelLeft::

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Anput, Rohwedder and 364 guests