NiftyInputMapping

I have several popups in a game that follow each other that form a tutorial. The click interaction works (closes the current popup and creates the next one). However, when the space bar is pressed, the next popup is opened automatically without closing the current popup (and without calling my ok-function). I checked the nifty manual and there is a default behavior for the space key (namely ACTIVATE). How can I change this behavior ?



[xml]<popup id="tutorial1" controller="dae.repest.gui.TutorialScreen" visibleToMouse="true" childLayout="center">

<image focusable="true" filename="Textures/Tutorial/Tut01.dds">

<interact onClick="ok()"/>

</image>

</popup>

<popup id="tutorial2" controller="dae.repest.gui.TutorialScreen" visibleToMouse="true" childLayout="center">

<image filename="Textures/Tutorial/Tut02.dds">

<interact onClick="ok()"/>

</image>

</popup>

<popup id="tutorial3" controller="dae.repest.gui.TutorialScreen" visibleToMouse="true" childLayout="center">

<image filename="Textures/Tutorial/Tut03.dds">

<interact onClick="ok()"/>

</image>

</popup>[/xml]

Ok, after a lot of println statements I found a possible bug in nifty, otherwise I’m doing something very wrong. It seems that the Activate input semantic is coupled automatically with the interact element, so my ok function is called. However after I close the first popup, the key-events are still sent to the first popup (that is allready closed).



When I perform a mouse click, the correct controller receives the event.