alt tab and pausing the game
Blitz3D Forums/Blitz3D Beginners Area/alt tab and pausing the game
| ||
Hi there, When I alt tab out of blitz, or another application grabs focus, the blitz app keeps on running. I would like to know how to detect this, and halt execution properly. see http://www.blitzbasic.com/Community/posts.php?topic=43250 for more. |
| ||
hehe.. the beginners forum wouldn't be the place to ask. :) This is actually fairly technical - in Blitz alone, there's no way to detect this at all. Instead what you'd have to do is write a DLL which uses GDI32.DLL to detect when the blitz window ISN'T in focus (identifiable by the window handle) and in blitz code, to poll this constantly. As soon as the window isn't in focus, halt gameplay - and go into a delayed loop where it JUST checks to see if the Blitz window is in focus aain, and if it is, to resume gameplay. Of course, if you're using full-screen Blitz3D, then there's no way to fix this. Don't alt-tab. :) +BlackD |
| ||
This is full-screen, and is a problem for me because it keeps running! Other applications often grab the focus as well... we need this solved! |
| ||
Incorporate a "pause" function, and it'll be the player's fault they didn't pause it first. You pause, then Alt+Tab. |
| ||
Look here: http://www.blitzbasic.com/codearcs/codearcs.php?code=853 It's very easy to do. |
| ||
That's really weird. That function looks like it will do nothing. :D |
| ||
brilliant - thanks lads! And very silly that blitz doesn't have a command for it. |
| ||
Just do what I do and be REALLY EVIL:- if keydown alt = true and keydown tab = true then End ;) |