Option to auto-pause emulation when the window loses focus?
#1
I have notifications set up to periodically remind me of things, and they're designed to steal focus, which is convenient for most of the PC games I play, as they pause automatically when the window they're in loses focus. Is there any way to set up PCSX2 to do the same? I've tried looking around the forum and through all the various configuration options, but I haven't seen anything that seems like it'll do the trick.
Reply

Sponsored links

#2
The first thing I can think of is sending Escape to pause the emulation(this will require you to run pcsx2 normally,not with the -nogui command line)

It can be done with AutoHotkey(a program)
Code:
StringCaseSense, On
WinWaitActive,GSdx |
Loop
{
WinWaitNotActive,GSdx |
IfWinExist,PCSX2  1.0.0
PostMessage,0x111,131,,,PCSX2  1.0.0
Else
ExitApp
WinWaitActive,GSdx |
}
The code can be maded to works in a lot of different ways.

1.When the game window become inactive
2.When the game window become inactive because a certain window appeared.
Reply
#3
Thanks for the help! I was unaware of AutoHotkey, so I probably never would've been able to come up with this on my own. Your script worked almost perfectly. The only weird thing I noticed is that it prevented the escape key from pausing emulation like usual (it would pause and then immediately resume). I made a slight tweak and now it works like a charm. Here's what I've got, just in case anyone else would find this useful.

Code:
StringCaseSense, On
WinWaitActive,GSdx |
Loop
{
WinWaitNotActive,GSdx |
IfWinExist,PCSX2  1.0.0 && IfWinExist,GSdx |
{
PostMessage,0x111,131,,,PCSX2  1.0.0
}
WinWaitActive,GSdx |
}
Reply
#4
Hmm,yes,but keep in mind that I used "GSdx |" for a reason...if you for example open any window with a name that start with GSdx,the command will be triggered.
The chance to open such window is a lot bigger than window with this name GSdx |

For example,opening this
http://forums.pcsx2.net/Thread-GSdx
will also trigger the IfWinExist,GSdx

There are tons of things you can do with AutoHotkey
Reply
#5
(06-21-2013, 10:14 PM)vsub Wrote: Hmm,yes,but keep in mind that I used "GSdx |" for a reason...if you for example open any window with a name that start with GSdx,the command will be triggered.
The chance to open such window is a lot bigger than window with this name GSdx |

For example,opening this
http://forums.pcsx2.net/Thread-GSdx
will also trigger the IfWinExist,GSdx

There are tons of things you can do with AutoHotkey

Ahhhh, that's a good point. I didn't think of that. I edited my post to add in the pipe. Thanks again for the advice!
Reply




Users browsing this thread: 1 Guest(s)