Attract-Mode Support Forum

Attract-Mode Support => General => Topic started by: clockman on December 18, 2019, 04:08:03 PM

Title: Joy2Key
Post by: clockman on December 18, 2019, 04:08:03 PM
I'm using only attractmode and mame, daphne, and daphne singe on my cabinet. Is there any way to launch joy2key when i launch daphne then close it when i exit daphne using attractmode?
Title: Re: Joy2Key
Post by: rand0m on December 18, 2019, 07:48:00 PM
I'm using only attractmode and mame, daphne, and daphne singe on my cabinet. Is there any way to launch joy2key when i launch daphne then close it when i exit daphne using attractmode?

I am using AntiMicro, a similar app, for some systems. If you are on Win you can use something like this in emulator.cfg:
Code: [Select]
args                /c cd "D:\Antimicro" & start "" antimicro.exe --hidden --profile "D:\Antimicro\Antimicro Profiles\[name].amgp" & start "" /wait "[romfilename]" & call "D\Antimicro\exit_antimicro.bat"
This will start the app when you start a game and end it when quitting, the exit_antimicro.bat is simply "taskkill /IM /F antimicro.exe" to end the process. Arguments for joy2key will differ.
Title: Re: Joy2Key
Post by: progets on December 19, 2019, 12:22:10 AM
I haven't used joy2key recently but it works well.

Code: [Select]
Usage:
JoyToKey [-r] [profile]
-r
In case JoyToKey program is already running, it'll send a message to the running instance and forces it to refresh the list of joystick devices. This command line argument can be used for creating a shortcut to detect newly connected joysticks.
profile
JoyToKey will be started with the specified profile. In case JoyToKey program is already running, the specified profile name will be sent to the running instance and the active profile will be switched. This command line argument can be used for creating a shortcut for switching the profile.

You can do this many different ways...
1. use the emulators files to modify the command line like rand0m suggests with the command line option mentioned above
2. run a script when launching AM to include joy2key with a default (no setting profile) and then create a profile based on the daphne.exe running with your controls. then use the AM exit option to kill joy2key.
3. create a .bat file to launch your Daphne games to include the command line options mentioned above and use it in you emulator file

The best choice will depend on your needs/preferences and OS (I think you're running Windows).

P.S. I used joy2jey with a differnet FE and I think you might need the registered/paid version to remove the nag screens but I'm not sure.

P.P.S.  I don't run Daphne in my setup but I find many people use keymapper programs when they aren't needed. I also find that people use the "working directory" and "exit hotkey" settings in AM when they aren't needed which can lead to problems. Always configure your working directory, controls and exit option in the emulator when possible (95% of the time). If at all possible, avoid any unnecessary settings and options in the FE.
Title: Re: Joy2Key
Post by: clockman on December 19, 2019, 10:03:35 AM
Thanks to both of you.
Title: Re: Joy2Key
Post by: placebo_yue on January 12, 2020, 07:43:26 PM
It's easier to switch profiles by linking the emulators applications to certain profiles in joy2key itself than writing commands on the frontend. It's so easy i made profiles for every emulator to have the same "exit back to frontend" button on all of the emulators.
It would also work if you ever play the emulators without the frontend, as long as you remember to open joy2key of course, which might be cool.
Title: Re: Joy2Key
Post by: clockman on July 04, 2020, 08:01:49 AM
It's easier to switch profiles by linking the emulators applications to certain profiles in joy2key itself than writing commands on the frontend. It's so easy i made profiles for every emulator to have the same "exit back to frontend" button on all of the emulators.
It would also work if you ever play the emulators without the frontend, as long as you remember to open joy2key of course, which might be cool.
Can you explain how or do a video?
Title: Re: Joy2Key
Post by: hermine.potter on July 04, 2020, 09:12:07 AM
create profiles (https://www.youtube.com/watch?v=-42ZL24jE-E)

commandline parameters to these profiles (https://joytokey.net/en/advanced)
JoyToKey [-r] [profile]
Title: Re: Joy2Key
Post by: placebo_yue on August 12, 2020, 06:37:48 PM
It's easier to switch profiles by linking the emulators applications to certain profiles in joy2key itself than writing commands on the frontend. It's so easy i made profiles for every emulator to have the same "exit back to frontend" button on all of the emulators.
It would also work if you ever play the emulators without the frontend, as long as you remember to open joy2key of course, which might be cool.
Can you explain how or do a video?

Did you manage to get it working? did potter's video do the trick? i can try to help you otherwise. It's pretty easy.

Also, i suggest you all to create a bat file to open joy2key along with the frontend. That way you're sure the mapping will be working whenever you play any emulators. I dunno i found it to be pretty comfortable, when the AM "exit emulator button" fails you, there's always joy2key mapped to ALT+f4 or whatever that emulator needs to be closed
Title: Re: Joy2Key
Post by: hermine.potter on August 14, 2020, 02:59:15 AM
I integrated JoyToKey to AM via plugin (see enclosed files)
(based on ResFix.nut Plugin. Windows systems only. I believe JoyToKey doesn't exist on Linux)

Create Profiles in JoyToKey and name the JoyToKey-Files like your Display-Names in AM.
My Displaynames in AM : ZSNES, MegaDrive
My JoyToKey-Files : ZSNES.cfg, MegaDrive.cfg
(https://s12.directupload.net/images/200814/ymafcfai.gif)

>JoyToKey_ENABLE.nut
starts JoyToKey.exe with your Display-Name. It's starts dynamic the same named JoyToKey-Configuration
you need to escape the path to JoyToKey.exe
"C:\attract\JoyToKey\JoyToKey.exe"        =>        \"C:\\attract\\JoyToKey\\JoyToKey.exe\"

>JoyToKey_DISABLE.nut
uses Taskkill to close JoyToKey.exe process.
Title: Re: Joy2Key
Post by: placebo_yue on August 14, 2020, 01:08:07 PM
It's cool to have a plugin, but it's not necessary, since joy2key is super versatile and you can set up everything from the software itself. Not trying to shit on your work hermione, maybe someone likes that better than what i'll suggest next, but in case someone has trouble with your thing, the default way to configure stuff to do this would be:

That's it! now joy2key should only work as intended while using the desired app, and do nothing when you're using any others.
You can set up as many profile-app links as you want, as long as you keep "empty" as default you shouldn't have problems with the mappings.

And to make sure joy2key is always running during your gameplay, create a bat file that launches both joy2key and attract-mode, and start the frontend using that.

Title: Re: Joy2Key
Post by: hermine.potter on August 15, 2020, 04:25:56 PM
@ placebo_yue
batch is my world too and one of my favorites ^-^
I am using further : f2ko bat to exe converter (https://www.majorgeeks.com/files/details/bat_to_exe_converter.html)
This tool creates invisible .exe (based on batch scripts). So you can suppress any commandline messages.
Maybe it's interesting for you.

At the moment I try myself in programming with Squirrel language.
Was interested in whether parameters can be passed from AM to external programs.
This is how this quick-and-dirty-ten-minutes-programmed plugin came about ^-^