getting two remapping scripts to work together

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
ylapointe

getting two remapping scripts to work together

21 Sep 2017, 03:25

ok so ive been trying to work this out but i cant seem to wrap my head around how it would work...

i already have one script that modifies the middle mouse button to toggle between two keys each time its pressed.

Code: Select all

count = 1

MButton::
If count = 1
{
    Send a
    Send 1
    count = 2
    Return
}
Else If count = 2
{
    Send a
    Send 2
    count = 1
    Return
}
return
however what im having trouble with is getting this to work in tandem with a script that modifies the shift key.

for example:
- pressing middle mouse = toggles the between two keys each time I press it (as shown above)
- holding shift while pressing and holding middle mouse = hold a key down AND hold left mouse down... do this until I let go of middle mouse.

i would like the script be exclusive with it commands. not sure what the correct term is but i dont want shift+middle mouse to be registered as being pressed while im holding shift+middle mouse... i also dont want the toggle script to activate while im holding the buttons down

any help would be much appreciated

thanks!
User avatar
TheDewd
Posts: 1510
Joined: 19 Dec 2013, 11:16
Location: USA

Re: getting two remapping scripts to work together

27 Sep 2017, 09:30

Does this work?

Code: Select all

#SingleInstance, Force

Toggle := 0

MButton::
    Toggle := !Toggle
    Send, % (Toggle ? "a1" : "a2")
return

Shift & MButton::
    Send, {B Down}{LButton Down}
    KeyWait, MButton ; Wait for release of MButton
    Send, {B Up}{LButton Up}
return

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Chunjee, Giresharu, inseption86, KruschenZ, mikeyww, Swiftly9767 and 289 guests