Need help with a simple simple problem that seems complicated.

Ask gaming related questions (AHK v1.1 and older)
mexican scientist
Posts: 33
Joined: 02 Jul 2020, 21:55

Need help with a simple simple problem that seems complicated.

19 Jan 2023, 23:35

I have a code with hotkey ~m::

Code: Select all

~m::
the code is long and it performs many things. So, when I press the "enter" key and start typing words, like "army" or "Permanent" or any word that contains the letter "m", the code executes. I don't want the hotkey "~m::" to activate when I am typing! How can I fix this?
User avatar
boiler
Posts: 17209
Joined: 21 Dec 2014, 02:44

Re: Need help with a simple simple problem that seems complicated.

20 Jan 2023, 00:51

Why would you use an unmodified m for a hotkey if you don't want it to fire when typing? How do you expect the script to know the difference? That's like saying you want to use LButton as a hotkey, but you don't want it to activate when you click on things. Or that you want asdf to act as the arrow keys when you're typing, but only when you mean them as arrow keys, not as letters.

You can make the hotkey active only when certain windows are active, if that helps. Or you can use another hotkey to toggle when the m hotkey should be active. Or you can just suspend hotkeys from the script's system tray icon.
mexican scientist
Posts: 33
Joined: 02 Jul 2020, 21:55

Re: Need help with a simple simple problem that seems complicated.

20 Jan 2023, 01:56

boiler wrote:
20 Jan 2023, 00:51
Why would you use an unmodified m for a hotkey if you don't want it to fire when typing?
because its for a video game that when you press the "m" key it opens the video game map. I have made the hotkey "~m::" so that when I press "m" it opens the map, it focuses the map, it aligns the map, and many more thing...

So, when I open the chat and I star typing, any word that has the letter "m" will activate the script. One way I thought I could solve this is by using the Hotkey, On or Off, but I don't know how to tackle this problem.
User avatar
boiler
Posts: 17209
Joined: 21 Dec 2014, 02:44

Re: Need help with a simple simple problem that seems complicated.

20 Jan 2023, 04:11

This would allow you to press the F3 key to toggle the hotkeys on and off:

Code: Select all

F3::Suspend

Also moving this thread to “Gaming”.

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: No registered users and 45 guests