Closing PCSX2 with a controller
#1
I'm loving the emulator, everything works perfectly but there's some stuff that I'm not sure can be done that would make it even better.

I set the games in a way that I can start them from Steam's Big Picture, and since the emulator works so great, if I start a game while I'm playing from my couch it looks just as if I were playing on a PS2 in my old living-room.

The only problem comes down when I need to close the games, unfortunately there's not a way to close them from the menus or from the controller, so I always have to get up and close them manually.

Is there a way to set the emulator so that if I press a button, the PS3 home button for example, the emulator closes and brings me back to Big Picture?
Reply

Sponsored links

#2
(03-23-2014, 04:35 PM)guru8bit Wrote: I'm loving the emulator, everything works perfectly but there's some stuff that I'm not sure can be done that would make it even better.

I set the games in a way that I can start them from Steam's Big Picture, and since the emulator works so great, if I start a game while I'm playing from my couch it looks just as if I were playing on a PS2 in my old living-room.

The only problem comes down when I need to close the games, unfortunately there's not a way to close them from the menus or from the controller, so I always have to get up and close them manually.

Is there a way to set the emulator so that if I press a button, the PS3 home button for example, the emulator closes and brings me back to Big Picture?

The only way without modifying the source code or writing your own little software I can think of is:
1. Download and install joy2key
2. Map the PS button to the ESC key
3. In the lillypad settings choose "Exit emulator on window close" or something like that at the bottom right

That should do the trick Smile
Reply
#3
(03-23-2014, 05:08 PM)pablocrossa Wrote: The only way without modifying the source code or writing your own little software I can think of is:
1. Download and install joy2key
2. Map the PS button to the ESC key
3. In the lillypad settings choose "Exit emulator on window close" or something like that at the bottom right

That should do the trick Smile

I had already tried that with some SNES emualtors. The main problem is that I don't always want to have Joy2Key open, so the only solution to that is to start it with the game. But, once I start the game, even if I can close it using J2K, there's still Joy2Key to close, and that means that I should also set buttons to Alt+f4 to close it...

EDIT: Looks like even if ESC can close the game window, the main window isn't closed with ESC. Also, I can't use ALT+F4 because both Joy2Key and Xpadder set ALT as a on/off button, so if I press it once, ALT remains activated.
Reply
#4
(03-23-2014, 05:21 PM)guru8bit Wrote: I had already tried that with some SNES emualtors. The main problem is that I don't always want to have Joy2Key open, so the only solution to that is to start it with the game. But, once I start the game, even if I can close it using J2K, there's still Joy2Key to close, and that means that I should also set buttons to Alt+f4 to close it...

EDIT: Looks like even if ESC can close the game window, the main window isn't closed with ESC. Also, I can't use ALT+F4 because both Joy2Key and Xpadder set ALT as a on/off button, so if I press it once, ALT remains activated.

OK this is HACKY at best but here you go:
Code:
@echo off
pcsx2 %*
ping -n 15 127.0.0.1
:loop
ping -n 2 127.0.0.1
set pid=-1
for /f "tokens=2" %%a in ('tasklist /FI "WINDOWTITLE eq GSdx*" ^| find /i "pcsx2"') do (set pid=%%a)
IF %pid% GTR 0 goto loop
set pidA=-1
for /f "tokens=2" %%a in ('tasklist ^| find /i "pcsx2"') do (set pidA=%%a)
taskkill /PID %pidA%
for /f "tokens=2" %%a in ('tasklist ^| find /i "joytokey"') do (set pidA=%%a)
taskkill /PID %pidA%

Save this in your PCSX2 folder as RunPCSX2.bat and instead of calling the PCSX2 executable from Steam call this file with the same parameters, it will run PCSX2, wait 15 seconds and check every 5 seconds to see if GSdx window has closed; it will then close PCSX2 and joy2key

If you run a different executable than pcsx2.exe then modify the pcsx2 on the second line to the right thing i.e. pcsx2-think for pcsx2-think.exe and put it in the same folder as the EXE you want to run Smile

Hope that helps Laugh

EDIT: You might want to add the option for it to run joy2key on startup, ask me if you need help Smile
Reply
#5
(03-23-2014, 05:57 PM)pablocrossa Wrote: OK this is HACKY at best but here you go:
Code:
@echo off
pcsx2 %*
ping -n 11 127.0.0.1
:loop
ping -n 6 127.0.0.1
set pid=-1
for /f "tokens=2" %%a in ('tasklist /FI "WINDOWTITLE eq GSdx*" ^| find /i "pcsx2"') do (set pid=%%a)
IF %pid% GTR 0 goto loop
IF %pid%==-1(
    set pidA=-1
    for /f "tokens=2" %%a in ('tasklist ^| find /i "pcsx2"') do (set pidA=%%a)
    taskkill /PID %pidA%
    for /f "tokens=2" %%a in ('tasklist ^| find /i "joy2key"') do (set pidA=%%a)
    taskkill /PID %pidA%
    )

Save this in your PCSX2 folder as RunPCSX2.bat and instead of calling the PCSX2 executable from Steam call this file with the same parameters, it will run PCSX2, wait 15 seconds and check every 5 seconds to see if GSdx window has closed; it will then close PCSX2 and joy2key

If you run a different executable than pcsx2.exe then modify the pcsx2 on the second line to the right thing i.e. pcsx2-think for pcsx2-think.exe and put it in the same folder as the EXE you want to run Smile

Hope that helps Laugh

EDIT: You might want to add the option for it to run joy2key on startup, ask me if you need help Smile

Up until now I've been launching the Iso files directly since I set them to open them with PCSX2. I tried launching this bat but it tells me that it can't find PCSX2.

So... How should I launch the games? Do i need to create an exe file that executes both the bat and the game?
Reply
#6
(03-23-2014, 06:33 PM)guru8bit Wrote: Up until now I've been launching the Iso files directly since I set them to open them with PCSX2. I tried launching this bat but it tells me that it can't find PCSX2.

So... How should I launch the games? Do i need to create an exe file that executes both the bat and the game?

change "pcsx2 %*" to "start %*" and just pass the ISO name as the first parameter i.e. RunPCSX2.bat "C:\isoFile.iso"

EDIT: You'll then also need to add code to start joy2key at the beginning of the BAT file Smile
Reply
#7
(03-23-2014, 06:41 PM)pablocrossa Wrote: change "pcsx2 %*" to "start %*" and just pass the ISO name as the first parameter i.e. RunPCSX2.bat "C:\isoFile.iso"

EDIT: You'll then also need to add code to start joy2key at the beginning of the BAT file Smile

Start %* doesn't seem to launch PCSX2 either. I also tried with
Code:
start "C:\Program Files (x86)\PCSX2 1.0.0\pcsx2-r5350.exe"
But it's not working either. It's like the command is not finding the exe.

It's been some time since I've done this, sorry if I'm doing reallys tupid things.
Reply
#8
(03-23-2014, 07:06 PM)guru8bit Wrote: Start %* doesn't seem to launch PCSX2 either. I also tried with
Code:
start "C:\Program Files (x86)\PCSX2 1.0.0\pcsx2-r5350.exe"
But it's not working either. It's like the command is not finding the exe.

It's been some time since I've done this, sorry if I'm doing reallys tupid things.

That's alright, can you try "start ISOFILENAME" from a CMD window?? That is, for example, ' start "D:\games\SotC.iso" ' or whatever PS2 ISO you have?? See if that launches PCSX2. If so try changing the file to start "%*" and run the BAT file with the ISO name as the first parameter.
Reply
#9
(03-23-2014, 07:10 PM)pablocrossa Wrote: That's alright, can you try "start ISOFILENAME" from a CMD window?? That is, for example, ' start "D:\games\SotC.iso" ' or whatever PS2 ISO you have?? See if that launches PCSX2. If so try changing the file to start "%*" and run the BAT file with the ISO name as the first parameter.

Nope, it's not working. It's really weird, I'm pretty sure I did it right.
Reply
#10
(03-23-2014, 07:17 PM)guru8bit Wrote: Nope, it's not working. It's really weird, I'm pretty sure I did it right.

Yep on my system start also doesn't want to work when there are spaces in the filename, can you check there are no spaces AND remove the quotes??
Reply




Users browsing this thread: 1 Guest(s)