Build Your Own Arcade Controls Forum
Main => Software Forum => Topic started by: MagicManPA on January 23, 2011, 10:32:32 am
-
Finally got P64 to cooperate with me & play the ROMs. However, I can't seem to set an exit command via my CP. I only see the ability to create keyboard shortcuts in P64 & the exit command I set through Mala doesn't work on P64.
I want to be able to exit Project 64 and/or at least exit the P64 ROM I'm in & have it go right back to the Mala game list. I'm sure I'm missing something simple here. Anyone want to point me in the right direction?
-
I would do this using an autohotkey script. Just have your exit key send Alt+F4 whenever Project64 is running. If you're not familiar, I could even write the script for you as it would be really easy.
-
I would do this using an autohotkey script. Just have your exit key send Alt+F4 whenever Project64 is running. If you're not familiar, I could even write the script for you as it would be really easy.
No idea how to do that so your help would be appreciated. :)
-
Sure thing. Download autohotkey and make a file named PJ64exit.ahk or whatever you like and type the following in it:
esc::
send !{F4}
exitapp
If you set up your front end to also run PJ64exit.ahk whenever it launches an N64 game, pressing escape will send Alt+F4 which will close PJ64. Then the exitapp command will close the script. Of course if the key you normally use to exit is something different than escape, just replace esc with that.
Alternatively, if you don't want to go to the trouble of setting things up to launch a script everytime you launch a game, you could just have the following script running in the background constantly:
settitlematchmode, 2
#IfWinActive, window title
esc::
send !{F4}
where "window title" is a piece of text that always appears in the title of the PJ64 window - and it must match exactly. This will change esc to Alt+F4 whenever PJ64 is the active window.
Hope this helps!
-
Tried this & it still only accepts commands from the keyboard, not from CP.
-
I take it you're not using a keyboard encoder then, because in that case it should work since the PC basically thinks your CP is a keyboard. How is your CP hooked up?
-
I take it you're not using a keyboard encoder then, because in that case it should work since the PC basically thinks your CP is a keyboard. How is your CP hooked up?
No keyboard encoder. I'm using Paradise Arcade Shop's USB Controller.
-
OK, I'm thinking autohotkey sees your CP as a Joystick controller then. Try looking in the autohotkey help file in the section "Key List (Keyboard, Mouse, Joystick)". I've never used autohotkey with a joystick input before, but it's looking like you would want to use the test script they give you to figure out what button number your exit button is, and then replace
esc::
send !{F4}
with
joy#:: send !{F4}
where # is whatever number that test script says your exit button is.
I hope this helps. I'm sure it's possible to do what you want to do, so let me know if this works or if you still have issues.
-
Here is what I changed it to & I still get nothing. "Project64" is always present in the window title bar when it is running. I tried it with 1 through 8 (Number of Joystck 1 buttons I have on my CP) and no result with any of them.
#IfWinActive, Project64
Joy8::
send !{F4}
-
Did you try the test script to see exactly what the exit button is? I'll cut and paste it out of the autohotkey help at the bottom of this message. If you knew exactly what button number exit is, that would help narrow down the problem - it could very well be higher than 8.
Also, be sure to include the line
settitlematchmode, 2
in your script as otherwise you may need to give the complete name of the window and not just "Project64". Also be sure that the window name really contains "Project64" and not "Project 64" or "project64" - you need to be exact. I'd be very surprised if there's no way to make this work with AHK, so I think we're still getting tripped up somewhere...
Here is that script:
; July 6, 2005: Added auto-detection of joystick number.
; May 8, 2005 : Fixed: JoyAxes is no longer queried as a means of
; detecting whether the joystick is connected. Some joysticks are
; gamepads and don't have even a single axis.
; If you want to unconditionally use a specific joystick number, change
; the following value from 0 to the number of the joystick (1-16).
; A value of 0 causes the joystick number to be auto-detected:
JoystickNumber = 0
; END OF CONFIG SECTION. Do not make changes below this point unless
; you wish to alter the basic functionality of the script.
; Auto-detect the joystick number if called for:
if JoystickNumber <= 0
{
Loop 16 ; Query each joystick number to find out which ones exist.
{
GetKeyState, JoyName, %A_Index%JoyName
if JoyName <>
{
JoystickNumber = %A_Index%
break
}
}
if JoystickNumber <= 0
{
MsgBox The system does not appear to have any joysticks.
ExitApp
}
}
#SingleInstance
SetFormat, float, 03 ; Omit decimal point from axis position percentages.
GetKeyState, joy_buttons, %JoystickNumber%JoyButtons
GetKeyState, joy_name, %JoystickNumber%JoyName
GetKeyState, joy_info, %JoystickNumber%JoyInfo
Loop
{
buttons_down =
Loop, %joy_buttons%
{
GetKeyState, joy%a_index%, %JoystickNumber%joy%a_index%
if joy%a_index% = D
buttons_down = %buttons_down%%a_space%%a_index%
}
GetKeyState, joyx, %JoystickNumber%JoyX
axis_info = X%joyx%
GetKeyState, joyy, %JoystickNumber%JoyY
axis_info = %axis_info%%a_space%%a_space%Y%joyy%
IfInString, joy_info, Z
{
GetKeyState, joyz, %JoystickNumber%JoyZ
axis_info = %axis_info%%a_space%%a_space%Z%joyz%
}
IfInString, joy_info, R
{
GetKeyState, joyr, %JoystickNumber%JoyR
axis_info = %axis_info%%a_space%%a_space%R%joyr%
}
IfInString, joy_info, U
{
GetKeyState, joyu, %JoystickNumber%JoyU
axis_info = %axis_info%%a_space%%a_space%U%joyu%
}
IfInString, joy_info, V
{
GetKeyState, joyv, %JoystickNumber%JoyV
axis_info = %axis_info%%a_space%%a_space%V%joyv%
}
IfInString, joy_info, P
{
GetKeyState, joyp, %JoystickNumber%JoyPOV
axis_info = %axis_info%%a_space%%a_space%POV%joyp%
}
ToolTip, %joy_name% (#%JoystickNumber%):`n%axis_info%`nButtons Down: %buttons_down%`n`n(right-click the tray icon to exit)
Sleep, 100
}
return
-
Tried with & without the full window title & all button numbers. Did not work. There has to be a way to exit P64 & go back to the gamelist screen w/o all this.
-
Wow, I'm really surprised this didn't work. I'm stumped. :dunno The only thing I can think of is that your CP is not seen as a joystick, but as...something else. :dunno In which case I have no clue where to go from here. Hopefully someone else can offer some advice.
-
Open up notepad on your machine (or any other writing program) and press the button on your control panel that you plan to use as your "exit" button. You should get a letter appear... then replace the "esc" portion of the below script with that letter. This should hopefully fix you up.
Sure thing. Download autohotkey and make a file named PJ64exit.ahk or whatever you like and type the following in it:
esc::
send !{F4}
exitapp