Hotkey opens start menu

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
0xDEADC0DE
Posts: 10
Joined: 14 Jan 2016, 10:31

Hotkey opens start menu

09 Jan 2018, 19:11

I have a hotkey Win+Ü to translate the current selected string

Code: Select all

;Translate with LEO
#ü::
    tmp = %ClipboardAll%   ;Save Clipboard
    Send, ^c               ;Simulate Ctrl+C (=selection in clipboard)
    word = %Clipboard%     ;save the content of the clipboard in the variable word
    Clipboard = %tmp%      ;restore old content of the clipboard
    ;show the translation of the selected word by opening dict.leo.org in the standard-browser
    Run, http://dict.leo.org/?search=%word%
Return
This was working fine until 1.1.27. Not the start menu opens when I press the hotkey.
I've read the changelog about #MenuMaskKey and other solutions but nothing was working.
What do I need to change so the start menu doesn't open?
Rohwedder
Posts: 7630
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Hotkey opens start menu

10 Jan 2018, 03:10

Hallo,
here the script works fine with 1.1.27.03.
Try to disable the ability of LWin to activate the Start Menu with

Code: Select all

~LWin::Send {Blind}{vk07}
I prefer

Code: Select all

~LButton & ü::
for this purpose.
Select the string with LButton, keep LButton pressed and press ü.
lexikos
Posts: 9583
Joined: 30 Sep 2013, 04:07
Contact:

Re: Hotkey opens start menu

10 Jan 2018, 03:51

Like Rohwedder, I was unable to reproduce the problem with v1.1.27.03.

I was also unable to reproduce the problem with v1.1.27.00.

However, I have no ü key, so I tested with a different key. I'm fairly certain there is nothing special about the ü key. There is a bug fix (actually, an added workaround for a Windows quirk) in v1.1.27.01 relating to the Start menu activating when you switch from a layout with AltGr to one without (such as by activating a different window). However, I tested your script in that situation and as expected, it worked correctly for me even on v1.1.27.00, because Send ^c has the effect of suppressing the Start menu.

Use Send {Blind}{vk07} near the top of the hotkey if you must. Do not use ~LWin::Send {Blind}{vk07} unless you want to totally disable the ability to show the Start menu with LWin.
0xDEADC0DE
Posts: 10
Joined: 14 Jan 2016, 10:31

Re: Hotkey opens start menu

10 Jan 2018, 03:52

The script is not working anymore for me as it opens the start menu and so the CTRL+C send doesn't copy the selected text.

I also tried

Code: Select all

~LWin::Send {Blind}{vk07}
but that is not what I want as I use this key to open the start menu.

Any other solutions or do I have to go back to <1.1.27 ?
lexikos
Posts: 9583
Joined: 30 Sep 2013, 04:07
Contact:

Re: Hotkey opens start menu

10 Jan 2018, 04:24

0xDEADC0DE wrote:I also tried

Code: Select all

~LWin::Send {Blind}{vk07}
but that is not what I want as I use this key to open the start menu.
I'm guessing you did not read my post before posting this (within a minute of my post).

I do not see how your hotkey can trigger the Start menu. Does it happen with this?

Code: Select all

#ü::return
What does KeyHistory show after you press the hotkey?

Code: Select all

#ü::
KeyWait ü
KeyWait LWin
KeyWait RWin
KeyHistory
return

Code: Select all

#ü::
    tmp = %ClipboardAll%
    Send, ^c
    word = %Clipboard%
    Clipboard = %tmp%
    Run, http://dict.leo.org/?search=%word%
    KeyHistory ; <<---
Return
0xDEADC0DE
Posts: 10
Joined: 14 Jan 2016, 10:31

Re: Hotkey opens start menu

10 Jan 2018, 04:57

lexikos wrote:I'm guessing you did not read my post before posting this (within a minute of my post).
I did. And I found the "bug". Answer below
lexikos wrote: I do not see how your hotkey can trigger the Start menu. Does it happen with this?

Code: Select all

#ü::return
Yes, the menu is also shown.
lexikos wrote: What does KeyHistory show after you press the hotkey?

Code: Select all

#ü::
KeyWait ü
KeyWait LWin
KeyWait RWin
KeyHistory
return

Code: Select all

#ü::
    tmp = %ClipboardAll%
    Send, ^c
    word = %Clipboard%
    Clipboard = %tmp%
    Run, http://dict.leo.org/?search=%word%
    KeyHistory ; <<---
Return
The first one gives:

Code: Select all

VK  SC	Type	Up/Dn	Elapsed	Key		Window
-------------------------------------------------------------------------------------------------------------
01  000	 	d	1.39	LButton        	AutoHotkey.ahk - Notepad
01  000	 	u	0.05	LButton        	
01  000	 	d	0.09	LButton        	
01  000	 	u	0.09	LButton        	
01  000	 	d	0.44	LButton        	
01  000	 	u	0.09	LButton        	
5B  15B	 	d	1.24	LWin           	
5B  15B	 	d	0.25	LWin           	
5B  15B	 	d	0.03	LWin           	
5B  15B	 	d	0.03	LWin           	
5B  15B	 	d	0.03	LWin           	
5B  15B	 	d	0.03	LWin           	
5B  15B	 	d	0.03	LWin           	
5B  15B	 	d	0.03	LWin           	
5B  15B	 	d	0.03	LWin           	
5B  15B	 	d	0.05	LWin           	
5B  15B	 	d	0.03	LWin           	
5B  15B	 	d	0.03	LWin           	
BA  01A	h	d	0.00	ü              	
BA  01A	s	u	0.08	ü              	
5B  15B	 	u	0.36	LWin           	
A2  01D	i	d	0.00	LControl       	
A2  01D	i	u	0.00	LControl       	
A4  038	i	d	0.17	LAlt           	Search
A4  038	i	u	0.00	LAlt           	
A4  038	i	d	0.00	LAlt           	
A4  038	i	u	0.00	LAlt           	
01  000	 	d	2.95	LButton        	
01  000	 	u	0.16	LButton        	C:\USB\Software\Important\AutoHotkey v1.1.27.03 x64\AutoHotkey.ahk - AutoHotkey v1.1.27.03
01  000	 	d	1.17	LButton        	AutoHotkey.ahk - Notepad
01  000	 	u	0.09	LButton        	
01  000	 	d	0.06	LButton        	
01  000	 	u	0.13	LButton        	
5B  15B	 	d	0.53	LWin           	
5B  15B	 	d	0.25	LWin           	
BA  01A	h	d	0.00	ü              	
BA  01A	s	u	0.06	ü              	
5B  15B	 	u	0.17	LWin           	
A2  01D	i	d	0.00	LControl       	
A2  01D	i	u	0.00	LControl  

And the second gives:

Code: Select all

VK  SC	Type	Up/Dn	Elapsed	Key		Window
-------------------------------------------------------------------------------------------------------------
01  000	 	u	0.09	LButton        	
01  000	 	d	1.31	LButton        	C:\USB\Software\Important\AutoHotkey v1.1.27.03 x64\AutoHotkey.ahk - AutoHotkey v1.1.27.03
01  000	 	u	0.06	LButton        	
01  000	 	d	1.45	LButton        	
01  000	 	u	0.05	LButton        	AutoHotkey.ahk - Notepad
01  000	 	d	0.09	LButton        	
01  000	 	u	0.11	LButton        	
5B  15B	 	d	0.61	LWin           	
5B  15B	 	d	0.25	LWin           	
BA  01A	h	d	0.03	ü              	
A2  01D	i	d	0.00	LControl       	
5B  15B	i	u	0.00	LWin           	
43  02E	i	d	0.00	c              	
43  02E	i	u	0.00	c              	
5B  15B	i	d	0.00	LWin           	
A2  01D	i	u	0.00	LControl       	
BA  01A	s	u	0.06	ü              	Search
5B  15B	 	u	0.08	LWin           	
A2  01D	i	d	0.00	LControl       	
A2  01D	i	u	0.00	LControl       	
01  000	 	d	1.88	LButton        	C:\USB\Software\Important\AutoHotkey v1.1.27.03 x64\AutoHotkey.ahk - AutoHotkey v1.1.27.03
01  000	 	u	5.38	LButton        	
01  000	 	d	1.41	LButton        	
01  000	 	u	0.09	LButton        	
01  000	 	d	0.95	LButton        	AutoHotkey.ahk - Notepad
01  000	 	u	0.06	LButton        	
01  000	 	d	0.08	LButton        	
01  000	 	u	0.09	LButton        	
5B  15B	 	d	0.63	LWin           	
5B  15B	 	d	0.25	LWin           	
5B  15B	 	d	0.03	LWin           	
5B  15B	 	d	0.05	LWin           	
BA  01A	h	d	0.00	ü              	
A2  01D	i	d	0.00	LControl       	
5B  15B	i	u	0.00	LWin           	
43  02E	i	d	0.00	c              	
43  02E	i	u	0.00	c              	
5B  15B	i	d	0.00	LWin           	
A2  01D	i	u	0.00	LControl       	
BA  01A	s	u	0.06	ü              	N/A
The real problem was that the admin installed StartIsBack as an alternative start menu. The default look is the same as the normal start menu but can be changed by the users (me).
One setting is to show the real windows start menu when you press CTRL+WIN and this was triggered.
When I set the option to do nothing when CTRL+WIN is pressed, nothing happens.
lexikos
Posts: 9583
Joined: 30 Sep 2013, 04:07
Contact:

Re: Hotkey opens start menu

10 Jan 2018, 05:28

0xDEADC0DE wrote:
lexikos wrote:I'm guessing you did not read my post before posting this (within a minute of my post).
I did.
Really? You must read fast (or hastily).

I had been thinking you clearly did not take my advice about not using ~LWin::, but there's a chance I edited that in after posting (and immediately forgot).
The real problem was that the admin installed StartIsBack as an alternative start menu.
Now it makes sense. Thank you for posting the answer.

Send relies on pressing and releasing the modifiers in a specific order to prevent the Start menu from appearing. Since Send ^c must put the Ctrl key down (because you asked for it) and the Win key up (because you're holding it), it does it in that order.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: No registered users and 318 guests