14 ms·
Show HN: Universal Pause Button
- RyanRies 11y agoYou can also download the executable (if you don't want to compile it) from https://www.myotherpcisacloud.com/post/universal-pause-button https://www.myotherpcisacloud.com/post/universal-pause-butto...
- scrollaway 11y agoReally cool. Well done! Did you try it on Wine yet?
- livebeef 11y agoWine? What about SIGSTOP?
- nacs 11y agoYou should consider uploading that file to the Github repo in the "Releases" section so people can find it easier.
- RyanRies 11y agoGood idea.
- irq-1 11y agoYou should not pause explorer.exe
- RyanRies 11y agoAgreed. Learned that the hard way. I have since updated the app with an exclusion specifically for explorer.exe. Later I'll scan the registry and find what the user's shell is, just to cover the rare case that the user has a custom shell.
- ohitsdom 11y agoReally clever. What a thoughtful project, too. Hope your SO appreciates the work you put in on it!
- Carrok 11y agoI 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!
- jon-wood 11y agoMedia Keys does that for Chrome. https://chrome.google.com/webstore/detail/media-keys-by-swayfm/icckhjgjjompfgoiidainoapgjepncej https://chrome.google.com/webstore/detail/media-keys-by-sway...
- ihuman 11y agoAt WWDC, they announced that the new Safari version would be able to do something like that.
- Artemis2 11y agoThat's only muting tabs, which Chrome has been doing for years.
- miraks 11y agoAnd for Firefox. https://addons.mozilla.org/en-US/firefox/addon/be-quiet/ https://addons.mozilla.org/en-US/firefox/addon/be-quiet/
- cool-RR 11y ago"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." Looks like the real solution would be to pause your SO ;)
- jerf 11y agoI encountered this problem with babies. They definitely don't pause. My solution was the DS/3DS line of consoles... snap 'em shut, bam, paused. I've called them the consoles of choice for the discriminating father. (If you've never had kids and find yourself wondering what horrible father would be playing video games while taking care of his children, well, you see, it turns out that sometimes your child wants to sleep on somebody, and will not sleep any other way... and there's only so many things you can do with a baby that cries if you move sleeping on you. Both of my kids went through that phase for different reasons.)
- icesoldier 11y ago> My solution was the DS/3DS line of consoles... snap 'em shut, bam, paused. I'm a fan of this as well - works for PSP and Vita too, just quickly press power and it's in sleep mode. However, I have run into one game that didn't properly pause itself when closed. I think it was Kingdom Hearts 358/2 Days. Its cutscenes didn't pause when I closed my DS. Otherwise, yeah, this is the greatest.
- ConAntonakos 11y agoDoes the Xbox One not do this? I mean suspend gameplay and resume with just a touch of a button?
- arcatek 11y agoThat'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: delay = currentFrameTime - lastFrameTime playerPosition += direction * delay 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).
- RyanRies 11y agoI have thought about this. In fact I even asked Gabe Newell about whether the use of this program might falsely trigger some anti-cheat mechanism within Steam. (He hasn't replied yet.) So, I guess until I get more official information, please proceed with caution and use at your own risk. That being said, that would imply that using Process Explorer or PsSuspend could also get you banned, since those applications also have the ability to suspend threads.
- SCHiM 11y agoYeah do be very careful with this, many anti-cheat programs are very trigger-happy. Some time ago I had an application crash on a development machine while I was playing a game. On my dev machine crashes go straight to ollydbg. Next thing I know I'm kicked from the game, and it tells me to stop 'using cheat programs'. Go figure :p
- nekitamo 11y agoAnother reason you should cloak your Ollydbg :) https://tuts4you.com/download.php?list.3 https://tuts4you.com/download.php?list.3 https://tuts4you.com/download.php?view.2425 https://tuts4you.com/download.php?view.2425
- toxicFork 11y agoHeh, spotify did this too, if you had any debugger running then it would just instantly shut down. It probably still does it.
- 11y ago
- ifdefdebug 11y agoIndeed 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 :)
- RyanRies 11y agoAgreed, it's not the most elegant code, but it's so short and simple I haven't bothered reorganizing the code yet. I probably will start adding features like re-bindable pause key, etc., and I will untangle the mess a bit at that time.
- asddubs 11y agoquickest way to do it is to negate your if conditions in the loop something like this: if (ForegroundWindow) { ... } else { MessageBox(NULL, L"Unable to detect foreground window!", L"UniversalPauseButton Error", MB_OK | MB_ICONERROR); } becomes if (!ForegroundWindow) { MessageBox(NULL, L"Unable to detect foreground window!", L"UniversalPauseButton Error", MB_OK | MB_ICONERROR); break; } ...
- xytop 11y agoI've added a pull request which reduces nesting a bit: https://github.com/ryanries/UniversalPauseButton/pull/2 https://github.com/ryanries/UniversalPauseButton/pull/2
- paradite 11y agofor reference: https://github.com/ryanries/UniversalPauseButton/blob/master/Main.cpp#L172 https://github.com/ryanries/UniversalPauseButton/blob/master...
- meritt 11y agoDeep nesting always bugs me too. It's so much cleaner and easier to understand (for me anyway) to identify the else case ahead of time and stop processing immediately.
- frik 11y agoGreat idea, will be helpful. 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).
- Hello71 11y agoMagic SysRq-F
- arebours 11y agoWooow, thanks a lot! I'm going to test it now. Edit: Not working as expected :( Run python script that allocated a couple of gigabytes of RAM effectively causing my machine to freeze. And OOM killer figured out the best thing it can do is this: [2889118.406439] Out of memory: Kill process 11878 (SpotifyHelper) score 302 or sacrifice child [2889118.406442] Killed process 11878 (SpotifyHelper)
- simias 11y agoSuch are the ways of the OOM killer: http://lwn.net/Articles/104185/ http://lwn.net/Articles/104185/
- sjolsen 11y agoIf it's a specific program that's doing this, maybe you can wrap it with a script that executes ulimit.
- hittudiv 11y agoAlways used to watch those cutscenes on youtube! Awesome app btw.
- samspot 11y agoThis 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.
- derefr 11y agoYears ago, I wondered why hypervisor-level pause (and memory snapshots, for that matter) weren't just expected features for game consoles. These days I can at least hit the Home button on a Wii U game and expect it to work. Emulators are still hogging save-states all to themselves, though.
- CPLX 11y agoThat reminds me of the old "Supervisor Key" in classic early games.
- jansc 11y agoYeah! Like the boss key in Leisure Suit Larry: http://www.mobygames.com/game/leisure-suit-larry-goes-looking-for-love-in-several-wrong-places/screenshots/gameShotId,57500/ http://www.mobygames.com/game/leisure-suit-larry-goes-lookin... Now THAT is a job ad ;-)
- mentat 11y ago"Oh yeah, I was just working on this spreadsheet." Those were the days...
- fixermark 11y ago"Tricks of the Mac Game Programming Gurus [http://www.amazon.com/Tricks-Mac-Game-Programming-Gurus/dp/1568301839]" http://www.amazon.com/Tricks-Mac-Game-Programming-Gurus/dp/1... actually dedicated about a paragraph or two to the topic, driving home the point that a game that cannot be paused is leaving N% of potential players on the table right out of the starting gate (and I believe they even had a hypothetical about "little Jimmy" not being able to pause to take out the trash and therefore his parents uninstall the game). These days of MMOs and other coordinated time-sinks make me miss the simplicity of pausable single-player and turn-based multiplayer sometimes.
- VLM 11y agoThis specific example is nice although not truly universal. 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. Sounds technologically possible although a huge PITA, which sounds like a great startup idea. 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). I suspect this would sell pretty well once it gets universal...
- shabble 11y agoyears and years ago I had some thoughts tumbling around about how I'd design an automated system for muting/vibrate-mode only for phones in cinemas/libraries/quiet-zones, etc. The security implications and UX involved in managing settings in a non-infuriating fashion rapidly sunk it though, and I daresay it would never have been practically deployable unless business/landowners/whatever could enforce its use as a condition of entry. Also, you forgot the hollow tooth + airbag components + RF magic => remote operated ball-gag :P
- savanaly 11y agoNow if only there was a Universal Skip Button for those games with unskippable credits, intros or cutscenes!
- ars 11y agoThis actually is sort of possible, you have to mess with the system clock as seen by the program, to make it think much more time has passed than really passed. It will run those scenes at hyperspeed. Then give back the time later (if you need the clock to match the real clock) when it's waiting for input.
- cheepin 11y agoThere was a program called cheat engine that let you drag a slider for program speed, as well as generally dig around RAM.
- frik 11y agoOne can usually just rename/delete the intro videos (*.bik) or replace them with 1s bik video file or add a commandline flag to the desktop link or a setting in the config text file. But, an universal fixing app that has some heuristics would be more convenient.
- voltagex_ 11y agoIf there is, PCGamingWiki will generally have it. e.g http://pcgamingwiki.com/wiki/Remember_Me#Skip_intro_videos http://pcgamingwiki.com/wiki/Remember_Me#Skip_intro_videos
- seba_dos1 11y agoaka "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.
- scandinavian 11y ago"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." The Witcher 3 pauses cutscenes when the window is not in focus. So the example is probably not the greatest.
- ConAntonakos 11y agoI can confirm this as well. If you simply switch to another window or application, away from the game, it'll pause the cutscene.
- bjt 11y agoSo then every time his wife walks in to ask a question, he immediately Alt-Tabs to another window, and she thinks he's watching porn all the time.
- scandinavian 11y agoWell, I run fullscreen windowed, so something on one of my other two screens just take the focus. The game is still visible and is just paused.
- unoti 11y agoMy son has been playing Witcher 3 for the last few weeks, and literally every time I walk by, there's a cutscene. I'm pretty sure I have yet to see anything but cutscenes. It's all cutscenes. Listening to it in the background, it sounds more like an episode of Sons of Anarchy than a traditional videogame.
- tomkinstinch 11y agoThis is nice! On OSX, processes can be paused and continued too (by name via killall, and by PID via kill): kill -STOP 1234 kill -CONT 1234 killall -STOP -c "Pandora" killall -CONT -c "Pandora" A more nuanced control is to throttle down the CPU, via cputhrottle[1]. 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. It's easy to call: sudo cputhrottle PID cpuUsage% ex. sudo cputhrottle 12345 400 1. http://www.willnolan.com/cputhrottle/cputhrottle.html http://www.willnolan.com/cputhrottle/cputhrottle.html
- archagon 11y agoI actually wrote a little GUI app to do this for me a while back! It works but the UI is a bit broken. Maybe somebody will find it useful. https://github.com/archagon/app-pauser https://github.com/archagon/app-pauser
- ars 11y agoOn debian the program is cpulimit.
- jokr004 11y agoThe kill -STOP command works on linux too
- ars 11y agoIt does, but cpulimit repeatedly stops/continues the program to keep it within a certain amount of CPU. It works pretty good, but I have had flash games crash if you limit them too low for a while.
- jokr004 11y agoOk I had a total brain-fart there.. I didn't realize that you were responding about the cputhrottle command. Whoops
- 11y ago
- Drdrdrq 11y agoI 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)...
- simias 11y agoThis program doesn't pause the kernel, just the game's process. Other people in this thread have given equivalent solutions for un*x. If you want to actually pause the linux kernel you'll have to use something like the magic SysRq: https://en.wikipedia.org/wiki/Magic_SysRq_key https://en.wikipedia.org/wiki/Magic_SysRq_key Alternatively you can run the operating system in an emulator like qemu.
- simoncion 11y agoWhy isn't dmesg (combined with syslog to catch messages from daemon startup) enough? I've dramatically increased the size of the kernel ring buffer (so it -in practice- doesn't evict any message) and done ...something... -I can't remember what- to push early dmesg output into syslog.
- snorkel 11y agoWow, coded like a simple old school Win32 API win app, I didn't realize that was still possible in modern Visual Bloatio. Nicely done.
- RyanRies 11y agoMy favorite kind of application. Small, lean, close to the metal, and built like a brick house. :)
- neutralino1 11y agoCan we pause the significant other too?
- miket 11y agoWould love to have this for email.
- jdlyga 11y agoIt even pauses video studio! It really is universal.
- frik 11y agoWin10Phone/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).
- kozukumi 11y agoNice 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. 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.
- tehwalrus 11y agoSumatra PDF is the best. I actually prefer it, running under wine, to any of the Linux PDF readers I've tried. I used I to write/preview my thesis.
- veli_joza 11y agoDid you try Foxit reader? They actually have a Linux build that is not as feature-full as other releases, but still better than any native Linux PDF reader.
- alexweber 11y agoTransmission is a great replacement for uTorrent IMHO
- lettergram 11y agoWithout 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.
- deleted 11y ago[deleted]
- kpennell 11y agotest comment!!
- ubercow13 11y agoYou 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.
- rip747 11y agonot seeing this in Windows 7. Is this specific to Windows 8 and above?
- amadeusw 11y agoFrom Task Manager, open Resource Monitor. That's the one with green charts on the right hand side. It has different context menu than the Task Manager. Picture (on windows 8): http://thewindowsclub.thewindowsclubco.netdna-cdn.com/wp-content/uploads/2014/01/Wait-Chain-Traversal-resmon.jpg http://thewindowsclub.thewindowsclubco.netdna-cdn.com/wp-con... I'm not sure if Windows 7 has it, though.
- gnud 11y agoWin7 has it. In task manager, go to the Performance tab, and then press the "Resource Monitor" button. Or run `perfmon /res`.
- mattbgates 11y agoDamn, I thought this was for real life.. could've used one of those. Better than hitting snooze 10 times.
- 72deluxe 11y agoOn OSX you can use Activity Monitor to use View > Send Signal To Process....
- amelius 11y agoBut what if the process uses a timer to update an animation? (I.e., the state of the timer determines the frame in the animation). In that case, after unpausing, the animation would just skip ahead. As a remedy, the pause button could also stop the system clock as seen by the process.
- RyanRies 11y agoYep, different applications are guaranteed to react differently to this, depending on how they were written. And a lot of games use the _rdtsc intrinsic straight from the CPU... I can't pause that. :)
- amelius 11y agoYou could write a virtual machine that compiles all code into essentially the same code except for the rdtsc instruction (basic-block analysis). That is a lot of work, but I wonder if there are no debugging or reverse-engineering tools that work in that way.
- janinge 11y agoHaving 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.
- Dewie3 11y agoIt 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.
- NamTaf 11y agoGreat 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.
- JetSpiegel 11y agoAh, I didn't know Adam Sandler posted on Hacker News.
- scotty79 11y agoTry this: http://placebobutton.com/ http://placebobutton.com/ It was featured on HN recently.
- murbard2 11y agoFor a fraction of a second, part of me really hoped it could somehow be a pause button for life itself.
- deevus 11y ago@OP I've added this to the scoop-extras bucket for Scoop[0]. So users with the extras bucket can install it using: scoop install universalpausebutton EDIT: Do you have a licence? [0]: http://scoop.sh http://scoop.sh
- RyanRies 11y agoThank you! Added MIT license.
- finehopelee 11y agoOur company - Xiamen Finehope Polyurethane Co., Ltd devoted in promoting widely usage of polyurethane since 2002. During the past 12 years, we had worked with many prestigious companies. http://www.polyurethanesupplierschina.com/ http://www.polyurethanesupplierschina.com/
- kilolima 11y agoWouldn't it be easier if your girlfriend would not expect that she can walk in and interrupt you any time she wants?
- RyanRies 11y agoWell, maybe. But then maybe I wouldn't have a girlfriend. And more importantly, maybe I wouldn't be reminded that sometimes it's OK to peel myself away from a video game.
- est 11y agoReminds me of old utility which could resize any DirectX based game and force them run in windowed mode.
- est 11y agoReminds me of old utility which could resize any DirectX based game and force them run in windowed mode.