Cannot recognize starting key for script

Ask gaming related questions (AHK v1.1 and older)
Syrup
Posts: 27
Joined: 22 Aug 2018, 08:38

Cannot recognize starting key for script

22 Sep 2021, 04:56

Hello.

With a certain game I'm playing, certain keys seem to never activate the script. The script itself works; I know this because other keys will in fact trigger the script properly. So, example:

XButton1::

{

Send, W

}

Return

Esc::ExitApp



1::

{

Send, W

}

Return

Esc::ExitApp


The first script works without problems when I press XButton1; the second script never works when I press 1. I've tried using keys that are key-binded in the game, and keys that aren't key-binded, as well as keys that cannot even be key-binded in the game. There doesn't seem to be some sort of rule.

Also, it's not just mouse keys that can work; I tried with LControl and it would work just fine. Most keys, however, do not seem to activate the script. It's as if the game sees the keys being pressed, but ahk doesn't. I say this because there is a feature in the game where you can see which keys are being pressed, and when I try pressing "1" to activate the second script, the "1" key in the game's virtual keyboard lights up (because I pressed it), even though the script doesn't activate. With the keys that DO work, however, the key doesn't seem to be seen by the game (so, for example, LControl doesn't light-up in the game's virtual keyboard), which is (I assume) because ahk "eats" that input before it can reach the game, which is the desired (and usual, in my other experience with ahk and games) outcome.
User avatar
mikeyww
Posts: 26891
Joined: 09 Sep 2014, 18:38

Re: Cannot recognize starting key for script

22 Sep 2021, 05:54

Easy test: try your script in Notepad. If it works there, then the problem is likely to be how your game is responding to the particular keys-- a game problem, not an AHK problem. KeyHistory will also show you what is happening with the keys. If you also have other keyboard managers or hooks running, or software that uses the same hotkey, then that might create a software conflict. Some games also block "cheaters" (activity that looks like a workaround of some kind)!
Syrup
Posts: 27
Joined: 22 Aug 2018, 08:38

Re: Cannot recognize starting key for script

23 Sep 2021, 10:41

I know it's a "game problem", not an "ahk problem"...
The question is, is there a way to bypass this? A different way of coding, of activating the script, or anything of the sort?
User avatar
mikeyww
Posts: 26891
Joined: 09 Sep 2014, 18:38

Re: Cannot recognize starting key for script

23 Sep 2021, 11:21

You could look at tips for games, in case some of those approaches work.

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: No registered users and 31 guests