When Irrlicht is running in windowed mode and something has 'captured' the mouse (e.g. CCameraFPSSceneNode) then the mouse is still captured even when the user switches focus to another window (which means they can't use the mouse to control their other windows).
The only way to 'release' the mouse is to exit the running application.
There is currently no way of telling when the user switches to another window.
It would be useful to have some of kind of window focus gained/lost event which could be used to enable or disable mouse capture in an application. This would probably go in the loop that handles events from the operating system in CIrrDevice*.cpp.
(This is a duplicate of
http://sourceforge.net/tracker/index.ph ... tid=540679)
No event for gain/lose window focus
-
- Posts: 360
- Joined: Tue Feb 10, 2004 2:20 am
- Location: Lubbock, TX
It is not diffucult to achieve this. Just change your drawing loop from
to
Code: Select all
while(device->run())
{
}
Code: Select all
while(device->run())
if (device->isWindowActive())
{
}
An event would be much more favourable. Irrlicht is event based, so the solution above is clunky, (one call overhead per frame, one if() with jump per frame!) and also non-obvious. I would much prefer to get an event.niko wrote:It is not diffucult to achieve this. Just change your drawing loop from
toCode: Select all
while(device->run()) { }
Code: Select all
while(device->run()) if (device->isWindowActive()) { }
Best wishes,
Tels
Perl + Irrlicht + Audiere = Game: http://bloodgate.com/perl/game