Jump to content
LaunchBox Community Forums

Autohotkey per Windows game?


desumoyo

Recommended Posts

I think he means the built in autohotkey that is available in Launchbox. It is available in emulator setup but not on a per game setup. The emulator setup has a tab where you can directly enter an autohotkey script. Per game setup doesn't have this tab but it would be extremely helpful. I opened a ticket for this a while back.

As you explained, you can create an autohotkey file and compile it as an exe and run that as an additional app to run before or after launching the game. It works, but its not as straightforward as editing an autohotkey script right in the game setup screen could be.

If you think this should get some attention, vote on the ticket below.

https://bitbucket.org/jasondavidcarr/launchbox/issues/1446/autohotkey-on-a-per-game-basis 

 

  • Like 3
Link to comment
Share on other sites

  • 2 years later...

Hi guys,

I've spent like half a day on this so wanted to share my learns for how to do individual scripts. link here: https://www.autohotkey.com/boards/viewtopic.php?f=18&t=63827&p=273602#p273602

 

method one

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.


Run, openliero.exe

#IfWinActive AHK_exe openliero.exe ;
 ; Player1
;KeyPressed::KeyItThinksIPressed
w::Up ;when pressing the W key, the game registers that up was hit instead
a::Left
s::Down
d::Right
LControl::Enter ;shoot

 ;Escape key
5::Escape
6::Esc

 ; Player2


#IfWinNotExist ahk_exe E:\Windows\Liero 1.36\openliero.exe ;	
w::
	send w
	Exitapp
return
s::
	send s
	exitapp
return
a::
	send a
	exitapp
return
d::
	send d
	exitapp
return
LControl::
	send ^
	exitapp
return
5::
	send 5
	exitapp
return
6::
	send 6
	exitapp
return

method two

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.


Run, openliero.exe

#Persistent ;only exits on an exitapp command
WinWait, ahk_exe openliero.exe, , 5
SetTimer, CheckForWindow, 5000 ; check every 5 seconds


#IfWinActive AHK_exe openliero.exe ;
 ; Player1
;KeyPressed::KeyItThinksIPressed
w::Up ;when pressing the W key, the game registers that up was hit instead
a::Left
s::Down
d::Right
LControl::Enter ;shoot

 ;Escape key
5::Escape
6::Esc

 ; Player2


CheckForWindow:
IfWinNotExist, ahk_exe openliero.exe
{
ExitApp
Return
}

Still trying to figure out the best method, but hoping this helps others that find this thread. both confirmed working.

Link to comment
Share on other sites

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...