Jump to content
LaunchBox Community Forums

How to automatically start a game with JoyToKey support in LB


Recommended Posts

Hi,

I have a little problem with Contra Evolution: this game can be played with joypad only if I use JoyToKey application. 

So I have configured JoytoKey and now if I want to play this game, I have to start JoyToKey and then double click on the .exe file of the game and so it immediately detect the joypad. 

So, I added the game to LB, in my WIndows platform section:  but even if i start JoyToKey, when i launch the game with LB, the joypad isn't detected...I don't know why... 

1) is it possible to use games with JoytoKey from LB?

2) Is it also possible to automatically start JoyToKey when I launch this game from LB?

Thank you very much!

Link to post
Share on other sites
  • Replies 41
  • Created
  • Last Reply

Top Posters In This Topic

Edit the following script with your own paths and names:

Here\your\path\to\JoyToKey.exe = the location of  JoyToKey.exe

JoyToKeyGameConfig.cfg = the name of the JoyToKey config file you made for your game. (JoyToKey config files are located in the Documents folder > JoyToKey.)

Game.exe = the name of the executable of your game.

 

Add this script as an Additional App to your game and tick: "Automatically Run Before Main Application". If you don't know how to do that, let me know.

To close JoyToKey correctly after the game is closed, in the JoyToKey Settings > Preferences > Minimize section, make sure that only "Start JoyToKey in a minimized mode" is checked. (The other 2 options must be unchecked.)

#NoEnv
#SingleInstance
Run, "Here\your\path\to\JoyToKey.exe" JoyToKeyGameConfig.cfg
Process, Wait, Game.exe
Process, WaitClose, Game.exe
WinClose, ahk_exe JoyToKey.exe
ExitApp

 

Link to post
Share on other sites

thanks. So, the script should be:

#NoEnv
#SingleInstance
Run, "D:\EMULATORI\GIOCHI per PC\Contra Evolution HD\Contra Evolution\JoyToKey_en\JoyToKey.exe" Contra HD.cfg
Process, Wait, AMContra.exe
Process, WaitClose, AMContra.exe
WinClose, ahk_exe JoyToKey.exe
ExitApp

and I configured in this way: I added an Application Name, then I entered the path of the JoyToKey.exe file and at the end I copied all the script in the "application COmmand-Line Parameter":

joy1.png

is that correct?

And here my JoytoKey configuration:

joy2.png

joy3.png

Is everything correct?

 

many thanks!

Link to post
Share on other sites

First, in JoyToKey you don't have to autorun a profile with an associated application. Ofcourse you could, but for just one game it is not necessary. In the script the line:

Run, "D:\EMULATORI\GIOCHI per PC\Contra Evolution HD\Contra Evolution\JoyToKey_en\JoyToKey.exe" Contra HD.cfg

already starts JoyToKey and loads the profile you made for your game.  If you just add JoyToKey directly as an Additional App, then JoyToKey won't close after you close your game and keeps running. With a script you can automatically close JoyToKey when you close your game.

To add a script as an additional to your game, first create a new text file on a location you desire. For example in your JoyToKey folder. Copy and paste the script to your text file and save it. Give it a name. In my case: JoyToKey_Cyberia_II.ahk but make sure you save the text file with an .ahk extension.

Then add the .ahk script as an additional app:

 

1526101709_Schermopname(69).thumb.jpg.ccc21c5a40972f56ec4dab77279f29a9.jpg

1) Give your additional app a name.

2) In the Application Path field select the AutoHotKey.exe in your \LaunchBox\ThirdParty\AutoHotkey folder.

3) In the Application Command-Line Parameters field enter the path and the name of the .ahk file you just created and use quotes (") at the beginning and end.

4) Check the box with "Automatically Run Before Main Application".

Link to post
Share on other sites

thanks!  Well, I have a problem: it seems that JoytoKey doesn't start correctly now...if I double click on the .exe file, the application is minimized but I'm not able to open it in order to change its configuration...if I click on the icon, it doesn't happen anything... I tried to launch the game (double click on the .exe file but the joypad isn't detected even if JoytoKey is opened...

In the meanwhile I follwed your guide:

joy1.png

and 

joy2.png

Is that correct?

But I can't try if it works because now I have another problem: my joypad isn't detected anymore by LB!!!!! I don't know why!  The mapping is still present:

joypad.png

joypad2.png

but LB doesn't detect any command, in any game and any console...!!!! :(  And it isn't detected anymore to any emulator even if i don't use LB!!!! But is seems that it works perfectly, the input command are detected (I have a Logitech Rumblepad 2), i don't know what is happened!

thanks!

Edited by legolas119
Link to post
Share on other sites
6 minutes ago, legolas119 said:

it seems that JoytoKey doesn't start correctly now...if I double click on the .exe file, the application is minimized but I'm not able to open it in order to change its configuration...if I click on the icon, it doesn't happen anything.

When JoyToKey is running, you can open it by right clicking on the tray icon > Open main window.

Link to post
Share on other sites
10 minutes ago, legolas119 said:

but LB doesn't detect any command, in any game and any console...!!!! :(  And it isn't detected anymore to any emulator even if i don't use LB!!!! But is seems that it works perfectly, the input command are detected (I have a Logitech Rumblepad 2), i don't know what is happened!

It sounds stupid, but sometimes a reboot of your pc does wonders. There is no reason your controller shouln't work with LaunchBox and JoyToKey.

Link to post
Share on other sites

unfortunately i don't have that option...

joypad.png

I also tried to uninstall and install the driver of my joypad, but it isn't detected anymore...during the installation of the driver, it is necessary to test the button, and any button isn't detected...:( I don't know if my configuration of JoytoKey has an impact on that...until yesteday it worked perfectly...

Link to post
Share on other sites

Also, if you want to start JoyToKey in a window, then in the JoyToKey Settings > Preferences > Minimize section, untick "Start JoyToKey in a minimized mode". I myself have additional apps start in a minimized mode as much as possible so they don't interfere with startup screens.

 

 

joy2.png

Edited by Koroth
Link to post
Share on other sites

ah ok thanks! sorry

well I have configured in LB as I said above. And joyto key in this way:

joypad3.png

joypad4.png

but i still have the issue with my joypad...i isn't detected anymore in any emulator, not only in LB. In Steam too...nothing, it isn't detected by any application :( :(   I tried to reinstall the driver and in the button configuration test, at the end of the installation, any button isn't detected. I also tried to reboot the pc, but i still have the issue :(

Link to post
Share on other sites
3 minutes ago, legolas119 said:

but i still have the issue with my joypad...i isn't detected anymore in any emulator, not only in LB. In Steam too...nothing, it isn't detected by any application

 I think that is more a controller / USB / Windows issue than having anything to do with JoyToKey or LaunchBox. Do you have another controller to test with?  I don't have a Logitech Rumblepad 2 so it is a bit difficult for me to help you with that, but I saw it was wireless. Maybe you can connect it with a cable?

Link to post
Share on other sites
23 minutes ago, legolas119 said:

i could use xbox one X controller? I don't have the specific wireless dongle to connect the xbox joypad to the pc, i have to buy one..  Do you use the xbox one controller?

Yes, I have a Xbox One controller with the official wireless dongle. But out of the box the Xbox One controller comes with a separate USB cable. You can buy third party dongles but I don't have experience with those.  

Link to post
Share on other sites
Just now, Koroth said:

Yes, I have a Xbox One controller with the official wireless dongle. But out of the box the Xbox One controller comes with a separate USB cable. You can buy third party dongles but I don't have experience with those.  

Also, all but the very earliest models have bluetooth as well, so depending on when yours was bought it may have that, mine is the OG so needs a dongle, but any bought in the last five or six years should have bluetooth also.

Link to post
Share on other sites
5 minutes ago, neil9000 said:

Also, all but the very earliest models have bluetooth as well, so depending on when yours was bought it may have that, mine is the OG so needs a dongle, but any bought in the last five or six years should have bluetooth also.

You are right. More information here: https://bigtechquestion.com/2020/04/24/gaming/consoles/which-xbox-one-controller-is-bluetooth/

Link to post
Share on other sites

yes i have it, and it works! :)  Later I will buy this https://www.amazon.it/MICROSOFT-XONE-Wrlss-Ctrl-Adapter/dp/B074QMN4YW/ref=sr_1_14?__mk_it_IT=ÅMÅŽÕÑ&dchild=1&keywords=Xbox+One+X%3A+Adattatore+Wireless+Xbox&qid=1613828091&s=videogames&sr=1-14

even if I still have a bluetooth usb dongle (TP-Link), I will try it.


Well, now first of all I have to correctly map this new controller with JoyToKey: I'm trying with the existing congiuration but it has some issues, for example even if i don't push the right button, the characters continue to run...

I don't know why but there is Joystick 1 and Stick1 in yellow...

esempio.png

the joypad is correctly detected so probably I have to correctly enter the mapping...?  As soon as the mapping will be OK, i will try to launch it with LB. DO you know if there is any issue in my mapping?

 

Link to post
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
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...