Page 1 of 1

Need help with a simple simple problem that seems complicated.

Posted: 19 Jan 2023, 23:35
by mexican scientist
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?

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

Posted: 20 Jan 2023, 00:51
by boiler
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.

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

Posted: 20 Jan 2023, 01:56
by mexican scientist
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.

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

Posted: 20 Jan 2023, 04:11
by boiler
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”.