Alt & b use as mouse click? Dragging doesn't work

Get help with using AutoHotkey and its commands and hotkeys
Sashkon
Posts: 35
Joined: 23 Dec 2017, 05:13
Facebook: Alexander Murvajev
Google: Alexander Murvajev
GitHub: Alexander

Alt & b use as mouse click? Dragging doesn't work

Post by Sashkon » 23 Mar 2020, 07:28

Code: Select all

!b::Click
I want to use alt & b as quiet mouse click, because mouse is loud.
But dragging doesn't work. Any help?


I tried this code

Code: Select all

!b::
	SendInput, {Click down}
	SendInput, {Alt up}
	KeyWait, b
return

!b up::
	SendInput, {Click up}
return
But I don't understand why Ctrl is being pressed. Is there simplier way?
I check it here http://en.key-test.ru/

gregster
Posts: 5120
Joined: 30 Sep 2013, 06:48

Re: Alt & b use as mouse click? Dragging doesn't work

Post by gregster » 23 Mar 2020, 07:56

Sashkon wrote:
23 Mar 2020, 07:28
But I don't understand why Ctrl is being pressed.
Ctrl gets sent because it is the default #MenuMaskKey, used in AHK to prevent Alt from activating the active window's menu bar at unexpected times.

If it causes problems, you can the change the #MenuMaskKey to something else, for example:

Code: Select all

#MenuMaskKey vk07  ; vk07 is unassigned.

!b::
; [...]

Sashkon
Posts: 35
Joined: 23 Dec 2017, 05:13
Facebook: Alexander Murvajev
Google: Alexander Murvajev
GitHub: Alexander

Re: Alt & b use as mouse click? Dragging doesn't work

Post by Sashkon » 23 Mar 2020, 08:36

Also about my code If I drag icon on desktop it will create new shortcut for icon...
#MenuMaskKey vk99 doesn't help

gregster
Posts: 5120
Joined: 30 Sep 2013, 06:48

Re: Alt & b use as mouse click? Dragging doesn't work

Post by gregster » 23 Mar 2020, 08:45

vk99 - what is this? Is it really unassigned?
I would try vk07.

Sashkon
Posts: 35
Joined: 23 Dec 2017, 05:13
Facebook: Alexander Murvajev
Google: Alexander Murvajev
GitHub: Alexander

Re: Alt & b use as mouse click? Dragging doesn't work

Post by Sashkon » 23 Mar 2020, 08:46

For me vk07 opens xbox game bar. vk99 is unassigned and does nothing

vikixd
Posts: 1
Joined: 02 Aug 2020, 11:55

Re: Alt & b use as mouse click? Dragging doesn't work

Post by vikixd » 02 Aug 2020, 12:01

Be that as it may, I don't comprehend why Ctrl is being squeezed. Is there simplier way?

gregster
Posts: 5120
Joined: 30 Sep 2013, 06:48

Re: Alt & b use as mouse click? Dragging doesn't work

Post by gregster » 02 Aug 2020, 13:31

vikixd wrote:
02 Aug 2020, 12:01
Be that as it may, I don't comprehend why Ctrl is being squeezed. Is there simplier way?
https://www.autohotkey.com/docs/commands/_MenuMaskKey.htm#Remarks wrote:The mask key is sent automatically to prevent the Start menu or the active window's menu bar from activating at unexpected times.
Ctrl is used historically in AHK as the menumaskkey for Alt and Win keys - that's a fact. But it can have side-effects.

If this causes problems for you, you can change it from Ctrl to some other (ideally unused) key code, by using the #MenuMaskKey directive. It doesn't get much simpler than that, for example: #MenuMaskKey vkE8

Post Reply

Return to “Ask For Help”