Skip to content

Commit

Permalink
Merge "Return and tab events generating wrong QKeyEvent text"
Browse files Browse the repository at this point in the history
  • Loading branch information
Roger Stringer authored and Gerrit Code Review committed Mar 4, 2013
2 parents 0843fd7 + 15af482 commit 034f3cc
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion Src/ime/SysmgrIMEDataInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,21 @@ void SysmgrIMEModel::sendKeyEvent(QEvent::Type type, Qt::Key key, Qt::KeyboardMo
{
QWidget* focusedWidget = QApplication::focusWidget();
if (focusedWidget && (type == QEvent::KeyPress || type == QEvent::KeyRelease)) {
QChar qchar(key);
QChar qchar;
switch(key) {
case Qt::Key_Return:
case Qt::Key_Enter:
qchar = '\r';
break;
case Qt::Key_Tab:
qchar = '\t';
break;
case Qt::Key_Backspace:
qchar = '\b';
break;
default:
qchar = QChar(key);
}

// only lower case A to Z. Other keys are unicode characters with proper casing already...
if (key >= Qt::Key_A && key <= Qt::Key_Z && !(modifiers & Qt::ShiftModifier))
Expand Down

0 comments on commit 034f3cc

Please sign in to comment.