Hi!
Is it possible to execute some code before ALT + F4?
Irrlicht can't detect ALT key as I found out here -> http://irrlicht.sourceforge.net/forum/v ... =7&t=40253 ( if it can please let me know), so I can't simply use if statement.
Regards,
Jake
Execute code Before ALT+F4
-
HerrAlmanack
- Posts: 52
- Joined: Mon Jun 13, 2011 3:50 pm
Re: Execute code Before ALT+F4
well afaik alt-4 (in windows) sends the message to close the windows app, and irrlicht would be that receiver. i think it just closes the irrlicht device by setting the run() return value to false. i don't see why you couldn't just put that code after the engine while() drawing loop.
-
Radikalizm
- Posts: 1215
- Joined: Tue Jan 09, 2007 7:03 pm
- Location: Leuven, Belgium
Re: Execute code Before ALT+F4
In windows, Alt+F4 sends a WM_CLOSE message to your window messaging loop, irrlicht itself barely has anything to do with it (I'm not sure how this works in Linux, but I assume it's something similar)HerrAlmanack wrote:well afaik alt-4 (in windows) sends the message to close the windows app, and irrlicht would be that receiver. i think it just closes the irrlicht device by setting the run() return value to false. i don't see why you couldn't just put that code after the engine while() drawing loop.
You'd have to catch the WM_CLOSE message before the messaging loop does to be able to execute code before it actually closes the window
Re: Execute code Before ALT+F4
Thanks. I'll try HerrAlamnack's suggestion. Otherwise, I've already came up with alternative. Not so precise, but I it should do.
