Simple Key Toggle (diablo 2) Topic is solved

Ask gaming related questions
bigmike99
Posts: 3
Joined: 04 Mar 2023, 19:00

Simple Key Toggle (diablo 2)

Post by bigmike99 » 04 Mar 2023, 19:08

Hey I play diablo and am brand new to autohockey. I'm trying to bind my F1, F2, F3, F4 etc. keys to shiftmod 1, shiftmod 2, shiftmod 3, etc. (because the game doesnt support mod keys i guess)

So basically I'd hold shift + the key to activate the corresponding Fkey.

I tried something myself but it didn't work!

Code: Select all

#IfWinActive
+1::F1
+2::F2

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

Re: Simple Key Toggle (diablo 2)

Post by gregster » 04 Mar 2023, 19:16

I moved your topic to the v1 help subforum, since the use of #IfWinActive indicates that you are not using AHK v2, the current main release.

With v1, I would try

Code: Select all

+1::send {F1}
+2::send {F2}
because remappings in AHK v1 won't release modifiers, and +1::F1 would result in a shifted F1. Send, on the other hand, releases modifiers.

If you are actually using AHK v2, we could move your topic back. But then you would need to use the updated v2 syntax instead.

bigmike99
Posts: 3
Joined: 04 Mar 2023, 19:00

Re: Simple Key Toggle (diablo 2)

Post by bigmike99 » 04 Mar 2023, 20:51

Thanks! I've updated my Autohotkey to V2.

I just realized after doing some tests that autohotkey doesn't work while im in the game. I tried a simple code and it works outside perfectly fine but nothing happens when im tabbed in game.

Here's what I tried.

Code: Select all

Numpad1::MsgBox "Test Message"

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

Re: Simple Key Toggle (diablo 2)  Topic is solved

Post by gregster » 04 Mar 2023, 21:15

Try to run the script as admin.

Generally, sending keys to games can be tricky and often involves trial-and-error. Some other things to try, if the above doesn't work:
Why do Hotstrings, Send, and Click have no effect in certain games? (v2 FAQ)
How to Make AHK Work in Most Games - The Basics (v1 -> change syntax for v2; has some advice for Diablo 3)

But there are no guarantees that a specific game will cooperate.

PS: Topic moved back to v2.

Post Reply

Return to “Gaming”