Autohotkey on a per game basis

Issue #1446 new
Jay Thompson created an issue

Jason, can you add autohotkey on a per game basis. I believe right now it only works on a per emulator basis. Please delete or cancel this ticket if one already exists.

Thanks, Jay Thompson

Comments (14)

  1. Free SoftwareServers

    My Premium License has expired, looking forward to some issues being resolved and re-purchasing license. (This Issue and integrating Select Random Game in BoxBox and/or at least making more hotkey's available to the Dev).

  2. Jordi Bosch Creus

    Hi, this was aked 4 years ago and no support yet, are there any real plans to integrate it? Seems like an easy to add feature. I’ve just bought BigBox to move from HyperSpin and, frankly, I did not expect thats this software would not have support for pergame autohotkey scripts. I have hundreds of per game overrides on my HyperSpin’s scripts, specially for PC Games. I would like to know if this is going to be added, because if it’s not going to happen, I will have to redo all of my scripts into something BigBox is able to handle, which will require hundre4ds of hours. But depending on the ETA for this, I could wait.

    Greetings.

  3. Jonathan

    If you install autohotkey, you could create your script, compile it to an exe and launch it as an additional app.

    That gives you the ability to run a specific script per game. It's what I've done on some of mine.

  4. Jonathan

    Thought I’d elaborate on my previous comment slightly as I’ve been updating some of my scripts…

    I think you need to install autohotkey to do this, just download the official version from their website and install it.

    Installing autohotkey should also add the ‘AutoHotkey Script’ to your right click, new menu in Windows explorer.

    You then create a new script and add your key mapping etc… Here is one that I use

    Sleep 5000
    
    #If WinActive("ahk_exe SF30thAnniversaryCollection.exe")
    
        Ctrl::Numpad8
        Alt::Numpad7
        Shift::Numpad9
        5::Backspace
        1::Enter
    
    ~Esc::
    if WinExist("ahk_exe SF30thAnniversaryCollection.exe")
    WinKill ; use the window found above
    ExitApp
    
    #If
    

    Once created and saved as a .ahk file, you right click it and there should be an option for ‘compile script’. This will create a .exe file of your script.

    On the game edit screen in LB, you go to additional apps and add the exe as an app to the game. Put a tick in the ‘run before main application’ box.

    When you load the game the script will run before it and activate your key bindings. The above script also makes Escape close the game and script file.

    And there you have it, autohotkey on a per game basis…

    Some Things to Note:

    If the game runs with administrator privileges, the exe you create will need to have admin privileges as well. If it doesn’t it won’t override the key bindings.

    You won’t always want Esc to close the game (if it’s needed for something else). You also don’t want the script to continue running once you’ve exited the game. The solution I use for that is to create 2 scripts

    Script 1 - set up as above to run before the main application

    Sleep 5000
    
    #If WinActive("ahk_exe FIGHT_N_RAGE.exe")
    
        Shift::v
    
    #If
    

    Script 2

    Sleep 2000
    Process, Close, FightN.exe ;exe is the name of your compiled script
    ExitApp
    

    You compile script 2 as an exe as well. Add it as a second additional app but tick the box for ‘After the main application’

    The first script will load before the game to activate your key bindings. The second script will close your key binding exe when the game closes.

    Once you get the hang of it, this way of doing things can be really useful. For example, Another World requires a mouse click to start the game. I am running it in an arcade cabinet without a mouse. Using scripts like this I can simulate the mouse click automatically and get to the actual game without needing a mouse.

    Anyway, hope it helps someone…

  5. Log in to comment