Jump to content
LaunchBox Community Forums

Associate joystick 2 buttons with daphne


DreyMIX

Recommended Posts

Hello,
currently I have created a small script with AutoHotKey in "Tools -> Manage Emulators -> Running AutoHotkey Script", which allows me to associate the 2 buttons of the joystick 2, as second player for Dragon's Lair.

The code is as follows:

; Start 2
2Joy7::
Send, 2
return

; Coin 2
2Joy9::
Send, 6
return

I have already configured the keys in the DaphneLoader.exe configuration: Dragon's Lair -> Configure -> Input:

Start 2 = Primary Key -> 2
Coin 2 = Primary Key -> 6

When I start it from LaunchBox or BigBox the keys on the keyboard work. Instead on the joystick of the second player, only the button associated with the "key 6" (2Joy9) of the keyboard (the one that gives the token) works for me.

The other button (start 2 - 2Joy7) does not want it to work. And the button number is right, because if I start the AutoHotkey script on Windows and press one of the two joystick buttons with the notepad active, the correct keyboard input is sent.

What's wrong?

Thx!

 

Link to comment
Share on other sites

If you're seeing a "2" and a "6" in Notepad when pressing buttons on the P2 controller then ya, the script is good.  (Though I don't think "return" is necessary. But doesn't hurt anything)

If you start the AHK script in Windows and then load Dragon's Lair directly through Daphne (outside of LaunchBox) , do the player 2 buttons work there?

Link to comment
Share on other sites

Sorry, I didn't specify that I have an arcade stick. But oh well I don't think it involves anything.

The "return" code I think is important, because if I remove it and press one of the 2 binded buttons, AutoHotkey will press me both (2 and 6). Tested directly on Notepad.

As soon as I can, I'll try as you say. Thanks in the meantime.

Link to comment
Share on other sites

23 hours ago, JoeViking245 said:

If you start the AHK script in Windows and then load Dragon's Lair directly through Daphne (outside of LaunchBox) , do the player 2 buttons work there?

Nothing doesn't work. The key associated with the "6" works, while the other, the "2" key, does not work. As usual, if I press it physically on the keyboard, it goes into 2 player mode.

If I open notepad, both buttons work properly.

Why does he do this?

Link to comment
Share on other sites

I finally solved the problem !!!

I modified the script like this:

2Joy7::
Send {2 down}
Sleep 400
Send {2 up}
return

2Joy9::
Send, 6
return

Don't ask me why it works now. But evidently by adding a small pause of 400 milliseconds, the script manages to correctly send the correct impulse to the game. The 400 is a value that I gave at random the first time, maybe it can be lowered more. But it doesn't matter, since it works for me now.

Edited by DreyMIX
  • Game On 1
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...