Author Topic: Joy2Key  (Read 7147 times)

clockman

  • Sr. Member
  • ****
  • Posts: 109
    • View Profile
Joy2Key
« 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?

rand0m

  • Sr. Member
  • ****
  • Posts: 343
    • View Profile
Re: Joy2Key
« Reply #1 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.

progets

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1274
    • View Profile
Re: Joy2Key
« Reply #2 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.
« Last Edit: December 19, 2019, 12:51:08 AM by progets »

clockman

  • Sr. Member
  • ****
  • Posts: 109
    • View Profile
Re: Joy2Key
« Reply #3 on: December 19, 2019, 10:03:35 AM »
Thanks to both of you.

placebo_yue

  • Full Member
  • ***
  • Posts: 57
  • sup
    • View Profile
    • Instagram
Re: Joy2Key
« Reply #4 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.

clockman

  • Sr. Member
  • ****
  • Posts: 109
    • View Profile
Re: Joy2Key
« Reply #5 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?

hermine.potter

  • Hero Member
  • *****
  • Posts: 767
    • View Profile
Re: Joy2Key
« Reply #6 on: July 04, 2020, 09:12:07 AM »
AM Version : 2.6.1
Input : Mad Catz Brawlstick; Mouse; Keyboard; Xbox360 Wireless
Cabinet : Yes
OS : Windows10 Pro
System : Dell Precision T3500 ; Intel X5650 ; 12GB RAM

placebo_yue

  • Full Member
  • ***
  • Posts: 57
  • sup
    • View Profile
    • Instagram
Re: Joy2Key
« Reply #7 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

hermine.potter

  • Hero Member
  • *****
  • Posts: 767
    • View Profile
Re: Joy2Key
« Reply #8 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


>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.
« Last Edit: August 14, 2020, 03:07:11 AM by hermine.potter »
AM Version : 2.6.1
Input : Mad Catz Brawlstick; Mouse; Keyboard; Xbox360 Wireless
Cabinet : Yes
OS : Windows10 Pro
System : Dell Precision T3500 ; Intel X5650 ; 12GB RAM

placebo_yue

  • Full Member
  • ***
  • Posts: 57
  • sup
    • View Profile
    • Instagram
Re: Joy2Key
« Reply #9 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:

  • First, there's no need to "close joy2key" to stop it's binding, simply create an "empty" profile to set as default, and a profile for your emulator with whatever bindings you need, i suggest short names that reference the emulator, like, say "Fusion (genesis)" would be fine.
  • Now go to "Settings>associate profile with applications"
  • On the lower part theres "default behaviour", set "specify a default profile" and select your "empty" profile on the dropdown.
  • Now press "add" to add a profile-app link
  • Application name is arbitrary, put anything that helps you identify and remember the target application
  • Application path, it's easier to set up by pressing "capture aplication info" button below, and then opening your desired app, but you could also simply copy the direct path to the .exe file
  • Asociated profile, select the profile created for this aplication on the dropdown (in my example it would be "Fusion(genesis)").
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.

« Last Edit: August 14, 2020, 01:11:30 PM by placebo_yue »

hermine.potter

  • Hero Member
  • *****
  • Posts: 767
    • View Profile
Re: Joy2Key
« Reply #10 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
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 ^-^
« Last Edit: December 23, 2020, 02:16:10 PM by hermine.potter »
AM Version : 2.6.1
Input : Mad Catz Brawlstick; Mouse; Keyboard; Xbox360 Wireless
Cabinet : Yes
OS : Windows10 Pro
System : Dell Precision T3500 ; Intel X5650 ; 12GB RAM