Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: Exiting Project 64 via CP?  (Read 9140 times)

0 Members and 1 Guest are viewing this topic.

MagicManPA

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 166
  • Last login:January 12, 2019, 04:35:43 pm
Exiting Project 64 via CP?
« 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? 

nitz

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 507
  • Last login:November 24, 2015, 07:57:29 pm
Re: Exiting Project 64 via CP?
« Reply #1 on: January 24, 2011, 12:12:55 am »
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.

MagicManPA

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 166
  • Last login:January 12, 2019, 04:35:43 pm
Re: Exiting Project 64 via CP?
« Reply #2 on: January 24, 2011, 12:28:30 am »
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. :)

nitz

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 507
  • Last login:November 24, 2015, 07:57:29 pm
Re: Exiting Project 64 via CP?
« Reply #3 on: January 24, 2011, 02:01:43 am »
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!

MagicManPA

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 166
  • Last login:January 12, 2019, 04:35:43 pm
Re: Exiting Project 64 via CP?
« Reply #4 on: January 28, 2011, 04:58:15 pm »
Tried this & it still only accepts commands from the keyboard, not from CP.

nitz

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 507
  • Last login:November 24, 2015, 07:57:29 pm
Re: Exiting Project 64 via CP?
« Reply #5 on: January 28, 2011, 09:58:57 pm »
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?

MagicManPA

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 166
  • Last login:January 12, 2019, 04:35:43 pm
Re: Exiting Project 64 via CP?
« Reply #6 on: January 30, 2011, 05:17:52 pm »
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.

nitz

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 507
  • Last login:November 24, 2015, 07:57:29 pm
Re: Exiting Project 64 via CP?
« Reply #7 on: January 30, 2011, 05:34:51 pm »
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.

MagicManPA

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 166
  • Last login:January 12, 2019, 04:35:43 pm
Re: Exiting Project 64 via CP?
« Reply #8 on: January 30, 2011, 10:57:53 pm »
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}


nitz

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 507
  • Last login:November 24, 2015, 07:57:29 pm
Re: Exiting Project 64 via CP?
« Reply #9 on: January 30, 2011, 11:30:45 pm »
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

MagicManPA

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 166
  • Last login:January 12, 2019, 04:35:43 pm
Re: Exiting Project 64 via CP?
« Reply #10 on: January 31, 2011, 07:59:42 pm »
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.

nitz

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 507
  • Last login:November 24, 2015, 07:57:29 pm
Re: Exiting Project 64 via CP?
« Reply #11 on: January 31, 2011, 08:50:43 pm »
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.

Eddie_Brock

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 147
  • Last login:February 26, 2014, 12:00:34 pm
Re: Exiting Project 64 via CP?
« Reply #12 on: February 06, 2011, 02:28:25 pm »
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