Using AutoHotkey to change only a part of the shortcut

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
JanP
Posts: 3
Joined: 13 Jun 2021, 10:21

Using AutoHotkey to change only a part of the shortcut

Post by JanP » 13 Jun 2021, 14:18

Hello!

I have noticed that I cannot hotkey one key combination to another if they share some of the same keys.

Two use cases:
1) I have logitech mx master 2 mouse. It's fifth button fires as ^!Tab and I can attribute any function I will to it just not the one I need.
The goal is to hotkey Win 10 Task View (Win+Tab) to this mouse button.

Code: Select all

^!Tab::#Tab
does not work.

My hunch is that this might be because these two share the Tab key.

2) I am often shifting between windows and Mac machines. I would like to hotkey
Ctrl+c to Alt+c and
Ctrl+v to Alt+v
which corresponds to my mac keyboard. However, I am experiencing the same issue as with the mouse.

Is there any workaround?

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

Re: Using AutoHotkey to change only a part of the shortcut

Post by gregster » 13 Jun 2021, 14:41

I would try

Code: Select all

^!Tab::Send #{Tab}
A remapping like you had before wouldn't release the Ctrl and Alt key, so you would send ^!#{Tab} instead of just #{Tab}.
Last edited by gregster on 26 Jun 2021, 11:17, edited 1 time in total.
Reason: added missing braces

JanP
Posts: 3
Joined: 13 Jun 2021, 10:21

Re: Using AutoHotkey to change only a part of the shortcut

Post by JanP » 26 Jun 2021, 05:07

Thank you for your suggestion!

It makes a lot of sense! Unfortunately, that did not do it.

User avatar
mikeyww
Posts: 26600
Joined: 09 Sep 2014, 18:38

Re: Using AutoHotkey to change only a part of the shortcut

Post by mikeyww » 26 Jun 2021, 09:02

Could try:

Code: Select all

^!Tab::Send #{Tab}

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

Re: Using AutoHotkey to change only a part of the shortcut

Post by gregster » 26 Jun 2021, 11:15

JanP wrote:
26 Jun 2021, 05:07
Thank you for your suggestion!

It makes a lot of sense! Unfortunately, that did not do it.
Yes, sorry, my bad, there were braces missing! :facepalm:
See mikeyww's post above for the correct code.

Post Reply

Return to “Ask for Help (v1)”