This is nice! On OSX, processes can be paused and continued too (by name via killall, and by PID via kill):<p><pre><code> kill -STOP 1234
kill -CONT 1234
killall -STOP -c "Pandora"
killall -CONT -c "Pandora"
</code></pre>
A more nuanced control is to throttle down the CPU, via cputhrottle[1].<p>If I'm running a CPU-intensive calculation and don't want to bog down the rest of my system I will use it to give me enough cycles for Sublime Text to work smoothly.<p>It's easy to call:<p><pre><code> sudo cputhrottle PID cpuUsage%</code></pre>
ex.<p><pre><code> sudo cputhrottle 12345 400
</code></pre>
1. <a href="http://www.willnolan.com/cputhrottle/cputhrottle.html" rel="nofollow">http://www.willnolan.com/cputhrottle/cputhrottle.html</a>
Great app but I have one request. Can you please modify it so instead of pausing the game until my SO is done talking, it pauses my SO until my game is done its cutscene? Thanks in advance.
This should be a basic requirement for all games. Even before I was married my mom would call or someone would ring the doorbell. And when I was a kid I had to go down to dinner or take out the trash.
Great idea, will be helpful.<p>Now, I only need a similar tool that kills the process with the highest CPU and MEMORY load with a short cut. Reasons: Sometimes a process leaks memory and fills up 16GB RAM and opening a new process like taskmgr is impossible to severe paging-IO. Sometimes a full screen application crash and spawns a modal crash dialog behind the full screen window so only taskmgr and keyboard usage works (as the mouse is hidden by the crashed full screen app).
You can also download the executable (if you don't want to compile it) from <a href="https://www.myotherpcisacloud.com/post/universal-pause-button" rel="nofollow">https://www.myotherpcisacloud.com/post/universal-pause-butto...</a>
"I've already gotten great value out of the program, as there are lots of cut scenes in The Witcher 3, that I don't want to skip."<p>The Witcher 3 pauses cutscenes when the window is not in focus. So the example is probably not the greatest.
Nice idea and app. Having a quick look at the code I had forgotten how much work needed to be done for old-skool Windows applications. They do give you great lean applications though which is something I miss.<p>I will always have a soft spot for small, lean single function applications. I guess it takes me back to my UNIX days. Some of my favourite more modern programs are SumatraPDF, uTorrent (the older 2.x versions) and Notepad2, lovely single exe programs that are self-contained. No installers and messy configs all over the place or in the registry.
You can do this to any process in Windows' Resource Monitor too - the one you can open from task manager. On the CPU tab you can right click any process and suspend it.
That's interesting. However, I wonder ... don't you think it can be abused in some games that try to compensate lag? For example, what if they use a code similar to:<p><pre><code> delay = currentFrameTime - lastFrameTime
playerPosition += direction * delay
</code></pre>
I know that some games (such as Diablo III) may automaticallt ban you if you happen to run a program that may be used to cheat (they detect that via a background process check).
Indeed some deep nesting here. You made me remember a quickbasic program I wrote for a class back in early 90s, where I packed the whole program in a single do-loop with about 20 indent levels at it's deepest, and I loved it. But... the prof told me to never do that again :( Anyway, thanks a lot for the flashback :)
Without reading the explanation, immediately my roommate and I figure out how to do it via the linux terminal by pausing the main thread. It seems so obvious, don't know why I wasn't doing this myself.... since I have the same problem as the OP.
@OP<p>I've added this to the scoop-extras bucket for Scoop[0]. So users with the extras bucket can install it using:<p><pre><code> scoop install universalpausebutton
</code></pre>
EDIT: Do you have a licence?<p>[0]: <a href="http://scoop.sh" rel="nofollow">http://scoop.sh</a>
I love this!!! The pause button was incredibly useful when trying to figure out what went wrong with DOS boot sequence. I wonder if it would be possible to include support for it in Linux kernel? Sometimes I would like to read those messages that fly over the screen (no, dmesg is not enough)...
This specific example is nice although not truly universal.<p>An interesting startup idea would be a bluetooth thingy (kinda vague, maybe a necklace?) that when pushed becomes a TRUE universal pause button. Pauses my DVR, my car audio, my linux mythtv box, everything, silences my phone ringer, mutes the TV, shuts off the alarm clock, temp-mutes the smoke alarm if its currently going off, silence the oven timer, car alarm off if its currently sounding, you name it.<p>Sounds technologically possible although a huge PITA, which sounds like a great startup idea.<p>You might need to ram thru a whole new bluetooth LE broadcast protocol, maybe. Or just a blind beacon of "anything" thats sniffable (edited: whoops that wouldn't work so well with silenced burglar alarm systems).<p>I suspect this would sell pretty well once it gets universal...
Win10Phone/Android/iOS apps are suspended and restored the same ways too. Only the visible app (and some system processes) is running in iOS1-8 (in iOS9 iPadAir2 two apps). It's usually unused in desktop OS (except for universal apps in Win10).
I would love this for Mac, not for games but for all browser tabs. Find whichever tab I'm playing music in, and pause it, whether it be SoundCloud, YouTube, or some other streaming something. Fantastic idea though!
Having a modernized pause/break key on your keyboard can also be handy if you ever have to use software that acts stupid on purpose, like these "Safe Exam LockDown Browsers" that some schools and universities around here have started forcing upon their students. Software like this typically just run a timer or similar to make sure that only their windows are running in the foreground, but sending them a SIGSTOP stops this annoyance.
But what if the process uses a timer to update an animation? (I.e., the state of the timer determines the frame in the animation).<p>In that case, after unpausing, the animation would just skip ahead.<p>As a remedy, the pause button could also stop the system clock as seen by the process.
aka "Windows users discover our CTRL+Z" :) Been doing that very often during Ludum Dare where the best games have usually very fine gameplay and very poor everything else, like lack of pause or progress save - surely came handy.
It wasn't until MGS4 before the Metal Gear Solid franchise got cutscenes which you could pause. Which was sorely needed because of how story driven the series is, and how long some of the cutscenes are -- I think the end of MGS4 was something like 1 hour, 30 min.
<i>"I like to play video games. I also have a significant other, and she often walks into the room to talk to me while I'm playing a video game."</i><p>Looks like the real solution would be to pause your SO ;)