Jump to content
LaunchBox Community Forums

Recommended Posts

Posted
33 minutes ago, JoeViking245 said:

Try LCtrl instead of LControl

Thanks for the idea. Unfortunately, the same "invalid hotkey" error remains.

I tried testing a bit further, abandoning the %FireKey% variable altogether and just hard-coding {LCtrl} in the appropriate places. The good news is that when I run the script with a keylogger/checker, it acts as intended: F1 turns on the script with tooltip confirmation, pressing left control begins an auto press of left control every 50ms or so, with the ability to press left control during the sequence without interrupting it, and pressing F1 again turns it off (with tooltip confirmation).

The bad news is that trying this with an actual game (Forgotten Worlds) does *not* work. I can see the tooltip when I press F1, but pressing left control doesn't seem to start the firing sequence. I've heard-tell of AHK and MAME not playing well together; maybe this is one of those instances?

Posted
15 minutes ago, stonev said:

I've heard-tell of AHK and MAME not playing well together; maybe this is one of those instances?

Some emulators need a more "literal" or "defined" key press.  Can try adding to the top if the script SetKeyDelay, 0, 50

  • Thanks 1
Posted
7 minutes ago, JoeViking245 said:

Some emulators need a more "literal" or "defined" key press.  Can try adding to the top if the script SetKeyDelay, 0, 50

Progress! So adding that line made it work in Mame!!!

Just to clean up the script a little... I still can't seem to use the %FireKey% variable on the first line of the Autofire loop. So to snip out part of my code:

<FireKey := "{LCtrl}"> and <Send %FireKey%> work in tandem. However, if I use <~%FireKey%::>, I get the "invalid hotkey" error on that line. The only way to fix this is to change that line to <~LCtrl::>, that is, hard-code the key instead of using the variable. Not a deal-breaker by any means, but still a little strange.

Posted

Additionally, I've added the following to the bottom of the script:

Esc::ExitApp

Unfortunately, this kills the script with the first Esc and kills the game (as usual) with the second. Is there a way to kill the script and the game with a single press? Or better yet, kill the AHK script as a result of Mame exiting?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...