Key Pressed duplicate

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
giuseppegam
Posts: 39
Joined: Thu Jan 11, 2007 2:45 am

Key Pressed duplicate

Post by giuseppegam »

Hi, plase help, y event receiver is receiving Input Key Event doubled.

Code: Select all

if (event.EventType == irr::EET_KEY_INPUT_EVENT&&!event.KeyInput.PressedDown)
{
                 
         	switch(event.KeyInput.Key)
			{
                       case KEY_RETURN:
                      guienv->addMessageBox(L"Error",L"1",0,EMBF_OK);
                      break;                        
                                      
                        
}
         
}
I get two windows writing 1
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

I don't know whether it will help but instead of 'break' you should return true...
Image Image Image
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post by CuteAlien »

There was a bug that key-events got send twice when an element had the focus. It got fixed just a few days ago in svn, so it will probably be working in 1.5
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
giuseppegam
Posts: 39
Joined: Thu Jan 11, 2007 2:45 am

Post by giuseppegam »

JP wrote:I don't know whether it will help but instead of 'break' you should return true...
His solution satisfied, thank you
Post Reply