I am a newbie to CEGUI, and English is not my mother language. Sorry for I my poor English.
I want to use keyboard to control a menu in games. That means, navigate the menu with UP ARROW key and DOWN ARROW key, and confirm with ENTER key. I find this post: http://www.cegui.org.uk/phpBB2/viewtopic.php?t=3321 . But when I add "mGUIManager->injectKeyDown(arg)" to my code, I find this function returns false, and CEGUI cannot handle the key input. I don't why. The code goes as follow:
Code: Select all
bool GameApp::keyPressed( const OIS::KeyEvent &arg )
{
if(mGUIManager->injectKeyDown(arg))
Ogre::LogManager::getSingleton().logMessage("[GameApp]injectKeyDown to CEGUI OK.");
return mStateManager->keyPressed(arg);
}
and injectKeyDown(arg) is defined as
Code: Select all
inline bool injectKeyDown(OIS::KeyEvent arg)
{
return (mpGUISystem->injectKeyDown(arg.key) && mpGUISystem->injectChar(arg.text));
}
Strangely, all of injectMouseButtonDown(), injectMouseButtonUp() and injectMouseMove() return true, and I can use the mouse in CEGUI.
Any help will be appreciated.