Remap command Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
thecodehermit
Posts: 3
Joined: 27 Jun 2022, 14:49

Remap command

Post by thecodehermit » 27 Jun 2022, 14:59

When I hold down CTRL + ALT + Mouse left btn
I want Autohotkey to simulate me holding
SHIFT + Middle mouse button.

And when I release holding the keys the command should also stop.
I am trying to be overly specific since all my attempts have resulted in all sorts of variations of the above, but not in what I want exactly.

Here is my latest attempt:

Code: Select all

^!LButton:: +MButton

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

Re: Remap command

Post by mikeyww » 27 Jun 2022, 15:22

To see what is happening with the keys, examine the :arrow: KeyHistory.

thecodehermit
Posts: 3
Joined: 27 Jun 2022, 14:49

Re: Remap command

Post by thecodehermit » 27 Jun 2022, 16:49

Honestly that console raises more questions than it answers.... I can see all the keys I want are being fired multiple times. I would expect them to be called evenly, but some are called 10 or more times as others just once .... Or maybe I am reading it wrong

I already managed to figure out a similar command. When I press ALT and Mouse 1 Then simulate holding down middle mouse click.
This is the code for it and it works perfectly:

Code: Select all

LAlt & LButton::MButton
return
However if I extend that logic and use

Code: Select all

^!LButton:: +MButton
Then I get completely different results. I just down know what to write since I have no experience with this syntax/logic... And I am reluctant to spend days / weeks learning all that language just for a simple quality of life command...

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

Re: Remap command  Topic is solved

Post by mikeyww » 27 Jun 2022, 18:45

Here is one that you can try.

Code: Select all

^!LButton::
Send {Shift down}{MButton down}
SoundBeep, 1500
KeyWait, LButton
KeyWait, Ctrl
KeyWait, Alt
Send {MButton up}{Shift up}
SoundBeep, 1000
Return

thecodehermit
Posts: 3
Joined: 27 Jun 2022, 14:49

Re: Remap command

Post by thecodehermit » 27 Jun 2022, 19:08

Oh I see, so that is how it was supposed to be done. I was getting close to it, but never could make it work properly.
Thanks allot for the help! I was banging my head at the wall for almost the entire day trying to figure this out :crazy:

I slightly modified your code so it works with combination with my previous function. Here is how it ended up:

Code: Select all

!LButton::MButton
return

^!LButton::
Send {Shift down}{MButton down}

KeyWait, LButton
Send {MButton up}{Shift up}
Return


Post Reply

Return to “Ask for Help (v1)”