Code: Select all
bool PlayState::keyPressed(const OIS::KeyEvent& arg)
{
CEGUI::System& sys = CEGUI::System::getSingleton();
sys.injectKeyDown(arg.key);
sys.injectChar(arg.text);
When I press Enter, I activate and show an editbox.
Code: Select all
case OIS::KC_RETURN:
{
CEGUI::Window* chatBox = mCEGUIWinMgr->getWindow("/ChatBox/Text");
if (chatBox->isActive())
{
chatBox->hide();
chatBox->deactivate();
}
else
{
chatBox->show();
chatBox->activate();
}
}
Everything works fine except that I want to make the backspace unbuffered so that you don't have to press it multiple times to remove text.
How do you recommend doing so? Should I just make a case where; when the editbox is activated, I inject backspace as unbuffered?