diff options
author | Jarkko Koivikko <jarkko.koivikko@code-q.fi> | 2014-04-24 14:45:52 +0300 |
---|---|---|
committer | Jarkko Koivikko <jarkko.koivikko@code-q.fi> | 2014-05-06 15:48:18 +0300 |
commit | 0e0453e41f2d1e315d00b0b9300359efa45fa895 (patch) | |
tree | 32cba7a6bffeb03438cc52de1a9a1617d993fa2a /src/virtualkeyboard/hunspellinputmethod.cpp | |
parent | 945669c989c8204745b30c1ee6d3a10513ff2a70 (diff) |
Fix handling of multi letter input in Hunspell
For example, in the German alphabet the "sharp s" may be transcribed as
"ss". Previously entering this character sequence ended the word
composition.
Also, the other multi letter sequences, such as smileys, are now
separated from the composed word with a space.
Change-Id: Id69db2368f6d7b040d09a0f263d91eef4a5691bd
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
Diffstat (limited to 'src/virtualkeyboard/hunspellinputmethod.cpp')
-rw-r--r-- | src/virtualkeyboard/hunspellinputmethod.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/virtualkeyboard/hunspellinputmethod.cpp b/src/virtualkeyboard/hunspellinputmethod.cpp index 2669367f..7af2874e 100644 --- a/src/virtualkeyboard/hunspellinputmethod.cpp +++ b/src/virtualkeyboard/hunspellinputmethod.cpp @@ -208,7 +208,7 @@ bool HunspellInputMethod::keyEvent(Qt::Key key, const QString &text, Qt::Keyboar } break; default: - if (text.length() == 1) { + if (text.length() > 0) { QChar c = text.at(0); bool addToWord = !c.isPunct() && !c.isSymbol(); if (!addToWord) { @@ -225,13 +225,16 @@ bool HunspellInputMethod::keyEvent(Qt::Key key, const QString &text, Qt::Keyboar emit selectionListActiveItemChanged(DeclarativeSelectionListModel::WordCandidateList, d->activeWordIndex); } accept = true; + } else if (text.length() > 1) { + bool addSpace = !d->word.isEmpty(); + update(); + if (addSpace) + inputContext()->commit(" "); + inputContext()->commit(text); + accept = true; } else { update(); } - } else if (text.length() > 1) { - update(); - inputContext()->commit(text); - accept = true; } break; } |