Shift key modifier got me, i cant use a simple macro Topic is solved

Ask gaming related questions (AHK v1.1 and older)
dictator4
Posts: 4
Joined: 13 Mar 2017, 05:05

Shift key modifier got me, i cant use a simple macro

13 Mar 2017, 05:15

Hey.

Trying to use this macro, which works, but when I'm holding shift it stops working.
Tried to remap the "q" to "Q" with no success.
q::
send 3
sleep 40
send 3
sleep 40
send 3
sleep 40
send 3
sleep 40
send 1
return

Also is it possible, to use this macro on button "3"?
User avatar
Nextron
Posts: 1391
Joined: 01 Oct 2013, 08:23
Location: Netherlands OS: Win10 AHK: Unicode x32

Re: Shift key modifier got me, i cant use a simple macro

13 Mar 2017, 07:22

Modifier states must match those in the hotkey definition. If you want the hotkey to trigger when shift is held, you must create an additional hotkey (with a + prepended) that can have the same target as your existing hotkey. Same for the 3:

Code: Select all

$3::
+q::
q::
  send 3
  sleep 40
  send 3
  sleep 40
  send 3
  sleep 40
  send 3
  sleep 40
  send 1
return
However, since you're also sending the 3, normally the hotkey would trigger itself into a loop. So you need to prepend the hotkey with a $ so the hotkey is set up in a different way (hook instead of registered) which won't trigger itself.
dictator4
Posts: 4
Joined: 13 Mar 2017, 05:05

Re: Shift key modifier got me, i cant use a simple macro

13 Mar 2017, 12:08

Nextron wrote:Modifier states must match those in the hotkey definition. If you want the hotkey to trigger when shift is held, you must create an additional hotkey (with a + prepended) that can have the same target as your existing hotkey. Same for the 3:

Code: Select all

$3::
+q::
q::
  send 3
  sleep 40
  send 3
  sleep 40
  send 3
  sleep 40
  send 3
  sleep 40
  send 1
return
However, since you're also sending the 3, normally the hotkey would trigger itself into a loop. So you need to prepend the hotkey with a $ so the hotkey is set up in a different way (hook instead of registered) which won't trigger itself.
Well thanks, but the macro itself works when i press "3" , but it doesn't work, when I holding the shift key. I want it to make it work, while im holding the shift key.
User avatar
Nextron
Posts: 1391
Joined: 01 Oct 2013, 08:23
Location: Netherlands OS: Win10 AHK: Unicode x32

Re: Shift key modifier got me, i cant use a simple macro

13 Mar 2017, 12:28

Add the following like to the top: $+3::
Guest

Re: Shift key modifier got me, i cant use a simple macro  Topic is solved

13 Mar 2017, 16:58

Nextron wrote:Add the following like to the top: $+3::
Thanks it works, however my character stops for a sec when i'm using in with a shift macro. (Default run button is shift in the game)
User avatar
Nextron
Posts: 1391
Joined: 01 Oct 2013, 08:23
Location: Netherlands OS: Win10 AHK: Unicode x32

Re: Shift key modifier got me, i cant use a simple macro

13 Mar 2017, 17:07

Send releases any modifers and represses them after. To avoid that, replace all Send 3 with Send {Blind}3 (same with 1).
dictator4
Posts: 4
Joined: 13 Mar 2017, 05:05

Re: Shift key modifier got me, i cant use a simple macro

14 Mar 2017, 19:24

Nextron wrote:Send releases any modifers and represses them after. To avoid that, replace all Send 3 with Send {Blind}3 (same with 1).
Thank you, you are awesome. It works.

Also is it possible to make this macro work when im holding left ctrl button?
User avatar
Nextron
Posts: 1391
Joined: 01 Oct 2013, 08:23
Location: Netherlands OS: Win10 AHK: Unicode x32

Re: Shift key modifier got me, i cant use a simple macro

15 Mar 2017, 04:36

If you replace the + with a * it'll work with any combination of modifier. Otherwise you'd have to create hotkeys for every kind of combination.
dictator4
Posts: 4
Joined: 13 Mar 2017, 05:05

Re: Shift key modifier got me, i cant use a simple macro

15 Mar 2017, 19:03

Nextron wrote:If you replace the + with a * it'll work with any combination of modifier. Otherwise you'd have to create hotkeys for every kind of combination.
Thank you, it works almost perfectly now. :)

It makes my character stop for a sec, but i guess it's happens because im also running with the shift key. Only way to avoid if i rebind the shift key in game.

Overall thank you for your help Nextron!

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: No registered users and 101 guests