[not reproduceable]about focus of GUI elems and cameras.

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
Post Reply
polylux
Posts: 267
Joined: Thu Aug 27, 2009 12:39 pm
Location: EU

[not reproduceable]about focus of GUI elems and cameras.

Post by polylux »

Hey everyone.

First off, if the question sounds stupid or has already been answered somewhere else, forgive me, I'm super-tired and/or just too dumb to search. ;)

In my project I've implemented some object interaction mode the player can switch to in order to pick up stuff, attach it to smth or drop other things.
The way how this is invoked:
  1. Change from the FPS camera to a static cam (I do this to 'free' the mouse for the interaction menu)
  2. Show 2 IGUIListBoxes, one showing available stuff, the other one things the player owns.
  3. When done, remove the list boxes from the gui environment, then switch back to the FPS camera
Everything works as expected, except for the case when smth in one of the two list boxes is highlighted (focus) in the moment I switch back to the FPS cam (and remove the list boxes from the gui env). What then happens is that I can look around with the FPS cam using the mouse but the keymapping for the movement seems to be lost. All other key events still work.

Smth I leave out here?

Thanks, cheers and good night,
p.

//SYSTEM:
Irrlicht 1.7.2
ArchLinux x86_64
beer->setMotivationCallback(this);
greenya
Posts: 1012
Joined: Sun Jan 21, 2007 1:46 pm
Location: Ukraine
Contact:

Re: Stupid question about focus of GUI elems and cameras.

Post by greenya »

You don't need second (static) camera. Try to call

Code: Select all

camera->setInputReceiverEnabled(false);
to your active fps camera.
polylux
Posts: 267
Joined: Thu Aug 27, 2009 12:39 pm
Location: EU

Re: Stupid question about focus of GUI elems and cameras.

Post by polylux »

Thanks for the hint greenya!

Unfortunately, that didn't make any difference. Still the same issue.
What actually solved my problem is that I have to explicitly removeFocus() from the GUI elems before I remove them from the GUI environment. Otherwise the FPS cam won't get its key handling back (everything else works though).
Do I do it wrong? Or maybe worth a 'fixme' in the engine?

Cheers,
p.
beer->setMotivationCallback(this);
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Stupid question about focus of GUI elems and cameras.

Post by CuteAlien »

I've moved this to bug report, as it sounds like it could need some fix.
But have to write a program first to reproduce this behaviour (or if you already have a simple program to reproduce this it would save me some time...)
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
polylux
Posts: 267
Joined: Thu Aug 27, 2009 12:39 pm
Location: EU

Re: Stupid question about focus of GUI elems and cameras.

Post by polylux »

I definitely can write up a small "reproducer" this evening. Will send it to you then.
beer->setMotivationCallback(this);
polylux
Posts: 267
Joined: Thu Aug 27, 2009 12:39 pm
Location: EU

Re: Stupid question about focus of GUI elems and cameras.

Post by polylux »

Thanks for your help CuteAlien but my reproducer program was unable to do so, meaning everything seems to be fine from the engine's side. I also changed the order in which I re-register the event receivers in my main project (should show it some time soon, heh). Now it also seems to be OK there. Must have smth to do with my 'cascades' of evt receivers. :)
Thanks again and my apologies,
p. ;)
beer->setMotivationCallback(this);
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Stupid question about focus of GUI elems and cameras.

Post by CuteAlien »

Problem solved without work - always glad to hear that ;-)
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Post Reply