I'm using Ogre input with CEGUI and have created a statictext window to use as my debug/input window. It scrolls down from the top.
My problem is: how do i input the char for the key i pressed through the function that is called by the event? As it is now, i simply get the char from KeyEvent and do a statictext->settext.
i've been trying all kinds of functions but cant get the input to display. The function called by the event is called so it gets that far but is statictext missing the functionality for adding characters automaticaly or am i missing something?
Been at this for many hours now and need some help getting my facts straight.
heres my code anyway:
Code: Select all
// Get pointer to debug window
mTextWindow = (CEGUI::StaticText*)CEGUI::WindowManager::getSingleton().getWindow( (CEGUI::utf8*)"text" );
// Subscribe to event
mTextWindow->subscribeEvent( CEGUI::StaticText::EventKeyDown, CEGUI::Event::Subscriber( &PlayState::setDebugKey, this ) );
This is what i'm doing now
Code: Select all
// Check if debug window is down
if( !mDebugUp && mTextWindow->getPosition().d_y >= 0.0 )
{
CEGUI::String mystr;
mystr += e->getKeyChar();
// Simple setText() function
setDebugText( mystr, false );
mTextWindow->activate();
mGUISystem->injectKeyDown( e->getKey() );
mGUISystem->injectChar( e->getKeyChar() );
e->consume();
}
BTW, I'm having serious problems accessing all CEGUI homepages. The rest of the web is no prob, just CEGUI. Thought you'd like to know.