Page 1 of 1

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

Posted: 23 Mar 2020, 07:28
by Sashkon

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/

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

Posted: 23 Mar 2020, 07:56
by gregster
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::
; [...]

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

Posted: 23 Mar 2020, 08:36
by Sashkon
Also about my code If I drag icon on desktop it will create new shortcut for icon...
#MenuMaskKey vk99 doesn't help

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

Posted: 23 Mar 2020, 08:45
by gregster
vk99 - what is this? Is it really unassigned?
I would try vk07.

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

Posted: 23 Mar 2020, 08:46
by Sashkon
For me vk07 opens xbox game bar. vk99 is unassigned and does nothing

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

Posted: 02 Aug 2020, 12:01
by vikixd
Be that as it may, I don't comprehend why Ctrl is being squeezed. Is there simplier way?

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

Posted: 02 Aug 2020, 13:31
by gregster
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