rendered paste bodybool MythUITextEdit::keyPressEvent(QKeyEvent *e)
{
QStringList actions;
bool handled = false;
GetMythMainWindow()->TranslateKeyPress("Global", e, actions);
for (int i = 0; i < actions.size() && !handled; i++)
{
QString action = actions[i];
handled = true;
if (action == "SELECT")
{
emit Finished();
}
else if (action == "LEFT")
{
MoveCursor(MoveLeft);
}
else if (action == "RIGHT")
{
MoveCursor(MoveRight);
}
else if (action == "BACKSPACE" || action == "DELETE")
{
RemoveCharacter();
}
else
handled = false;
}
const QChar *character = e->text().unicode();
if (!handled && (character->isLetterOrNumber() || character->isPunct()
|| character->isSpace() || character->isSymbol()))
{
InsertCharacter(e->text());
handled = true;
}
return handled;
}