diff options
author | Oswald Buddenhagen <oswald.buddenhagen@gmx.de> | 2018-08-20 21:49:41 +0200 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@gmx.de> | 2018-08-20 21:49:41 +0200 |
commit | f51ed61cb1c3a3084cd9bfb42e4560fe8e6e4b2b (patch) | |
tree | 61feefa8691fe6f4d20c9d8fea5cc8837a84d8ce | |
parent | 3ce75f4d72dee45a9d5fb2a01ee2b4c081bf8879 (diff) | |
parent | b7ffccdf7288e6e718925846e0dbc01f95c37ec9 (diff) |
Merge dev into 5.12
Change-Id: Icd06b0b0d7a4148fed32ccc63d3bc1627239fd6b
296 files changed, 7090 insertions, 8258 deletions
diff --git a/src/config.pri b/src/config.pri index ce4245e2..81e05763 100644 --- a/src/config.pri +++ b/src/config.pri @@ -1,8 +1,16 @@ # Enable handwriting -handwriting:!lipi-toolkit:!t9write { - include(plugins/t9write/3rdparty/t9write/t9write-build.pri) - equals(T9WRITE_FOUND, 1): CONFIG += t9write - else: CONFIG += lipi-toolkit +handwriting:!lipi-toolkit:!t9write:!myscript { + include(plugins/myscript/3rdparty/myscript/myscript.pri) + equals(MYSCRIPT_FOUND, 1) { + CONFIG += myscript + } else { + include(plugins/t9write/3rdparty/t9write/t9write-build.pri) + equals(T9WRITE_FOUND, 1): CONFIG += t9write + else: CONFIG += lipi-toolkit + } +} +myscript { + !handwriting: include(plugins/myscript/3rdparty/myscript/myscript.pri) } t9write { !handwriting: include(plugins/t9write/3rdparty/t9write/t9write-build.pri) @@ -32,6 +40,7 @@ disable-layouts { hangul: CONFIG += lang-ko_KR pinyin: CONFIG += lang-zh_CN tcime|zhuyin|cangjie: CONFIG += lang-zh_TW + thai: CONFIG += lang-th_TH # Use all languages by default !contains(CONFIG, lang-.*): CONFIG += lang-all @@ -45,26 +54,38 @@ disable-layouts { lang-de_DE \ lang-el_GR \ lang-en_GB \ + lang-en_US \ lang-es_ES \ + lang-es_MX \ lang-et_EE \ lang-fa_FA \ lang-fi_FI \ + lang-fr_CA \ lang-fr_FR \ lang-he_IL \ lang-hi_IN \ lang-hr_HR \ lang-hu_HU \ + lang-id_ID \ lang-it_IT \ lang-ja_JP \ lang-ko_KR \ + lang-ms_MY \ lang-nb_NO \ lang-nl_NL \ lang-pl_PL \ + lang-pt_BR \ lang-pt_PT \ lang-ro_RO \ lang-ru_RU \ + lang-sk_SK \ + lang-sl_SI \ + lang-sq_AL \ lang-sr_SP \ lang-sv_SE \ + lang-th_TH \ + lang-tr_TR \ + lang-uk_UA \ lang-vi_VN \ lang-zh_CN \ lang-zh_TW @@ -80,6 +101,7 @@ contains(CONFIG, lang-ja.*)|lang-all: CONFIG += openwnn contains(CONFIG, lang-ko.*)|lang-all: CONFIG += hangul contains(CONFIG, lang-zh(_CN)?)|lang-all: CONFIG += pinyin contains(CONFIG, lang-zh(_TW)?)|lang-all: CONFIG += tcime +contains(CONFIG, lang-th.*)|lang-all: CONFIG += thai # Feature dependencies tcime { diff --git a/src/import/import.pro b/src/import/import.pro index d76bb91e..719ad518 100644 --- a/src/import/import.pro +++ b/src/import/import.pro @@ -7,6 +7,6 @@ load(qml_module) !cross_compile:if(build_pass|!debug_and_release) { qtPrepareTool(QMLPLUGINDUMP, qmlplugindump) - qmltypes.commands = QT_IM_MODULE=qtvirtualkeyboard $$QMLPLUGINDUMP -defaultplatform -nonrelocatable QtQuick.VirtualKeyboard 2.3 > $$PWD/plugins.qmltypes + qmltypes.commands = QT_IM_MODULE=qtvirtualkeyboard $$QMLPLUGINDUMP -defaultplatform -nonrelocatable QtQuick.VirtualKeyboard 2.4 > $$PWD/plugins.qmltypes QMAKE_EXTRA_TARGETS += qmltypes } diff --git a/src/plugin/plugin.cpp b/src/plugin/plugin.cpp index 46b1bf04..956bafbd 100644 --- a/src/plugin/plugin.cpp +++ b/src/plugin/plugin.cpp @@ -124,6 +124,7 @@ QPlatformInputContext *QVirtualKeyboardPlugin::create(const QString &system, con qmlRegisterType<EnterKeyAction>(pluginUri, 2, 0, "EnterKeyAction"); qRegisterMetaType<Trace *>("Trace*"); qmlRegisterType<Trace>(pluginUri, 2, 0, "Trace"); + qmlRegisterType<Trace>(pluginUri, 2, 4, "Trace"); qRegisterMetaType<ShadowInputContext *>("ShadowInputContext*"); qmlRegisterUncreatableType<ShadowInputContext>(pluginUri, 2, 2, "ShadowInputContext", QLatin1String("Cannot create shadow input context")); qmlRegisterSingletonType<VirtualKeyboardSettings>(pluginSettingsUri, 1, 0, "VirtualKeyboardSettings", VirtualKeyboardSettings::registerSettingsModule); @@ -142,6 +143,7 @@ QPlatformInputContext *QVirtualKeyboardPlugin::create(const QString &system, con qmlRegisterType(QUrl(path + QLatin1String("InputPanel.qml")), pluginUri, 2, 1, "InputPanel"); qmlRegisterType(QUrl(path + QLatin1String("InputPanel.qml")), pluginUri, 2, 2, "InputPanel"); qmlRegisterType(QUrl(path + QLatin1String("InputPanel.qml")), pluginUri, 2, 3, "InputPanel"); + qmlRegisterType(QUrl(path + QLatin1String("InputPanel.qml")), pluginUri, 2, 4, "InputPanel"); qmlRegisterType(QUrl(path + QLatin1String("HandwritingInputPanel.qml")), pluginUri, 2, 0, "HandwritingInputPanel"); const QString componentsPath = path + QStringLiteral("components/"); qmlRegisterType(QUrl(componentsPath + QLatin1String("AlternativeKeys.qml")), pluginUri, 1, 0, "AlternativeKeys"); @@ -189,7 +191,7 @@ QPlatformInputContext *QVirtualKeyboardPlugin::create(const QString &system, con qmlRegisterType(QUrl(componentsPath + QLatin1String("TraceInputArea.qml")), pluginUri, 2, 0, "TraceInputArea"); qmlRegisterType(QUrl(componentsPath + QLatin1String("TraceInputKey.qml")), pluginUri, 2, 0, "TraceInputKey"); qmlRegisterType(QUrl(componentsPath + QLatin1String("WordCandidatePopupList.qml")), pluginUri, 2, 0, "WordCandidatePopupList"); - qmlRegisterType(QUrl(componentsPath + QLatin1String("LanguagePopupList.qml")), pluginUri, 2, 1, "LanguagePopupList"); + qmlRegisterType(QUrl(componentsPath + QLatin1String("PopupList.qml")), pluginUri, 2, 3, "PopupList"); qmlRegisterType(QUrl(componentsPath + QLatin1String("SelectionControl.qml")), pluginUri, 2, 1, "SelectionControl"); qmlRegisterType(QUrl(componentsPath + QLatin1String("InputModeKey.qml")), pluginUri, 2, 3, "InputModeKey"); diff --git a/src/plugins/hangul/hangul.pro b/src/plugins/hangul/hangul.pro index a0dfea0d..d6d5a811 100644 --- a/src/plugins/hangul/hangul.pro +++ b/src/plugins/hangul/hangul.pro @@ -15,9 +15,15 @@ OTHER_FILES += \ include(../../config.pri) LAYOUT_FILES += \ + $$LAYOUTS_BASE/content/layouts/ko_KR/dialpad.fallback \ + $$LAYOUTS_BASE/content/layouts/ko_KR/digits.fallback \ $$LAYOUTS_BASE/content/layouts/ko_KR/main.qml \ + $$LAYOUTS_BASE/content/layouts/ko_KR/numbers.fallback \ $$LAYOUTS_BASE/content/layouts/ko_KR/symbols.qml +OTHER_FILES += \ + $$LAYOUT_FILES + layouts.files = $$LAYOUT_FILES layouts.base = $$LAYOUTS_BASE layouts.prefix = $$LAYOUTS_PREFIX diff --git a/src/plugins/hunspell/hunspellinputmethod/hunspellinputmethod.cpp b/src/plugins/hunspell/hunspellinputmethod/hunspellinputmethod.cpp index d437f8fe..ee8d31e3 100644 --- a/src/plugins/hunspell/hunspellinputmethod/hunspellinputmethod.cpp +++ b/src/plugins/hunspell/hunspellinputmethod/hunspellinputmethod.cpp @@ -108,16 +108,24 @@ bool HunspellInputMethod::keyEvent(Qt::Key key, const QString &text, Qt::Keyboar update(); break; case Qt::Key_Backspace: - if (!d->word.isEmpty()) { - d->word.remove(d->word.length() - 1, 1); - ic->setPreeditText(d->word); - if (d->updateSuggestions()) { - emit selectionListChanged(SelectionListModel::WordCandidateList); - emit selectionListActiveItemChanged(SelectionListModel::WordCandidateList, d->activeWordIndex); + { + QString word = d->wordCandidates.wordAt(0); + if (!word.isEmpty()) { + word.remove(word.length() - 1, 1); + ic->setPreeditText(word); + if (!word.isEmpty()) { + d->wordCandidates.updateWord(0, word); + if (d->updateSuggestions()) { + emit selectionListChanged(SelectionListModel::WordCandidateList); + emit selectionListActiveItemChanged(SelectionListModel::WordCandidateList, d->wordCandidates.index()); + } + } else { + d->reset(); } accept = true; } break; + } default: if (inputMethodHints.testFlag(Qt::ImhNoPredictiveText)) break; @@ -127,10 +135,11 @@ bool HunspellInputMethod::keyEvent(Qt::Key key, const QString &text, Qt::Keyboar } if (text.length() > 0) { QChar c = text.at(0); - bool addToWord = d->isValidInputChar(c) && (!d->word.isEmpty() || !d->isJoiner(c)); + QString word = d->wordCandidates.wordAt(0); + bool addToWord = d->isValidInputChar(c) && (!word.isEmpty() || !d->isJoiner(c)); if (addToWord) { /* Automatic space insertion. */ - if (d->word.isEmpty()) { + if (word.isEmpty()) { QString surroundingText = ic->surroundingText(); int cursorPosition = ic->cursorPosition(); /* Rules for automatic space insertion: @@ -144,7 +153,7 @@ bool HunspellInputMethod::keyEvent(Qt::Key key, const QString &text, Qt::Keyboar if (!lastChar.isSpace() && lastChar != Qt::Key_Minus && d->isAutoSpaceAllowed()) { - ic->commit(" "); + ic->commit(QLatin1String(" ")); } } } @@ -152,21 +161,22 @@ bool HunspellInputMethod::keyEvent(Qt::Key key, const QString &text, Qt::Keyboar pre-edit text. The update is triggered if the text editor has a selection which the pre-edit text will replace. */ - d->ignoreUpdate = d->word.isEmpty(); - d->word.append(text); - ic->setPreeditText(d->word); + d->ignoreUpdate = word.isEmpty(); + word.append(text); + d->wordCandidates.updateWord(0, word); + ic->setPreeditText(word); d->ignoreUpdate = false; if (d->updateSuggestions()) { emit selectionListChanged(SelectionListModel::WordCandidateList); - emit selectionListActiveItemChanged(SelectionListModel::WordCandidateList, d->activeWordIndex); + emit selectionListActiveItemChanged(SelectionListModel::WordCandidateList, d->wordCandidates.index()); } accept = true; } else if (text.length() > 1) { - bool addSpace = !d->word.isEmpty() || d->autoSpaceAllowed; + bool addSpace = !word.isEmpty() || d->autoSpaceAllowed; update(); d->autoSpaceAllowed = true; if (addSpace && d->isAutoSpaceAllowed()) - ic->commit(" "); + ic->commit(QLatin1String(" ")); ic->commit(text); d->autoSpaceAllowed = addSpace; accept = true; @@ -185,7 +195,10 @@ bool HunspellInputMethod::keyEvent(Qt::Key key, const QString &text, Qt::Keyboar QList<SelectionListModel::Type> HunspellInputMethod::selectionLists() { Q_D(const HunspellInputMethod); - Qt::InputMethodHints inputMethodHints = inputContext()->inputMethodHints(); + InputContext *ic = inputContext(); + if (!ic) + return QList<SelectionListModel::Type>(); + Qt::InputMethodHints inputMethodHints = ic->inputMethodHints(); if (d->dictionaryState == HunspellInputMethodPrivate::DictionaryNotLoaded || inputMethodHints.testFlag(Qt::ImhNoPredictiveText) || inputMethodHints.testFlag(Qt::ImhHiddenText)) return QList<SelectionListModel::Type>(); return QList<SelectionListModel::Type>() << SelectionListModel::WordCandidateList; @@ -195,7 +208,7 @@ int HunspellInputMethod::selectionListItemCount(SelectionListModel::Type type) { Q_UNUSED(type) Q_D(HunspellInputMethod); - return d->wordCandidates.count(); + return d->wordCandidates.size(); } QVariant HunspellInputMethod::selectionListData(SelectionListModel::Type type, int index, int role) @@ -204,15 +217,28 @@ QVariant HunspellInputMethod::selectionListData(SelectionListModel::Type type, i Q_D(HunspellInputMethod); switch (role) { case SelectionListModel::DisplayRole: - result = QVariant(d->wordCandidates.at(index)); + result = QVariant(d->wordCandidates.wordAt(index)); break; case SelectionListModel::WordCompletionLengthRole: { - const QString wordCandidate(d->wordCandidates.at(index)); - int wordCompletionLength = wordCandidate.length() - d->word.length(); - result.setValue((wordCompletionLength > 0 && wordCandidate.startsWith(d->word)) ? wordCompletionLength : 0); + const QString wordCandidate(d->wordCandidates.wordAt(index)); + const QString word(d->wordCandidates.wordAt(0)); + int wordCompletionLength = wordCandidate.length() - word.length(); + result.setValue((wordCompletionLength > 0 && wordCandidate.startsWith(word)) ? wordCompletionLength : 0); break; } + case SelectionListModel::DictionaryTypeRole: + { + const QString wordCandidate(d->wordCandidates.wordAt(index)); + SelectionListModel::DictionaryType dictionaryType = + d->userDictionaryWords && d->userDictionaryWords->contains(wordCandidate) ? + SelectionListModel::UserDictionary : SelectionListModel::DefaultDictionary; + result = QVariant(static_cast<int>(dictionaryType)); + break; + } + case SelectionListModel::CanRemoveSuggestionRole: + result.setValue(index > 0 && d->wordCandidates.wordFlagsAt(index).testFlag(HunspellWordList::SpellCheckOk)); + break; default: result = AbstractInputMethod::selectionListData(type, index, role); break; @@ -224,16 +250,33 @@ void HunspellInputMethod::selectionListItemSelected(SelectionListModel::Type typ { Q_UNUSED(type) Q_D(HunspellInputMethod); - QString finalWord = d->wordCandidates.at(index); + d->wordCandidates.setIndex(index); + d->addToDictionary(); + QString finalWord = d->wordCandidates.wordAt(index); reset(); inputContext()->commit(finalWord); d->autoSpaceAllowed = true; } +bool HunspellInputMethod::selectionListRemoveItem(SelectionListModel::Type type, int index) +{ + Q_D(HunspellInputMethod); + Q_UNUSED(type) + + if (index <= 0 || index >= d->wordCandidates.size()) + return false; + + QString word = d->wordCandidates.wordAt(index); + d->removeFromDictionary(word); + + return true; +} + bool HunspellInputMethod::reselect(int cursorPosition, const InputEngine::ReselectFlags &reselectFlags) { Q_D(HunspellInputMethod); - Q_ASSERT(d->word.isEmpty()); + QString word(d->wordCandidates.wordAt(0)); + Q_ASSERT(word.isEmpty()); if (d->dictionaryState == HunspellInputMethodPrivate::DictionaryNotLoaded) return false; @@ -250,61 +293,54 @@ bool HunspellInputMethod::reselect(int cursorPosition, const InputEngine::Resele QChar c = surroundingText.at(i); if (!d->isValidInputChar(c)) break; - d->word.insert(0, c); + word.insert(0, c); --replaceFrom; } - while (replaceFrom < 0 && d->isJoiner(d->word.at(0))) { - d->word.remove(0, 1); + while (replaceFrom < 0 && d->isJoiner(word.at(0))) { + word.remove(0, 1); ++replaceFrom; } } - if (reselectFlags.testFlag(InputEngine::WordAtCursor) && replaceFrom == 0) { - d->word.clear(); + if (reselectFlags.testFlag(InputEngine::WordAtCursor) && replaceFrom == 0) return false; - } if (reselectFlags.testFlag(InputEngine::WordAfterCursor)) { for (int i = cursorPosition; i < surroundingText.length(); ++i) { QChar c = surroundingText.at(i); if (!d->isValidInputChar(c)) break; - d->word.append(c); + word.append(c); } - while (replaceFrom > -d->word.length()) { - int lastPos = d->word.length() - 1; - if (!d->isJoiner(d->word.at(lastPos))) + while (replaceFrom > -word.length()) { + int lastPos = word.length() - 1; + if (!d->isJoiner(word.at(lastPos))) break; - d->word.remove(lastPos, 1); + word.remove(lastPos, 1); } } - if (d->word.isEmpty()) + if (word.isEmpty()) return false; - if (reselectFlags.testFlag(InputEngine::WordAtCursor) && replaceFrom == -d->word.length()) { - d->word.clear(); + if (reselectFlags.testFlag(InputEngine::WordAtCursor) && replaceFrom == -word.length()) return false; - } - if (d->isJoiner(d->word.at(0))) { - d->word.clear(); + if (d->isJoiner(word.at(0))) return false; - } - if (d->isJoiner(d->word.at(d->word.length() - 1))) { - d->word.clear(); + if (d->isJoiner(word.at(word.length() - 1))) return false; - } - ic->setPreeditText(d->word, QList<QInputMethodEvent::Attribute>(), replaceFrom, d->word.length()); + d->wordCandidates.updateWord(0, word); + ic->setPreeditText(word, QList<QInputMethodEvent::Attribute>(), replaceFrom, word.length()); d->autoSpaceAllowed = false; if (d->updateSuggestions()) { emit selectionListChanged(SelectionListModel::WordCandidateList); - emit selectionListActiveItemChanged(SelectionListModel::WordCandidateList, d->activeWordIndex); + emit selectionListActiveItemChanged(SelectionListModel::WordCandidateList, d->wordCandidates.index()); } return true; @@ -321,37 +357,50 @@ void HunspellInputMethod::update() Q_D(HunspellInputMethod); if (d->ignoreUpdate) return; - if (!d->word.isEmpty()) { - QString finalWord = d->hasSuggestions() ? d->wordCandidates.at(d->activeWordIndex) : d->word; - d->reset(); - inputContext()->commit(finalWord); + + QString finalWord; + if (!d->wordCandidates.isEmpty()) { + d->addToDictionary(); + finalWord = d->wordCandidates.wordAt(d->wordCandidates.index()); } + d->reset(); + inputContext()->commit(finalWord); d->autoSpaceAllowed = false; } -void HunspellInputMethod::updateSuggestions(const QStringList &wordList, int activeWordIndex) +void HunspellInputMethod::updateSuggestions(const QSharedPointer<HunspellWordList> &wordList, int tag) { Q_D(HunspellInputMethod); if (d->dictionaryState == HunspellInputMethodPrivate::DictionaryNotLoaded) { + qCDebug(lcHunspell) << "updateSuggestions: skip (dictionary not loaded)"; update(); return; } - d->wordCandidates.clear(); - d->wordCandidates.append(wordList); - // Make sure the exact match is up-to-date - if (!d->word.isEmpty() && !d->wordCandidates.isEmpty() && d->wordCandidates.at(0) != d->word) - d->wordCandidates.replace(0, d->word); - d->activeWordIndex = activeWordIndex; + if (d->wordCandidatesUpdateTag != tag) { + qCDebug(lcHunspell) << "updateSuggestions: skip tag" << tag << "current" << d->wordCandidatesUpdateTag; + return; + } + QString word(d->wordCandidates.wordAt(0)); + d->wordCandidates = *wordList; + if (d->wordCandidates.wordAt(0).compare(word) != 0) + d->wordCandidates.updateWord(0, word); emit selectionListChanged(SelectionListModel::WordCandidateList); - emit selectionListActiveItemChanged(SelectionListModel::WordCandidateList, d->activeWordIndex); + emit selectionListActiveItemChanged(SelectionListModel::WordCandidateList, d->wordCandidates.index()); } void HunspellInputMethod::dictionaryLoadCompleted(bool success) { Q_D(HunspellInputMethod); + InputContext *ic = inputContext(); + if (!ic) + return; + + QList<SelectionListModel::Type> oldSelectionLists = selectionLists(); d->dictionaryState = success ? HunspellInputMethodPrivate::DictionaryReady : HunspellInputMethodPrivate::DictionaryNotLoaded; - emit selectionListsChanged(); + QList<SelectionListModel::Type> newSelectionLists = selectionLists(); + if (oldSelectionLists != newSelectionLists) + emit selectionListsChanged(); } } // namespace QtVirtualKeyboard diff --git a/src/plugins/hunspell/hunspellinputmethod/hunspellinputmethod_p.cpp b/src/plugins/hunspell/hunspellinputmethod/hunspellinputmethod_p.cpp index 0120815a..2027a987 100644 --- a/src/plugins/hunspell/hunspellinputmethod/hunspellinputmethod_p.cpp +++ b/src/plugins/hunspell/hunspellinputmethod/hunspellinputmethod_p.cpp @@ -34,10 +34,13 @@ #include <QDir> #include <QTextCodec> #include <QtCore/QLibraryInfo> +#include <QStandardPaths> QT_BEGIN_NAMESPACE namespace QtVirtualKeyboard { +const int HunspellInputMethodPrivate::userDictionaryMaxSize = 100; + /*! \class QtVirtualKeyboard::HunspellInputMethodPrivate \internal @@ -47,13 +50,13 @@ HunspellInputMethodPrivate::HunspellInputMethodPrivate(HunspellInputMethod *q_pt q_ptr(q_ptr), hunspellWorker(new HunspellWorker()), locale(), - word(), - wordCandidates(), - activeWordIndex(-1), wordCompletionPoint(2), ignoreUpdate(false), autoSpaceAllowed(false), - dictionaryState(DictionaryNotLoaded) + dictionaryState(DictionaryNotLoaded), + userDictionaryWords(new HunspellWordList(userDictionaryMaxSize)), + blacklistedWords(new HunspellWordList(userDictionaryMaxSize)), + wordCandidatesUpdateTag(0) { if (hunspellWorker) hunspellWorker->start(); @@ -69,7 +72,8 @@ bool HunspellInputMethodPrivate::createHunspell(const QString &locale) if (!hunspellWorker) return false; if (this->locale != locale) { - hunspellWorker->removeAllTasks(); + clearSuggestionsRelatedTasks(); + hunspellWorker->waitForAllTasks(); QString hunspellDataPath(qEnvironmentVariable("QT_VIRTUALKEYBOARD_HUNSPELL_DATA_PATH")); const QString pathListSep( #if defined(Q_OS_WIN32) @@ -96,55 +100,65 @@ bool HunspellInputMethodPrivate::createHunspell(const QString &locale) emit q->selectionListsChanged(); hunspellWorker->addTask(loadDictionaryTask); this->locale = locale; + + loadCustomDictionary(userDictionaryWords, QLatin1String("userdictionary")); + addToHunspell(userDictionaryWords); + loadCustomDictionary(blacklistedWords, QLatin1String("blacklist")); + removeFromHunspell(blacklistedWords); } return true; } void HunspellInputMethodPrivate::reset() { - if (clearSuggestions()) { + if (clearSuggestions(true)) { Q_Q(HunspellInputMethod); emit q->selectionListChanged(SelectionListModel::WordCandidateList); - emit q->selectionListActiveItemChanged(SelectionListModel::WordCandidateList, activeWordIndex); + emit q->selectionListActiveItemChanged(SelectionListModel::WordCandidateList, wordCandidates.index()); } - word.clear(); autoSpaceAllowed = false; } bool HunspellInputMethodPrivate::updateSuggestions() { bool wordCandidateListChanged = false; + QString word = wordCandidates.wordAt(0); if (!word.isEmpty() && dictionaryState != HunspellInputMethodPrivate::DictionaryNotLoaded) { - if (hunspellWorker) - hunspellWorker->removeAllTasksExcept<HunspellLoadDictionaryTask>(); - if (wordCandidates.isEmpty()) { - wordCandidates.append(word); - activeWordIndex = 0; - wordCandidateListChanged = true; - } else if (wordCandidates.at(0) != word) { - wordCandidates.replace(0, word); - activeWordIndex = 0; - wordCandidateListChanged = true; - } + wordCandidateListChanged = true; if (word.length() >= wordCompletionPoint) { if (hunspellWorker) { - QSharedPointer<HunspellWordList> wordList(new HunspellWordList()); + QSharedPointer<HunspellWordList> wordList(new HunspellWordList(wordCandidates)); + + // Clear obsolete tasks from the worker queue + clearSuggestionsRelatedTasks(); + + // Build suggestions QSharedPointer<HunspellBuildSuggestionsTask> buildSuggestionsTask(new HunspellBuildSuggestionsTask()); - buildSuggestionsTask->word = word; buildSuggestionsTask->wordList = wordList; buildSuggestionsTask->autoCorrect = false; hunspellWorker->addTask(buildSuggestionsTask); + + // Filter out blacklisted word (sometimes Hunspell suggests, + // e.g. with different text case) + QSharedPointer<HunspellFilterWordTask> filterWordTask(new HunspellFilterWordTask()); + filterWordTask->wordList = wordList; + filterWordTask->filterList = blacklistedWords; + hunspellWorker->addTask(filterWordTask); + + // Boost words from user dictionary + QSharedPointer<HunspellBoostWordTask> boostWordTask(new HunspellBoostWordTask()); + boostWordTask->wordList = wordList; + boostWordTask->boostList = userDictionaryWords; + hunspellWorker->addTask(boostWordTask); + + // Update word candidate list QSharedPointer<HunspellUpdateSuggestionsTask> updateSuggestionsTask(new HunspellUpdateSuggestionsTask()); updateSuggestionsTask->wordList = wordList; + updateSuggestionsTask->tag = ++wordCandidatesUpdateTag; Q_Q(HunspellInputMethod); - q->connect(updateSuggestionsTask.data(), SIGNAL(updateSuggestions(QStringList, int)), SLOT(updateSuggestions(QStringList, int))); + QObject::connect(updateSuggestionsTask.data(), &HunspellUpdateSuggestionsTask::updateSuggestions, q, &HunspellInputMethod::updateSuggestions); hunspellWorker->addTask(updateSuggestionsTask); } - } else if (wordCandidates.length() > 1) { - wordCandidates.clear(); - wordCandidates.append(word); - activeWordIndex = 0; - wordCandidateListChanged = true; } } else { wordCandidateListChanged = clearSuggestions(); @@ -152,20 +166,20 @@ bool HunspellInputMethodPrivate::updateSuggestions() return wordCandidateListChanged; } -bool HunspellInputMethodPrivate::clearSuggestions() +bool HunspellInputMethodPrivate::clearSuggestions(bool clearInputWord) { - if (hunspellWorker) - hunspellWorker->removeAllTasksExcept<HunspellLoadDictionaryTask>(); - if (wordCandidates.isEmpty()) - return false; - wordCandidates.clear(); - activeWordIndex = -1; - return true; + clearSuggestionsRelatedTasks(); + return clearInputWord ? wordCandidates.clear() : wordCandidates.clearSuggestions(); } -bool HunspellInputMethodPrivate::hasSuggestions() const +void HunspellInputMethodPrivate::clearSuggestionsRelatedTasks() { - return !wordCandidates.isEmpty(); + if (hunspellWorker) { + hunspellWorker->removeAllTasksOfType<HunspellBuildSuggestionsTask>(); + hunspellWorker->removeAllTasksOfType<HunspellFilterWordTask>(); + hunspellWorker->removeAllTasksOfType<HunspellBoostWordTask>(); + hunspellWorker->removeAllTasksOfType<HunspellUpdateSuggestionsTask>(); + } } bool HunspellInputMethodPrivate::isAutoSpaceAllowed() const @@ -189,6 +203,8 @@ bool HunspellInputMethodPrivate::isValidInputChar(const QChar &c) const return true; if (isJoiner(c)) return true; + if (c.isMark()) + return true; return false; } @@ -209,5 +225,114 @@ bool HunspellInputMethodPrivate::isJoiner(const QChar &c) const return false; } +QString HunspellInputMethodPrivate::customDictionaryLocation(const QString &dictionaryType) const +{ + if (dictionaryType.isEmpty() || locale.isEmpty()) + return QString(); + + QString location = QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation); + if (location.isEmpty()) + return QString(); + + return QStringLiteral("%1/qtvirtualkeyboard/hunspell/%2-%3.txt") + .arg(location) + .arg(dictionaryType) + .arg(locale); +} + +void HunspellInputMethodPrivate::loadCustomDictionary(const QSharedPointer<HunspellWordList> &wordList, + const QString &dictionaryType) const +{ + QSharedPointer<HunspellLoadWordListTask> loadWordsTask(new HunspellLoadWordListTask()); + loadWordsTask->filePath = customDictionaryLocation(dictionaryType); + loadWordsTask->wordList = wordList; + hunspellWorker->addTask(loadWordsTask); +} + +void HunspellInputMethodPrivate::saveCustomDictionary(const QSharedPointer<HunspellWordList> &wordList, + const QString &dictionaryType) const +{ + QSharedPointer<HunspellSaveWordListTask> saveWordsTask(new HunspellSaveWordListTask()); + saveWordsTask->filePath = customDictionaryLocation(dictionaryType); + saveWordsTask->wordList = wordList; + hunspellWorker->addTask(saveWordsTask); +} + +void HunspellInputMethodPrivate::addToHunspell(const QSharedPointer<HunspellWordList> &wordList) const +{ + QSharedPointer<HunspellAddWordTask> addWordTask(new HunspellAddWordTask()); + addWordTask->wordList = wordList; + hunspellWorker->addTask(addWordTask); +} + +void HunspellInputMethodPrivate::removeFromHunspell(const QSharedPointer<HunspellWordList> &wordList) const +{ + QSharedPointer<HunspellRemoveWordTask> removeWordTask(new HunspellRemoveWordTask()); + removeWordTask->wordList = wordList; + hunspellWorker->addTask(removeWordTask); +} + +void HunspellInputMethodPrivate::removeFromDictionary(const QString &word) +{ + if (userDictionaryWords->removeWord(word) > 0) { + saveCustomDictionary(userDictionaryWords, QLatin1String("userdictionary")); + } else if (!blacklistedWords->contains(word)) { + blacklistedWords->appendWord(word); + saveCustomDictionary(blacklistedWords, QLatin1String("blacklist")); + } + + QSharedPointer<HunspellWordList> wordList(new HunspellWordList()); + wordList->appendWord(word); + removeFromHunspell(wordList); + + updateSuggestions(); +} + +void HunspellInputMethodPrivate::addToDictionary() +{ + Q_Q(HunspellInputMethod); + // This feature is not allowed when dealing with sensitive information + const Qt::InputMethodHints inputMethodHints(q->inputContext()->inputMethodHints()); + const bool userDictionaryEnabled = + !inputMethodHints.testFlag(Qt::ImhHiddenText) && + !inputMethodHints.testFlag(Qt::ImhSensitiveData); + if (!userDictionaryEnabled) + return; + + if (wordCandidates.isEmpty()) + return; + + QString word; + HunspellWordList::Flags wordFlags; + const int activeWordIndex = wordCandidates.index(); + wordCandidates.wordAt(activeWordIndex, word, wordFlags); + if (activeWordIndex == 0) { + if (blacklistedWords->removeWord(word) > 0) { + saveCustomDictionary(blacklistedWords, QLatin1String("blacklist")); + } else if (word.length() > 1 && !wordFlags.testFlag(HunspellWordList::SpellCheckOk) && !userDictionaryWords->contains(word)) { + userDictionaryWords->appendWord(word); + saveCustomDictionary(userDictionaryWords, QLatin1String("userdictionary")); + } else { + // Avoid adding words to Hunspell which are too short or passed spell check + return; + } + + QSharedPointer<HunspellWordList> wordList(new HunspellWordList()); + wordList->appendWord(word); + addToHunspell(wordList); + } else { + // Check if found in the user dictionary and move as last in the list. + // This way the list is always ordered by use. + // If userDictionaryMaxSize is greater than zero the number of words in the + // list will be limited to that amount. By pushing last used items to end of + // list we can avoid (to certain extent) removing frequently used words. + int userDictionaryIndex = userDictionaryWords->indexOfWord(word); + if (userDictionaryIndex != -1) { + userDictionaryWords->moveWord(userDictionaryIndex, userDictionaryWords->size() - 1); + saveCustomDictionary(userDictionaryWords, QLatin1String("userdictionary")); + } + } +} + } // namespace QtVirtualKeyboard QT_END_NAMESPACE diff --git a/src/plugins/hunspell/hunspellinputmethod/hunspellinputmethod_p.h b/src/plugins/hunspell/hunspellinputmethod/hunspellinputmethod_p.h index 68a4e702..bb9548c0 100644 --- a/src/plugins/hunspell/hunspellinputmethod/hunspellinputmethod_p.h +++ b/src/plugins/hunspell/hunspellinputmethod/hunspellinputmethod_p.h @@ -47,6 +47,7 @@ QT_BEGIN_NAMESPACE namespace QtVirtualKeyboard { class HunspellInputMethodPrivate; +class HunspellWordList; class HunspellInputMethod : public AbstractInputMethod { @@ -68,6 +69,7 @@ public: int selectionListItemCount(SelectionListModel::Type type); QVariant selectionListData(SelectionListModel::Type type, int index, int role); void selectionListItemSelected(SelectionListModel::Type type, int index); + bool selectionListRemoveItem(SelectionListModel::Type type, int index); bool reselect(int cursorPosition, const InputEngine::ReselectFlags &reselectFlags); @@ -75,7 +77,7 @@ public: void update(); protected Q_SLOTS: - void updateSuggestions(const QStringList &wordList, int activeWordIndex); + void updateSuggestions(const QSharedPointer<HunspellWordList> &wordList, int tag); void dictionaryLoadCompleted(bool success); protected: diff --git a/src/plugins/hunspell/hunspellinputmethod/hunspellinputmethod_p_p.h b/src/plugins/hunspell/hunspellinputmethod/hunspellinputmethod_p_p.h index ebf202fd..8bb75f69 100644 --- a/src/plugins/hunspell/hunspellinputmethod/hunspellinputmethod_p_p.h +++ b/src/plugins/hunspell/hunspellinputmethod/hunspellinputmethod_p_p.h @@ -64,22 +64,31 @@ public: bool createHunspell(const QString &locale); void reset(); bool updateSuggestions(); - bool clearSuggestions(); - bool hasSuggestions() const; + bool clearSuggestions(bool clearInputWord = false); + void clearSuggestionsRelatedTasks(); bool isAutoSpaceAllowed() const; bool isValidInputChar(const QChar &c) const; bool isJoiner(const QChar &c) const; + QString customDictionaryLocation(const QString &dictionaryType) const; + void loadCustomDictionary(const QSharedPointer<HunspellWordList> &wordList, const QString &dictionaryType) const; + void saveCustomDictionary(const QSharedPointer<HunspellWordList> &wordList, const QString &dictionaryType) const; + void addToHunspell(const QSharedPointer<HunspellWordList> &wordList) const; + void removeFromHunspell(const QSharedPointer<HunspellWordList> &wordList) const; + void removeFromDictionary(const QString &word); + void addToDictionary(); HunspellInputMethod *q_ptr; QScopedPointer<HunspellWorker> hunspellWorker; QString locale; - QString word; - QStringList wordCandidates; - int activeWordIndex; + HunspellWordList wordCandidates; int wordCompletionPoint; bool ignoreUpdate; bool autoSpaceAllowed; DictionaryState dictionaryState; + QSharedPointer<HunspellWordList> userDictionaryWords; + QSharedPointer<HunspellWordList> blacklistedWords; + int wordCandidatesUpdateTag; + static const int userDictionaryMaxSize; }; } // namespace QtVirtualKeyboard diff --git a/src/plugins/hunspell/hunspellinputmethod/hunspellworker.cpp b/src/plugins/hunspell/hunspellinputmethod/hunspellworker.cpp index 46cbf49c..6387ee16 100644 --- a/src/plugins/hunspell/hunspellinputmethod/hunspellworker.cpp +++ b/src/plugins/hunspell/hunspellinputmethod/hunspellworker.cpp @@ -28,17 +28,308 @@ ****************************************************************************/ #include <QtHunspellInputMethod/private/hunspellworker_p.h> -#include <QLoggingCategory> #include <QVector> #include <QTextCodec> #include <QFileInfo> #include <QRegularExpression> #include <QTime> +#include <QFile> +#include <QDir> +#include <QtAlgorithms> QT_BEGIN_NAMESPACE namespace QtVirtualKeyboard { -Q_DECLARE_LOGGING_CATEGORY(lcHunspell) +HunspellWordList::HunspellWordList(int limit) : + _index(0), + _limit(limit) +{ +} + +HunspellWordList::HunspellWordList(HunspellWordList &other) +{ + *this = other; +} + +HunspellWordList &HunspellWordList::operator=(HunspellWordList &other) +{ + if (this != &other) { + QMutexLocker guard(&_lock); + QMutexLocker otherGuard(&other._lock); + _list = other._list; + _flags = other._flags; + _index = other._index; + _limit = other._limit; + _searchIndex = other._searchIndex; + } + return *this; +} + +int HunspellWordList::index() const +{ + return _index < _list.size() ? _index : -1; +} + +void HunspellWordList::setIndex(int index) +{ + QMutexLocker guard(&_lock); + _index = index; +} + +bool HunspellWordList::clear() +{ + QMutexLocker guard(&_lock); + bool result = !_list.isEmpty(); + _list.clear(); + _flags.clear(); + _index = 0; + _searchIndex.clear(); + return result; +} + +bool HunspellWordList::clearSuggestions() +{ + QMutexLocker guard(&_lock); + if (_list.isEmpty()) + return false; + + _searchIndex.clear(); + if (_list.size() > 1) { + QString word = _list.at(0); + Flags flags = _flags.at(0); + _list.clear(); + _flags.clear(); + if (!word.isEmpty()) { + _index = 0; + _list.append(word); + _flags.append(flags); + } + return true; + } else if (_list.at(0).isEmpty()) { + _list.clear(); + _flags.clear(); + _index = 0; + return true; + } + return false; +} + +bool HunspellWordList::hasSuggestions() const +{ + return _list.size() > 1; +} + +int HunspellWordList::size() const +{ + return _list.size(); +} + +int HunspellWordList::isEmpty() const +{ + return _list.isEmpty() || _list.at(0).isEmpty(); +} + +bool HunspellWordList::contains(const QString &word) +{ + QMutexLocker guard(&_lock); + + // Use index search when the search index is available. + // This provides a lot faster search than QList::contains(). + // Search index is available when it has been rebuilt using + // rebuildSearchIndex() method. Search index is automatically + // cleared when the word list is modified. + if (!_searchIndex.isEmpty()) { + Q_ASSERT(_searchIndex.size() == _list.size()); + + SearchContext searchContext(word, _list); + return std::binary_search(_searchIndex.begin(), _searchIndex.end(), -1, [searchContext](const int &a, const int &b) { + const QString &wordA = (a == -1) ? searchContext.word : searchContext.list[a]; + const QString &wordB = (b == -1) ? searchContext.word : searchContext.list[b]; + return wordA.compare(wordB, Qt::CaseInsensitive) < 0; + }); + } + + return _list.contains(word, Qt::CaseInsensitive); +} + +QString HunspellWordList::findWordCompletion(const QString &word) +{ + QMutexLocker guard(&_lock); + + if (!_searchIndex.isEmpty()) { + Q_ASSERT(_searchIndex.size() == _list.size()); + + SearchContext searchContext(word, _list); + auto match = std::lower_bound(_searchIndex.begin(), _searchIndex.end(), -1, [searchContext](const int &a, const int &b) { + const QString &wordA = (a == -1) ? searchContext.word : searchContext.list[a]; + const QString &wordB = (b == -1) ? searchContext.word : searchContext.list[b]; + return wordA.compare(wordB, Qt::CaseInsensitive) < 0; + }); + + if (match == _searchIndex.end()) + return QString(); + + if (!word.compare(_list[*match], Qt::CaseInsensitive)) { + match++; + if (match == _searchIndex.end()) + return QString(); + } + + return _list[*match].startsWith(word, Qt::CaseInsensitive) ? _list[*match] : QString(); + } + + QString bestMatch; + for (int i = 0, count = _list.size(); i < count; ++i) { + const QString &wordB(_list[i]); + if (wordB.length() > bestMatch.length() && + word.length() < wordB.length() && + wordB.startsWith(word, Qt::CaseInsensitive)) + bestMatch = wordB; + } + + return bestMatch; +} + +int HunspellWordList::indexOfWord(const QString &word) +{ + QMutexLocker guard(&_lock); + + if (!_searchIndex.isEmpty()) { + Q_ASSERT(_searchIndex.size() == _list.size()); + + SearchContext searchContext(word, _list); + auto match = std::lower_bound(_searchIndex.begin(), _searchIndex.end(), -1, [searchContext](int a, int b) { + const QString &wordA = (a == -1) ? searchContext.word : searchContext.list[a]; + const QString &wordB = (b == -1) ? searchContext.word : searchContext.list[b]; + return wordA.compare(wordB, Qt::CaseInsensitive) < 0; + }); + return (match != _searchIndex.end()) ? *match : -1; + } + + return _list.indexOf(word); +} + +QString HunspellWordList::wordAt(int index) +{ + QMutexLocker guard(&_lock); + + return index >= 0 && index < _list.size() ? _list.at(index) : QString(); +} + +void HunspellWordList::wordAt(int index, QString &word, Flags &flags) +{ + QMutexLocker guard(&_lock); + Q_ASSERT(index >= 0 && index < _list.size()); + + word = _list.at(index); + flags = _flags.at(index); +} + +const HunspellWordList::Flags &HunspellWordList::wordFlagsAt(int index) +{ + QMutexLocker guard(&_lock); + + return _flags[index]; +} + +void HunspellWordList::appendWord(const QString &word, const Flags &flags) +{ + QMutexLocker guard(&_lock); + + _searchIndex.clear(); + if (_limit > 0) { + while (_list.size() >= _limit) { + _list.removeAt(0); + _flags.removeAt(0); + } + } + _list.append(word); + _flags.append(flags); +} + +void HunspellWordList::insertWord(int index, const QString &word, const Flags &flags) +{ + QMutexLocker guard(&_lock); + Q_ASSERT(_limit == 0); + + _searchIndex.clear(); + _list.insert(index, word); + _flags.insert(index, flags); +} + +void HunspellWordList::updateWord(int index, const QString &word, const Flags &flags) +{ + Q_ASSERT(index >= 0); + QMutexLocker guard(&_lock); + + if (index < _list.size()) { + if (word != _list[index]) + _searchIndex.clear(); + _list[index] = word; + _flags[index] = flags; + } else { + _searchIndex.clear(); + _list.append(word); + _flags.append(flags); + } +} + +void HunspellWordList::moveWord(int from, int to) +{ + QMutexLocker guard(&_lock); + + if (from < 0 || from >= _list.size()) + return; + if (to < 0 || to >= _list.size()) + return; + if (from == to) + return; + + _searchIndex.clear(); + _list.move(from, to); + _flags.move(from, to); +} + +int HunspellWordList::removeWord(const QString &word) +{ + QMutexLocker guard(&_lock); + int removeCount = 0; + for (int i = 0, count = _list.size(); i < count;) { + if (!_list[i].compare(word, Qt::CaseInsensitive)) { + _list.removeAt(i); + _flags.removeAt(i); + --count; + ++removeCount; + } else { + ++i; + } + } + if (removeCount > 0) + _searchIndex.clear(); + return removeCount; +} + +void HunspellWordList::removeWordAt(int index) +{ + QMutexLocker guard(&_lock); + + _list.removeAt(index); +} + +void HunspellWordList::rebuildSearchIndex() +{ + QMutexLocker guard(&_lock); + _searchIndex.clear(); + + if (_list.isEmpty()) + return; + + _searchIndex.resize(_list.size()); + std::iota(_searchIndex.begin(), _searchIndex.end(), 0); + + const QStringList list(_list); + std::sort(_searchIndex.begin(), _searchIndex.end(), [list](int a, int b) { return list[a].compare(list[b], Qt::CaseInsensitive) < 0; }); +} /*! \class QtVirtualKeyboard::HunspellTask @@ -69,9 +360,6 @@ void HunspellLoadDictionaryTask::run() qCDebug(lcHunspell) << "HunspellLoadDictionaryTask::run(): locale:" << locale; - QTime perf; - perf.start(); - if (*hunspellPtr) { Hunspell_destroy(*hunspellPtr); *hunspellPtr = nullptr; @@ -97,13 +385,11 @@ void HunspellLoadDictionaryTask::run() by the QTextCodec. */ if (!QTextCodec::codecForName(Hunspell_get_dic_encoding(*hunspellPtr))) { - qCWarning(lcHunspell) << "The Hunspell dictionary" << dicPath << "cannot be used because it uses an unknown text codec" << QString(Hunspell_get_dic_encoding(*hunspellPtr)); + qCWarning(lcHunspell) << "The Hunspell dictionary" << dicPath << "cannot be used because it uses an unknown text codec" << QLatin1String(Hunspell_get_dic_encoding(*hunspellPtr)); Hunspell_destroy(*hunspellPtr); *hunspellPtr = nullptr; } } - - qCDebug(lcHunspell) << "HunspellLoadDictionaryTask::run(): time:" << perf.elapsed() << "ms"; } else { qCWarning(lcHunspell) << "Hunspell dictionary is missing for" << locale << ". Search paths" << searchPaths; } @@ -118,11 +404,11 @@ void HunspellLoadDictionaryTask::run() void HunspellBuildSuggestionsTask::run() { - QTime perf; - perf.start(); + if (wordList->isEmpty()) + return; - wordList->list.append(word); - wordList->index = 0; + wordList->clearSuggestions(); + QString word = wordList->wordAt(0); /* Select text codec based on the dictionary encoding. Hunspell_get_dic_encoding() should always return at least @@ -138,34 +424,45 @@ void HunspellBuildSuggestionsTask::run() /* Collect word candidates from the Hunspell suggestions. Insert word completions in the beginning of the list. */ - const int firstWordCompletionIndex = wordList->list.length(); + const int firstWordCompletionIndex = wordList->size(); int lastWordCompletionIndex = firstWordCompletionIndex; bool suggestCapitalization = false; for (int i = 0; i < n; i++) { QString wordCandidate(textCodec->toUnicode(slst[i])); - wordCandidate.replace(QChar(0x2019), '\''); - if (wordCandidate.compare(word) != 0) { - QString normalizedWordCandidate = removeAccentsAndDiacritics(wordCandidate); - /* Prioritize word Capitalization */ - if (!suggestCapitalization && !wordCandidate.compare(word, Qt::CaseInsensitive)) { - wordList->list.insert(1, wordCandidate); + wordCandidate.replace(QChar(0x2019), QLatin1Char('\'')); + QString normalizedWordCandidate = removeAccentsAndDiacritics(wordCandidate); + /* Prioritize word Capitalization */ + if (!wordCandidate.compare(word, Qt::CaseInsensitive)) { + if (suggestCapitalization) { + bool wordCandidateIsCapital = wordCandidate.at(0).isUpper(); + bool wordIsCapital = word.at(0).isUpper(); + if (wordCandidateIsCapital == wordIsCapital) { + if (wordCandidateIsCapital) + wordCandidate = wordCandidate.toLower(); + else + wordCandidate[0] = wordCandidate.at(0).toUpper(); + } + wordList->insertWord(1, wordCandidate); lastWordCompletionIndex++; suggestCapitalization = true; - /* Prioritize word completions, missing punctuation or missing accents */ - } else if (normalizedWordCandidate.startsWith(word) || - wordCandidate.contains(QChar('\''))) { - wordList->list.insert(lastWordCompletionIndex++, wordCandidate); - } else { - wordList->list.append(wordCandidate); } + /* Prioritize word completions, missing punctuation or missing accents */ + } else if ((normalizedWordCandidate.length() > word.length() && + normalizedWordCandidate.startsWith(word)) || + wordCandidate.contains(QLatin1Char('\''))) { + wordList->insertWord(lastWordCompletionIndex++, wordCandidate); + } else { + wordList->appendWord(wordCandidate); } } /* Prioritize words with missing spaces next to word completions. */ - for (int i = lastWordCompletionIndex; i < wordList->list.length(); i++) { - if (QString(wordList->list.at(i)).replace(" ", "").compare(word) == 0) { + for (int i = lastWordCompletionIndex; i < wordList->size(); i++) { + QString wordCandidate(wordList->wordAt(i)); + if (wordCandidate.contains(QLatin1String(" "))) { + wordList->updateWord(i, wordCandidate, wordList->wordFlagsAt(i) | HunspellWordList::CompoundWord); if (i != lastWordCompletionIndex) { - wordList->list.move(i, lastWordCompletionIndex); + wordList->moveWord(i, lastWordCompletionIndex); } lastWordCompletionIndex++; } @@ -178,21 +475,28 @@ void HunspellBuildSuggestionsTask::run() which may be suboptimal for the purpose, but gives some clue how much the suggested word differs from the given word. */ - if (autoCorrect && wordList->list.length() > 1 && (!spellCheck(word) || suggestCapitalization)) { - if (lastWordCompletionIndex > firstWordCompletionIndex || levenshteinDistance(word, wordList->list.at(firstWordCompletionIndex)) < 3) - wordList->index = firstWordCompletionIndex; + if (autoCorrect && wordList->size() > 1 && (!spellCheck(word) || suggestCapitalization)) { + if (lastWordCompletionIndex > firstWordCompletionIndex || levenshteinDistance(word, wordList->wordAt(firstWordCompletionIndex)) < 3) + wordList->setIndex(firstWordCompletionIndex); } } Hunspell_free_list(hunspell, &slst, n); - qCDebug(lcHunspell) << "HunspellBuildSuggestionsTask::run(): time:" << perf.elapsed() << "ms"; + for (int i = 0, count = wordList->size(); i < count; ++i) { + HunspellWordList::Flags flags; + wordList->wordAt(i, word, flags); + if (flags.testFlag(HunspellWordList::CompoundWord)) + continue; + if (Hunspell_spell(hunspell, textCodec->fromUnicode(word).constData()) != 0) + wordList->updateWord(i, word, wordList->wordFlagsAt(i) | HunspellWordList::SpellCheckOk); + } } bool HunspellBuildSuggestionsTask::spellCheck(const QString &word) { if (!hunspell) return false; - if (word.contains(QRegularExpression("[0-9]"))) + if (word.contains(QRegularExpression(QLatin1Literal("[0-9]")))) return true; return Hunspell_spell(hunspell, textCodec->fromUnicode(word).constData()) != 0; } @@ -243,7 +547,140 @@ QString HunspellBuildSuggestionsTask::removeAccentsAndDiacritics(const QString& void HunspellUpdateSuggestionsTask::run() { - emit updateSuggestions(wordList->list, wordList->index); + emit updateSuggestions(wordList, tag); +} + +void HunspellAddWordTask::run() +{ + const QTextCodec *textCodec; + textCodec = QTextCodec::codecForName(Hunspell_get_dic_encoding(hunspell)); + if (!textCodec) + return; + + QString tmpWord; + tmpWord.reserve(64); + for (int i = 0, count = wordList->size(); i < count; ++i) { + const QString word(wordList->wordAt(i)); + if (word.length() < 2) + continue; + Hunspell_add(hunspell, textCodec->fromUnicode(word).constData()); + if (HunspellAddWordTask::alternativeForm(word, tmpWord)) + Hunspell_add(hunspell, textCodec->fromUnicode(tmpWord).constData()); + } +} + +bool HunspellAddWordTask::alternativeForm(const QString &word, QString &alternativeForm) +{ + if (word.length() < 2) + return false; + if (!word.mid(1).isLower()) + return false; + + const QChar initial(word.at(0)); + const QChar newInitial = initial.isUpper() ? initial.toLower() : initial.toUpper(); + if (newInitial == initial) + return false; + + alternativeForm.truncate(0); + alternativeForm.append(word); + alternativeForm[0] = newInitial; + + return true; +} + +void HunspellRemoveWordTask::run() +{ + const QTextCodec *textCodec; + textCodec = QTextCodec::codecForName(Hunspell_get_dic_encoding(hunspell)); + if (!textCodec) + return; + + QString tmpWord; + tmpWord.reserve(64); + for (int i = 0, count = wordList->size(); i < count; ++i) { + const QString word(wordList->wordAt(i)); + if (word.isEmpty()) + continue; + Hunspell_remove(hunspell, textCodec->fromUnicode(word).constData()); + if (HunspellAddWordTask::alternativeForm(word, tmpWord)) + Hunspell_remove(hunspell, textCodec->fromUnicode(tmpWord).constData()); + } +} + +void HunspellLoadWordListTask::run() +{ + wordList->clear(); + + QFile inputFile(filePath); + if (inputFile.open(QIODevice::ReadOnly | QIODevice::Text)) { + QTextStream inStream(&inputFile); + inStream.setCodec(QTextCodec::codecForName("UTF-8")); + QString word; + word.reserve(64); + while (inStream.readLineInto(&word)) { + if (!word.isEmpty()) + wordList->appendWord(word); + } + inputFile.close(); + } +} + +void HunspellSaveWordListTask::run() +{ + QFile outputFile(filePath); + if (!QFileInfo::exists(filePath)) + QDir().mkpath(QFileInfo(filePath).absoluteDir().path()); + if (outputFile.open(QIODevice::WriteOnly | QIODevice::Text)) { + QTextStream outStream(&outputFile); + outStream.setCodec(QTextCodec::codecForName("UTF-8")); + for (int i = 0, count = wordList->size(); i < count; ++i) { + const QString word(wordList->wordAt(i)); + outStream << word.toUtf8() << '\n'; + } + outputFile.close(); + } +} + +void HunspellFilterWordTask::run() +{ + if (filterList->isEmpty()) + return; + + filterList->rebuildSearchIndex(); + + for (int i = startIndex, count = wordList->size(); i < count;) { + if (filterList->contains(wordList->wordAt(i))) { + wordList->removeWordAt(i); + --count; + } else { + ++i; + } + } +} + +void HunspellBoostWordTask::run() +{ + if (boostList->isEmpty()) + return; + + boostList->rebuildSearchIndex(); + + const QString word(wordList->wordAt(0)); + const QString wordCompletion(boostList->findWordCompletion(word)); + if (!wordCompletion.isEmpty()) { + int from = wordList->indexOfWord(wordCompletion); + if (from != 1) { + int to; + for (to = 1; to < wordList->size() && wordList->wordAt(to).startsWith(word); ++to) + ; + if (from != -1) { + if (to < from) + wordList->moveWord(from, to); + } else { + wordList->insertWord(to, wordCompletion, HunspellWordList::SpellCheckOk); + } + } + } } /*! @@ -253,11 +690,13 @@ void HunspellUpdateSuggestionsTask::run() HunspellWorker::HunspellWorker(QObject *parent) : QThread(parent), + idleSema(), taskSema(), taskLock(), hunspell(nullptr) { abort = false; + qRegisterMetaType<QSharedPointer<HunspellWordList>>("QSharedPointer<HunspellWordList>"); } HunspellWorker::~HunspellWorker() @@ -282,12 +721,30 @@ void HunspellWorker::removeAllTasks() taskList.clear(); } +void HunspellWorker::waitForAllTasks() +{ + qCDebug(lcHunspell) << "waitForAllTasks enter"; + while (isRunning()) { + idleSema.acquire(); + QMutexLocker guard(&taskLock); + if (taskList.isEmpty()) { + idleSema.release(); + break; + } + idleSema.release(); + } + qCDebug(lcHunspell) << "waitForAllTasks leave"; +} + void HunspellWorker::run() { + QTime perf; while (!abort) { + idleSema.release(); taskSema.acquire(); if (abort) break; + idleSema.acquire(); QSharedPointer<HunspellTask> currentTask; { QMutexLocker guard(&taskLock); @@ -304,7 +761,9 @@ void HunspellWorker::run() currentTask->hunspell = hunspell; else continue; + perf.start(); currentTask->run(); + qCDebug(lcHunspell) << QString(QLatin1String(currentTask->metaObject()->className()) + "::run(): time:").toLatin1().constData() << perf.elapsed() << "ms"; } } if (hunspell) { diff --git a/src/plugins/hunspell/hunspellinputmethod/hunspellworker_p.h b/src/plugins/hunspell/hunspellinputmethod/hunspellworker_p.h index 1fe61bba..5ffb34a9 100644 --- a/src/plugins/hunspell/hunspellinputmethod/hunspellworker_p.h +++ b/src/plugins/hunspell/hunspellinputmethod/hunspellworker_p.h @@ -46,6 +46,8 @@ #include <QMutex> #include <QStringList> #include <QSharedPointer> +#include <QVector> +#include <QLoggingCategory> #include <hunspell/hunspell.h> QT_BEGIN_NAMESPACE @@ -53,6 +55,65 @@ class QTextCodec; namespace QtVirtualKeyboard { +Q_DECLARE_LOGGING_CATEGORY(lcHunspell) + +class HunspellWordList +{ +public: + enum Flag + { + SpellCheckOk = 0x1, + CompoundWord = 0x2 + }; + Q_DECLARE_FLAGS(Flags, Flag) + + HunspellWordList(int limit = 0); + HunspellWordList(HunspellWordList &other); + + HunspellWordList &operator=(HunspellWordList &other); + + int index() const; + void setIndex(int index); + bool clear(); + bool clearSuggestions(); + bool hasSuggestions() const; + int size() const; + int isEmpty() const; + bool contains(const QString &word); + QString findWordCompletion(const QString &word); + int indexOfWord(const QString &word); + QString wordAt(int index); + void wordAt(int index, QString &word, Flags &flags); + const Flags &wordFlagsAt(int index); + void appendWord(const QString &word, const Flags &flags = Flags()); + void insertWord(int index, const QString &word, const Flags &flags = Flags()); + void updateWord(int index, const QString &word, const Flags &flags = Flags()); + void moveWord(int from, int to); + int removeWord(const QString &word); + void removeWordAt(int index); + void rebuildSearchIndex(); + +private: + class SearchContext { + public: + SearchContext(const QString &word, + const QStringList &list) : + word(word), + list(list) + {} + const QString &word; + const QStringList &list; + }; + +private: + QMutex _lock; + QStringList _list; + QVector<Flags> _flags; + QVector<int> _searchIndex; + int _index; + int _limit; +}; + class HunspellTask : public QObject { Q_OBJECT @@ -84,24 +145,11 @@ public: const QStringList searchPaths; }; -class HunspellWordList -{ -public: - HunspellWordList() : - list(), - index(-1) - {} - - QStringList list; - int index; -}; - class HunspellBuildSuggestionsTask : public HunspellTask { Q_OBJECT const QTextCodec *textCodec; public: - QString word; QSharedPointer<HunspellWordList> wordList; bool autoCorrect; @@ -120,7 +168,80 @@ public: void run(); signals: - void updateSuggestions(const QStringList &wordList, int activeWordIndex); + void updateSuggestions(const QSharedPointer<HunspellWordList> &wordList, int tag); + +public: + int tag; +}; + +class HunspellAddWordTask : public HunspellTask +{ + Q_OBJECT +public: + QSharedPointer<HunspellWordList> wordList; + + void run(); + + static bool alternativeForm(const QString &word, QString &alternativeForm); +}; + +class HunspellRemoveWordTask : public HunspellTask +{ + Q_OBJECT +public: + QSharedPointer<HunspellWordList> wordList; + + void run(); +}; + +class HunspellLoadWordListTask : public HunspellTask +{ + Q_OBJECT +public: + QSharedPointer<HunspellWordList> wordList; + QString filePath; + + void run(); +}; + +class HunspellSaveWordListTask : public HunspellTask +{ + Q_OBJECT +public: + QSharedPointer<HunspellWordList> wordList; + QString filePath; + + void run(); +}; + +class HunspellFilterWordTask : public HunspellTask +{ + Q_OBJECT +public: + HunspellFilterWordTask() : + HunspellTask(), + startIndex(1) + {} + + QSharedPointer<HunspellWordList> wordList; + QSharedPointer<HunspellWordList> filterList; + int startIndex; + + void run(); +}; + +class HunspellBoostWordTask : public HunspellTask +{ + Q_OBJECT +public: + HunspellBoostWordTask() : + HunspellTask() + {} + + QSharedPointer<HunspellWordList> wordList; + QSharedPointer<HunspellWordList> boostList; + + void run(); }; class HunspellWorker : public QThread @@ -132,16 +253,19 @@ public: void addTask(QSharedPointer<HunspellTask> task); void removeAllTasks(); + void waitForAllTasks(); template <class X> - void removeAllTasksExcept() { + void removeAllTasksOfType() { QMutexLocker guard(&taskLock); for (int i = 0; i < taskList.size();) { QSharedPointer<X> task(taskList[i].objectCast<X>()); - if (!task) + if (task) { + qCDebug(lcHunspell) << "Remove task" << QLatin1String(task->metaObject()->className()); taskList.removeAt(i); - else + } else { i++; + } } } @@ -154,6 +278,7 @@ private: private: friend class HunspellLoadDictionaryTask; QList<QSharedPointer<HunspellTask> > taskList; + QSemaphore idleSema; QSemaphore taskSema; QMutex taskLock; Hunhandle *hunspell; @@ -163,4 +288,6 @@ private: } // namespace QtVirtualKeyboard QT_END_NAMESPACE +Q_DECLARE_METATYPE(QSharedPointer<QT_PREPEND_NAMESPACE(QtVirtualKeyboard)::HunspellWordList>); + #endif // HUNSPELLWORKER_P_H diff --git a/src/plugins/lipi-toolkit/plugin/lipiinputmethod.cpp b/src/plugins/lipi-toolkit/plugin/lipiinputmethod.cpp index 49fadf24..86877623 100644 --- a/src/plugins/lipi-toolkit/plugin/lipiinputmethod.cpp +++ b/src/plugins/lipi-toolkit/plugin/lipiinputmethod.cpp @@ -274,6 +274,7 @@ public: // Double swipe: commit word, or insert space cancelRecognition(); #ifdef HAVE_HUNSPELL + int activeWordIndex = wordCandidates.index(); if (activeWordIndex != -1) { q->selectionListItemSelected(SelectionListModel::WordCandidateList, activeWordIndex); return; diff --git a/src/plugins/lipi-toolkit/plugin/plugin.pro b/src/plugins/lipi-toolkit/plugin/plugin.pro index 07c7e872..3517fb19 100644 --- a/src/plugins/lipi-toolkit/plugin/plugin.pro +++ b/src/plugins/lipi-toolkit/plugin/plugin.pro @@ -35,8 +35,15 @@ INSTALLS += ltk_projects QT += hunspellinputmethod-private } -contains(CONFIG, lang-en.*): LAYOUT_FILES += $$LAYOUTS_BASE/content/layouts/en_GB/handwriting.qml -contains(CONFIG, lang-nl.*): LAYOUT_FILES += $$LAYOUTS_BASE/content/layouts/nl_NL/handwriting.qml +LAYOUT_FILES += $$LAYOUTS_BASE/content/layouts/fallback/handwriting.qml +contains(CONFIG, lang-en(_GB)?): LAYOUT_FILES += $$LAYOUTS_BASE/content/layouts/en_GB/handwriting.fallback +contains(CONFIG, lang-en(_US)?): LAYOUT_FILES += $$LAYOUTS_BASE/content/layouts/en_US/handwriting.fallback +contains(CONFIG, lang-id.*): LAYOUT_FILES += $$LAYOUTS_BASE/content/layouts/id_ID/handwriting.fallback +contains(CONFIG, lang-ms.*): LAYOUT_FILES += $$LAYOUTS_BASE/content/layouts/ms_MY/handwriting.fallback +contains(CONFIG, lang-nl.*): LAYOUT_FILES += $$LAYOUTS_BASE/content/layouts/nl_NL/handwriting.fallback + +OTHER_FILES += \ + $$LAYOUT_FILES !isEmpty(LAYOUT_FILES) { layouts.files = $$LAYOUT_FILES diff --git a/src/plugins/myscript/3rdparty/myscript/myscript.pri b/src/plugins/myscript/3rdparty/myscript/myscript.pri new file mode 100644 index 00000000..76854351 --- /dev/null +++ b/src/plugins/myscript/3rdparty/myscript/myscript.pri @@ -0,0 +1,57 @@ +# +# Automatically detects the MyScript SDK directory and sets the following variables: +# +# MYSCRIPT_FOUND: 0/1 MyScript SDK found +# + +MYSCRIPT_FOUND = 0 +isEmpty(MYSCRIPT_PATH): MYSCRIPT_PATH = $$PWD +unix:linux:!android { + equals(QT_ARCH, "arm64") { + MYSCRIPT_ENGINE_PATH = "engine/bin/lin-arm64" + MYSCRIPT_VOIM_PATH = "voim/bin/lin-arm64" + } else:equals(QT_ARCH, "arm") { + MYSCRIPT_ENGINE_PATH = "engine/bin/lin-armv7" + MYSCRIPT_VOIM_PATH = "voim/bin/lin-armv7" + } else:equals(QT_ARCH, "x86_64") { + MYSCRIPT_ENGINE_PATH = "engine/bin/lin-x64" + MYSCRIPT_VOIM_PATH = "voim/bin/lin-x64" + } else:equals(QT_ARCH, "x86")|equals(QT_ARCH, "i386") { + MYSCRIPT_ENGINE_PATH = "engine/bin/lin-x86" + MYSCRIPT_VOIM_PATH = "voim/bin/lin-x86" + } else { + MYSCRIPT_ENGINE_PATH = "engine/bin/lin-$$QT_ARCH" + MYSCRIPT_VOIM_PATH = "voim/bin/lin-$$QT_ARCH" + } + MYSCRIPT_LIB_PREFIX = "lib" + MYSCRIPT_LIB_SUFFIX = ".so" + MYSCRIPT_VOIM_LIB_NAME = "libvoim.so" + MYSCRIPT_VOIM_LIB_PATH = $$MYSCRIPT_PATH/$$MYSCRIPT_VOIM_PATH/$$MYSCRIPT_VOIM_LIB_NAME +} else:win32|win64 { + equals(QT_ARCH, "x86_64") { + MYSCRIPT_ENGINE_PATH = "engine/bin/win-x64" + MYSCRIPT_VOIM_PATH = "voim/bin/win-x64" + } else { + MYSCRIPT_ENGINE_PATH = "engine/bin/win-x86" + MYSCRIPT_VOIM_PATH = "voim/bin/win-x86" + } + MYSCRIPT_LIB_PREFIX = "" + MYSCRIPT_LIB_SUFFIX = ".dll" + MYSCRIPT_VOIM_LIB_NAME = "voim.lib" + MYSCRIPT_VOIM_LIB_PATH = $$MYSCRIPT_PATH/voim/api/c/lib/$$MYSCRIPT_VOIM_LIB_NAME + !exists($$MYSCRIPT_VOIM_LIB_PATH) { + system(lib /def:$$MYSCRIPT_PATH/voim/api/c/lib/voim.def /OUT:$$MYSCRIPT_VOIM_LIB_PATH) + } +} +MYSCRIPT_VOIM_LIB += \ + $$MYSCRIPT_VOIM_LIB_PATH +MYSCRIPT_ENGINE_BINS += \ + $$MYSCRIPT_PATH/$$MYSCRIPT_VOIM_PATH/$${MYSCRIPT_LIB_PREFIX}voim$${MYSCRIPT_LIB_SUFFIX} \ + $$MYSCRIPT_PATH/$$MYSCRIPT_ENGINE_PATH/$${MYSCRIPT_LIB_PREFIX}MyScript2D$${MYSCRIPT_LIB_SUFFIX} \ + $$MYSCRIPT_PATH/$$MYSCRIPT_ENGINE_PATH/$${MYSCRIPT_LIB_PREFIX}MyScriptText$${MYSCRIPT_LIB_SUFFIX} \ + $$MYSCRIPT_PATH/$$MYSCRIPT_ENGINE_PATH/$${MYSCRIPT_LIB_PREFIX}MyScriptEngine$${MYSCRIPT_LIB_SUFFIX} +MYSCRIPT_VOIM_CONF = voim/conf +MYSCRIPT_LANGUAGE_CONF = conf +MYSCRIPT_RESOURCES = resources + +exists($$MYSCRIPT_VOIM_LIB_PATH): MYSCRIPT_FOUND = 1 diff --git a/src/plugins/myscript/myscript.pro b/src/plugins/myscript/myscript.pro new file mode 100644 index 00000000..b6e92972 --- /dev/null +++ b/src/plugins/myscript/myscript.pro @@ -0,0 +1,4 @@ +TEMPLATE = subdirs + +SUBDIRS += \ + plugin diff --git a/src/plugins/myscript/plugin/myscript.json b/src/plugins/myscript/plugin/myscript.json new file mode 100644 index 00000000..8f573972 --- /dev/null +++ b/src/plugins/myscript/plugin/myscript.json @@ -0,0 +1,6 @@ +{ + "Name": "handwriting", + "Provider": "Qt MyScript Extension", + "InputMethod": "HandwritingInputMethod", + "Version": 300 +} diff --git a/src/plugins/myscript/plugin/myscriptinputmethod.cpp b/src/plugins/myscript/plugin/myscriptinputmethod.cpp new file mode 100644 index 00000000..95823679 --- /dev/null +++ b/src/plugins/myscript/plugin/myscriptinputmethod.cpp @@ -0,0 +1,1470 @@ +/**************************************************************************** +** +** Copyright (C) MyScript. Contact: https://www.myscript.com/about/contact-us/sales-inquiry/ +** Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB). Contact: https://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Qt Virtual Keyboard module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:GPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 or (at your option) any later version +** approved by the KDE Free Qt Foundation. The licenses are as published by +** the Free Software Foundation and appearing in the file LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "myscriptinputmethod_p.h" +#include "myscriptinputmethod_p_p.h" + +#include <QtVirtualKeyboard/inputengine.h> +#include <QtVirtualKeyboard/inputcontext.h> +#include <QtVirtualKeyboard/trace.h> + +#include <QLoggingCategory> + +#include MYSCRIPT_CERTIFICATE +#include <common/Properties.h> +#include <common/PortabilityDefinitions.h> +#include <voim.h> + +#include <thread> +#include <mutex> +#include <chrono> + +#ifndef PATH_MAX +#define PATH_MAX 512 +#endif + +#include <QCryptographicHash> +#include <QThread> + +#include <QtCore/qmath.h> +#include <QtCore/QLibraryInfo> +#include <QTextFormat> + +#define VERIFY(arg) if (!(arg)) abort(); + +#define VERIFY2(arg, msg, engine) if (!(arg)) { \ + qCCritical(qlcVKMyScript) << msg << strMyScriptError(voGetError(engine)); \ + abort(); \ + } + +#define GESTURE_STRING_RIGHT_TO_LEFT "\xF3\xB0\x80\x82" // equivalent Unicode is "\U000F0002" +#define GESTURE_STRING_LEFT_TO_RIGHT "\xF3\xB0\x80\x83" // equivalent Unicode is "\U000F0003" +#define GESTURE_STRING_DOWN_THEN_LEFT "\xF3\xB0\x80\x84" // equivalent Unicode is "\U000F0004" +#define GESTURE_STRING_DOWN_THEN_RIGHT "\xF3\xB0\x80\x88" // equivalent Unicode is "\U000F0008" + +QT_BEGIN_NAMESPACE +namespace QtVirtualKeyboard { + +Q_LOGGING_CATEGORY(qlcVKMyScript, "qt.virtualkeyboard.myscript") + +typedef enum GESTURE_TYPE { + GESTURE_TYPE_NONE = 0, + GESTURE_TYPE_RIGHT_TO_LEFT = 0x000F0002, + GESTURE_TYPE_LEFT_TO_RIGHT = 0x000F0003, + GESTURE_TYPE_DOWN_THEN_LEFT = 0x000F0004, + GESTURE_TYPE_DOWN_THEN_RIGHT = 0x000F0008 +} GestureType; + +typedef struct CANDIDATE_ITEM { + int candidateIndex; + QStringList candidates; +} CandidateItem; + +static inline QString getVoimErrorMessage(const voimErrorCode code) +{ + QString message; + + switch (code) { + case VOIM_EC_NO_ERROR: + message = QString::fromLatin1("no error occurred"); + break; + case VOIM_EC_INVALID_VALUE: + message = QString::fromLatin1("a value passed to an API function was not valid"); + break; + case VOIM_EC_INVALID_INDEX: + message = QString::fromLatin1("an index passed to an API function was out of range"); + break; + case VOIM_EC_INVALID_OPERATION: + message = QString::fromLatin1("the requested operation is not valid regarding the current state of the target object"); + break; + case VOIM_EC_OUT_OF_MEMORY: + message = QString::fromLatin1("a memory allocation failure"); + break; + case VOIM_EC_IO_FAILURE: + message = QString::fromLatin1("an I/O operation failure"); + break; + case VOIM_EC_INTERNAL_ERROR: + message = QString::fromLatin1("an internal error"); + break; + default: + message = QString::fromLatin1("unknown error code - ") + QString::number(code); + break; + } + + return message; +} + +class MyScriptInputMethodPrivate +{ + Q_DECLARE_PUBLIC(MyScriptInputMethod) +public: + MyScriptInputMethodPrivate(MyScriptInputMethod *q_ptr) : + q_ptr(q_ptr), + m_engine(nullptr), + m_languageManager(nullptr), + m_recognizer(nullptr), + m_onManagingResult(false), + m_isProcessing(false), + m_commitTimer(0), + textCase(InputEngine::Lower), + wordIndex(-1), + m_itemIndex(-1), + m_preeditCursorPosition(0) + { + initHwrEngine(); + } + + ~MyScriptInputMethodPrivate() + { + destroyHwrEngine(); + } + + void setContext(InputEngine::PatternRecognitionMode patternRecognitionMode, + const QVariantMap &traceCaptureDeviceInfo, + const QVariantMap &traceScreenInfo) + { + Q_UNUSED(patternRecognitionMode); + Q_UNUSED(traceCaptureDeviceInfo); + Q_UNUSED(traceScreenInfo); + + qCDebug(qlcVKMyScript) << Q_FUNC_INFO; + } + + Trace *traceBegin(int traceId, InputEngine::PatternRecognitionMode patternRecognitionMode, + const QVariantMap &traceCaptureDeviceInfo, const QVariantMap &traceScreenInfo) + { + Q_UNUSED(patternRecognitionMode); + Q_UNUSED(traceCaptureDeviceInfo); + Q_UNUSED(traceScreenInfo); + + qCDebug(qlcVKMyScript) << Q_FUNC_INFO << traceId; + + if (!m_isProcessing) { + Q_Q(MyScriptInputMethod); + if (!q->inputContext()->preeditText().isEmpty()) + q->inputContext()->commit(); + } + + stopCommitTimer(); + + for (int i = 0; i < traceList.size(); i++) { + traceList[i]->setOpacity(qMax(0.0, 1 - 0.25 * (traceList.size() - i))); + } + + Trace *trace = new Trace(); + traceList.append(trace); + + return trace; + } + + void traceEnd(Trace *trace) + { + if (trace->isCanceled()) { + qCDebug(qlcVKMyScript) << Q_FUNC_INFO << "discarded" << trace; + traceList.removeOne(trace); + delete trace; + } else { + addPointsToTraceGroup(trace); + } + + if (!traceList.isEmpty() && countActiveTraces() == 0) { + resetCommitTimer(); + } + } + + int countActiveTraces() const + { + int count = 0; + for (Trace *trace : qAsConst(traceList)) { + if (!trace->isFinal()) + count++; + } + return count; + } + + void clearTraces() + { + qDeleteAll(traceList); + traceList.clear(); + } + + void handleBackspace() + { + Q_Q(MyScriptInputMethod); + + cancelRecognition(); + + clearCandidates(); + clearItems(); + q->inputContext()->commit(); + } + + void addPointsToTraceGroup(Trace *trace) + { + const QVariantList sourcePoints = trace->points(); + + struct voPoint { + float x; + float y; + }; + + std::vector<voPoint> points; + points.reserve(sourcePoints.size()); + for (const QVariant &p : sourcePoints) { + const QPointF pt(p.toPointF()); + points.push_back({ (float)pt.x(), (float)pt.y() }); + } + + if (!voim_addStroke(m_engine, m_recognizer, &points.data()->x, sizeof(voPoint), &points.data()->y, sizeof(voPoint), (int)(points.size())) && + voim_getError(m_engine) != VOIM_EC_NO_ERROR) { + qCCritical(qlcVKMyScript) << "voim_addStroke() failed -" << getVoimErrorMessage(voim_getError(m_engine)); + return; + } + } + + void clearCandidates(void) + { + qCDebug(qlcVKMyScript) << Q_FUNC_INFO; + + wordCandidates.clear(); + word = QString(); + wordIndex = -1; + + updateCandidateView(); + } + + void clearItems(void) + { + qCDebug(qlcVKMyScript) << Q_FUNC_INFO; + + m_itemIndex = -1; + + for (int i = 0; i < m_items.count(); i++) { + CandidateItem *candidateItem = m_items.at(i).second; + delete candidateItem; + } + + m_items.clear(); + } + + bool cancelRecognition() + { + qCDebug(qlcVKMyScript) << Q_FUNC_INFO; + Q_ASSERT(m_engine != nullptr && m_recognizer != nullptr); + + if (m_isProcessing) + stopCommitTimer(); //commit(); + clearTraces(); + + if (voim_cancel(m_engine, m_recognizer) && + voim_getError(m_engine) != VOIM_EC_NO_ERROR) { + qCCritical(qlcVKMyScript) << "voim_cancel() failed -" << getVoimErrorMessage(voim_getError(m_engine)); + return false; + } + + m_isProcessing = false; + return !traceList.isEmpty(); + } + + void resetCommitTimer(void) + { + Q_Q(MyScriptInputMethod); + + stopCommitTimer(); + m_commitTimer = q->startTimer(1500); + } + + void stopCommitTimer(void) + { + if (m_commitTimer) { + Q_Q(MyScriptInputMethod); + q->killTimer(m_commitTimer); + m_commitTimer = 0; + } + } + + void initHwrEngine(void) + { + if (!createEngine()) + return; + + if (!createLanguageManager()) { + voim_destroyEngine(m_engine); + m_engine = nullptr; + + return; + } + + if (!createRecognizer()) { + voim_destroyLanguageManager(m_engine, m_languageManager); + voim_destroyEngine(m_engine); + + m_languageManager = nullptr; + m_engine = nullptr; + + return; + } + + if (!voim_setNotificationCallback(m_engine, m_recognizer, notificationCallback, this)) { + qCCritical(qlcVKMyScript) << "voim_setNotificationCallback() failed -" << getVoimErrorMessage(voim_getError(m_engine)); + return; + } + + m_threadController.reset(new MyScriptRecognizeController(this, m_engine, m_recognizer)); + } + + bool createEngine(void) + { + qCDebug(qlcVKMyScript) << Q_FUNC_INFO; + + /* + * NOTE: you must use the certificate provided by MyScript to use a MyScript product. + * It is described in MyCertificate.c and MyCertificate.h + */ + const voCertificate *certificate = &myCertificate; + voimProperty *properties = nullptr; + + QString imLibrary = QLibraryInfo::location(QLibraryInfo::BinariesPath) + "/" + MYSCRIPT_VOIM_NAME; + properties = Properties_put(properties, "com.myscript.im.library", imLibrary.toStdString().c_str()); + if (!properties) { + qCCritical(qlcVKMyScript) << "failed to define property " << "com.myscript.im.library" << " with value " << imLibrary; + return false; + } + + QString engineLibrary = QLibraryInfo::location(QLibraryInfo::BinariesPath) + "/" + MYSCRIPT_ENGINE_NAME; + properties = Properties_put(properties, "com.myscript.engine.library", engineLibrary.toStdString().c_str()); + if (!properties) { + qCCritical(qlcVKMyScript) << "failed to define property " << "com.myscript.engine.library" << " with value " << engineLibrary; + return false; + } + + QString propertyFile = QLatin1String("/Engine.properties"); + propertyFile = QLibraryInfo::location(QLibraryInfo::DataPath) + "/" + MYSCRIPT_VOIM_PROPERTY_PATH + propertyFile; + + if (!checkFile(propertyFile)) { + qCCritical(qlcVKMyScript) << "failed to open Engine Property file " << propertyFile; + return false; + } + + m_engine = voim_createEngine(certificate, propertyFile.toStdString().c_str(), properties); + if (!m_engine) { + qCCritical(qlcVKMyScript) << "voim_createEngine() failed"; + return false; + } + + return true; + } + + bool createLanguageManager(void) + { + qCDebug(qlcVKMyScript) << Q_FUNC_INFO; + + voimProperty *properties = nullptr; + + QString languageConf = QLibraryInfo::location(QLibraryInfo::DataPath) + "/" + MYSCRIPT_LANGUAGE_CONF_PATH; + properties = Properties_put(properties, "com.myscript.im.languageSearchPath", languageConf.toStdString().c_str()); + if (!properties) { + qCCritical(qlcVKMyScript) << "failed to define property " << "com.myscript.im.languageSearchPath" << " with value " << languageConf; + return false; + } + + properties = Properties_put(properties, "com.myscript.im.languageManifestSuffix", ".conf"); + if (!properties) { + qCCritical(qlcVKMyScript) << "failed to define property " << "com.myscript.im.languageManifestSuffix" << " with value" << " \".conf\""; + return false; + } + + QString propertyFile = QLatin1String("/LanguageManager.properties"); + propertyFile = QLibraryInfo::location(QLibraryInfo::DataPath) + "/" + MYSCRIPT_VOIM_PROPERTY_PATH + propertyFile; + + if (!checkFile(propertyFile)) { + qCCritical(qlcVKMyScript) << "failed to open LanguageManager Property file " << propertyFile; + return false; + } + + m_languageManager = voim_createLanguageManager(m_engine, propertyFile.toStdString().c_str(), properties); + if (!m_languageManager) { + qCCritical(qlcVKMyScript) << "voim_createLanguageManager() failed -" << getVoimErrorMessage(voim_getError(m_engine)); + return false; + } + + voim_refreshLanguageList(m_engine, m_languageManager); + if (voim_getError(m_engine) != VOIM_EC_NO_ERROR) { + qCCritical(qlcVKMyScript) << "voim_refreshLanguageList failed -" << getVoimErrorMessage(voim_getError(m_engine)); + } + Properties_destroy(properties); + + return true; + } + + bool createRecognizer(void) + { + qCDebug(qlcVKMyScript) << Q_FUNC_INFO; + + QString propertyFile = QLatin1String("/Recognizer.properties"); + propertyFile = QLibraryInfo::location(QLibraryInfo::DataPath) + "/" + MYSCRIPT_VOIM_PROPERTY_PATH + propertyFile; + + if (!checkFile(propertyFile)) { + qCCritical(qlcVKMyScript) << "failed to open Recognizer Property file " << propertyFile; + return false; + } + + m_recognizer = voim_createRecognizer(m_engine, m_languageManager, propertyFile.toStdString().c_str(), NULL); + if (!m_recognizer) { + qCCritical(qlcVKMyScript) << "voim_createRecognizer() failed -" << getVoimErrorMessage(voim_getError(m_engine)); + return false; + } + + return true; + } + + QString getLanguageName(const QString &locale) + { + if (locale.startsWith(QLatin1String("ar"))) // (language == "ar_EG" || language == "ar_AR") + return QLatin1String("ar"); + else if (locale.startsWith(QLatin1String("fa"))) // (language == "fa_FA") + return QLatin1String("fa_IR"); + else if (locale.startsWith(QLatin1String("nb"))) + return QLatin1String("no_NO"); + else if (locale.startsWith(QLatin1String("sr"))) + return QLatin1String("sr_Cyrl_RS"); + else + return locale; + } + + QString getModeName(Qt::InputMethodHints inputMethodHints) + { + /* + * Qt::InputMethodHints flags description + * + * - Qt::ImhNone :0x00000000 + * - Qt::ImhHiddenText :0x00000001 + * - Qt::ImhSensitiveData :0x00000002 + * - Qt::ImhNoAutoUppercase :0x00000004 + * - Qt::ImhPreferNumbers :0x00000008 + * - Qt::ImhPreferUppercase :0x00000010 + * - Qt::ImhPreferLowercase :0x00000020 + * - Qt::ImhNoPredictiveText :0x00000040 + * - Qt::ImhDate :0x00000080 + * - Qt::ImhTime :0x00000100 + * - Qt::ImhPreferLatin :0x00000200 + * - Qt::ImhMultiLine :0x00000400 + * - Qt::ImhExclusiveInputMask :0xffff0000 + * - Qt::ImhDigitsOnly :0x00010000 + * - Qt::ImhFormattedNumbersOnly :0x00020000 + * - Qt::ImhUppercaseOnly :0x00040000 + * - Qt::ImhLowercaseOnly :0x00080000 + * - Qt::ImhDialableCharactersOnly :0x00100000 + * - Qt::ImhEmailCharactersOnly :0x00200000 + * - Qt::ImhUrlCharactersOnly :0x00400000 + * - Qt::ImhLatinOnly :0x00800000 + */ + + if (inputMethodHints & Qt::ImhDigitsOnly) + return QLatin1String("number-superimposed"); + + if (inputMethodHints & Qt::ImhFormattedNumbersOnly) + return QLatin1String("number-superimposed"); // "number-superimposed" is not correctly matched with Qt::ImhFormattedNumbersOnly + // temporary linked to "number-superimposed", need to improve it later on + + if (inputMethodHints & Qt::ImhDialableCharactersOnly) + return QLatin1String("phone_number-superimposed"); + + if (inputMethodHints & Qt::ImhEmailCharactersOnly) + return QLatin1String("email-superimposed"); + + if (inputMethodHints & Qt::ImhUrlCharactersOnly) + return QLatin1String("uri-superimposed"); + + return QLatin1String("text-superimposed"); + } + + bool setMode(const QString &locale, Qt::InputMethodHints inputMethodHints) + { + if (locale == m_locale && inputMethodHints == m_inputMethodHints) + return false; + + m_locale = locale; + m_inputMethodHints = inputMethodHints; + + qCDebug(qlcVKMyScript) << Q_FUNC_INFO << locale; + Q_ASSERT(m_engine != nullptr && m_recognizer != nullptr); + + QString language = getLanguageName(m_locale); + QString mode = getModeName(m_inputMethodHints); + + if (!voim_setMode(m_engine, m_recognizer, language.toStdString().c_str(), mode.toStdString().c_str()) && + voim_getError(m_engine) != VOIM_EC_NO_ERROR) { + qCCritical(qlcVKMyScript) << "voim_setMode() failed -" << getVoimErrorMessage(voim_getError(m_engine)); + return false; + } + + return true; + } + + bool commit(void) + { + qCDebug(qlcVKMyScript) << Q_FUNC_INFO; + Q_ASSERT(m_engine != nullptr && m_recognizer != nullptr); + + if (!voim_commit(m_engine, m_recognizer) && + voim_getError(m_engine) != VOIM_EC_NO_ERROR) { + qCCritical(qlcVKMyScript) << "voim_commit() failed -" << getVoimErrorMessage(voim_getError(m_engine)); + return false; + } + + stopCommitTimer(); + + return true; + } + + void destroyHwrEngine(void) + { + qCDebug(qlcVKMyScript) << Q_FUNC_INFO; + + cancelRecognition(); + + if (m_engine) { + if (m_recognizer) + voim_destroyRecognizer(m_engine, m_recognizer); + + if (m_languageManager) + voim_destroyLanguageManager(m_engine, m_languageManager); + + voim_destroyEngine(m_engine); + } + + m_threadController.reset(); + } + + bool checkFile(QString filename) + { + if (QFile::exists(filename)) { + return true; + } else { + return false; + } + } + + /****************************************************************************** + * The notificationCallback handles events raised by + * the worker thread of a recognizer + * + * Parameters: + * - engine : the VOIM engine + * - recognizer : the VOIM recognizer that sends the event. + * - eventType : the type of the event. + * - eventParameters : the parameters associated with the event, if any. + * - userParam : the userParameter that passed to + * voim_setNotificationCallback + *****************************************************************************/ + static void notificationCallback(voimEngine *engine, + voimRecognizer *recognizer, + voimEventType eventType, + const void *eventParameters, + void *userParam) + { + if (userParam) { + MyScriptInputMethodPrivate *pParent = static_cast<MyScriptInputMethodPrivate *>(userParam); + pParent->onNotify(engine, recognizer, eventType, eventParameters); + } + } + + /****************************************************************************** + * Event types of VOIM handwriting notification callback + * + * - VOIM_EVENT_ON_SET_MODE + * :Occurs when a mode change request has been taken into account. + * - VOIM_EVENT_ON_SET_POSITION_AND_SCALE_INDICATOR + * :Occurs when a guide line change request has been taken into account. + * - VOIM_EVENT_ON_SET_USER_DICTIONARY + * :Occurs when a user dictionary has been set to the recognizer. + * - VOIM_EVENT_ON_ADD_STROKE + * :Occurs when a new digital ink stroke has been added to + * the recognizer and received by the worker thread. + * - VOIM_EVENT_ON_RECOGNITION_START + * :Occurs when a recognition process starts. + * - VOIM_EVENT_ON_RECOGNITION_PROGRESS + * :Occurs during a recognition process. + * - VOIM_EVENT_ON_RECOGNITION_END + * :Occurs when a recognition process ends. + * - VOIM_EVENT_ON_COMMIT + * :Occurs when a commit request has been taken into account. + * - VOIM_EVENT_ON_CANCEL + * :Occurs when a cancel request has been taken into account. + * - VOIM_EVENT_ON_FLOW_SYNC + * :Occurs when a flow sync command is received by + * the recognizer worker thread. + * - VOIM_EVENT_ON_NEW_INPUT_ITEM + * :Occurs when a new input item command is received by + * the recognizer worker thread. + * - VOIM_EVENT_ON_ADD_STRING + * :Occurs when a new digital text string has been added + * to the recognizer and received by the worker thread. + *****************************************************************************/ + void onNotify(voimEngine *engine, voimRecognizer *recognizer, + voimEventType eventType, const void *eventParameters) + { + Q_UNUSED(recognizer); + + switch (eventType) { + + case VOIM_EVENT_ON_SET_MODE: + { + /* + * voimSetModeParameters + * + * voimLanguage *language - The language that contains the handwriting mode + * int modeIndex - The index of the mode in the language + * bool successful - True if the operation was successful + */ + const voimSetModeParameters *p = (const voimSetModeParameters *)eventParameters; + + if (p->successful) { + QString language = QString::fromUtf8(voim_getLanguageName(engine, p->language)); + QString mode = QString::fromUtf8(voim_getLanguageModeNameAt(engine, p->language, p->modeIndex)); + + qCDebug(qlcVKMyScript) << "a mode" << language << "/" << mode << + "has been set, ready to receive strokes"; + } else { + qCCritical(qlcVKMyScript) << "failed to set mode"; + } + } + break; + + case VOIM_EVENT_ON_SET_POSITION_AND_SCALE_INDICATOR: + { + /* + * voimSetPositionAndScaleIndicatorParameters + * + * float baselinePosition - The baseline position + * float xHeight - The height of small letter x + * float lineSpacing - The line spacing + * bool successful - True if the operation was successful + */ + const voimSetPositionAndScaleIndicatorParameters *p = (const voimSetPositionAndScaleIndicatorParameters *)eventParameters; + + if (p->successful) { + qCDebug(qlcVKMyScript) << "baselinePosition \"" << p->baselinePosition << "\", " << + "xHeight \"" << p->xHeight << "\", " << + "lineSpacing \"" << p->lineSpacing << "\" have been set"; + } else { + qCCritical(qlcVKMyScript) << "failed to set position and scale indicator"; + } + } + break; + + case VOIM_EVENT_ON_SET_USER_DICTIONARY: + { + /* + * voimSetUserDictionaryParameters + * + * voimDictionary *dictionary - The dictionary + * bool successful - True if the operation was successful + */ + const voimSetUserDictionaryParameters *p = (const voimSetUserDictionaryParameters *)eventParameters; + + if (p->successful) + qCDebug(qlcVKMyScript) << "user dictionary has been set"; + else + qCCritical(qlcVKMyScript) << "failed to set user dictionary"; + } + break; + + case VOIM_EVENT_ON_ADD_STROKE: + { + /* + * voimAddStrokeParameters + * + * int sessionIndex - The index of the recognition session + * int strokeIndex - The index of the stroke in the recognition session + * bool successful - True if the operation was successful + */ + const voimAddStrokeParameters *p = (const voimAddStrokeParameters *)eventParameters; + + if (p->successful) { + qCDebug(qlcVKMyScript) << "a stroke with sessionIndex \"" << p->sessionIndex << "\", " << + "strokeIndex \"" << p->strokeIndex << "\" has been added"; + } else { + qCCritical(qlcVKMyScript) << "failed to add stroke"; + } + } + break; + + case VOIM_EVENT_ON_RECOGNITION_START: + { + /* + * voimRecognitionStartParameters + * + * int firstStrokeIndex - The index of the first new stroke to be recognized + * int sessionIndex - The index of the recognition session + * int strokeCount - The number of new strokes to be recognized + */ + const voimRecognitionStartParameters *p = (const voimRecognitionStartParameters *)eventParameters; + + qCDebug(qlcVKMyScript) << "recognition started at sessionIndex \"" << p->sessionIndex << "\", " << + "firstStrokeIndex \"" << p->firstStrokeIndex << "\", " << + "strokeCount \"" << p->strokeCount << "\""; + + m_isProcessing = true; + } + break; + + case VOIM_EVENT_ON_RECOGNITION_PROGRESS: + { + /* + * voimRecognitionProgressParameters + * + * int amountDone - The current amount of work done + * int amountToDo - The current amount of work to do + */ + const voimRecognitionProgressParameters *p = (const voimRecognitionProgressParameters *)eventParameters; + + if (p->amountDone == p->amountToDo) + qCDebug(qlcVKMyScript) << "progress recognition, " << p->amountDone << "/" << p->amountToDo; + } + break; + + case VOIM_EVENT_ON_RECOGNITION_END: + { + /* + * voimRecognitionEndParameters + * + * bool successful - True if the operation was successful + */ + const voimRecognitionEndParameters *p = (const voimRecognitionEndParameters *)eventParameters; + + if (p->successful) { + qCDebug(qlcVKMyScript) << "recognition has been ended"; + + if (!m_onManagingResult) { + m_onManagingResult = true; + if (m_threadController) { + m_threadController->emitRecognitionEnded(); + } + } + } else { + qCCritical(qlcVKMyScript) << "failed to finish recognition"; + } + } + break; + + case VOIM_EVENT_ON_COMMIT: + { + /* + * voimCommitParameters + * + * bool successful - True if the operation was successful + */ + const voimCommitParameters *p = (const voimCommitParameters *)eventParameters; + + if (p->successful) { + qCDebug(qlcVKMyScript) << "recognition has been committed"; + + if (m_threadController) { + m_threadController->emitRecognitionCommitted(); + } + } else { + qCCritical(qlcVKMyScript) << "failed to commit recognition"; + } + } + break; + + case VOIM_EVENT_ON_CANCEL: + { + /* + * voimCancelParameters + * + * bool successful - True if the operation was successful + */ + const voimCancelParameters *p = (const voimCancelParameters *)eventParameters; + + if (p->successful) + qCDebug(qlcVKMyScript) << "recognition has been canceled"; + else + qCCritical(qlcVKMyScript) << "failed to cancel recognition"; + } + break; + + case VOIM_EVENT_ON_FLOW_SYNC: + { + /* + * voimFlowSyncParameters + * + * int intValue - The integer value that was passed to the voim_flowSync() function + */ + const voimFlowSyncParameters *p = (const voimFlowSyncParameters *)eventParameters; + + qCDebug(qlcVKMyScript) << "voim_flowSync() has been called with value \"" << p->intValue << "\""; + } + break; + + case VOIM_EVENT_ON_NEW_INPUT_ITEM: + { + /* + * voimNewInputItemParameters + * + * bool successful - True if the operation was successful + */ + const voimNewInputItemParameters *p = (const voimNewInputItemParameters *)eventParameters; + + if (p->successful) + qCDebug(qlcVKMyScript) << "new recognition session being created while remaining in the current session"; + else + qCCritical(qlcVKMyScript) << "failed to create new recogniiton session"; + } + break; + + case VOIM_EVENT_ON_ADD_STRING: + { + /* + * [Note that the parameters are same as that of the VOIM_EVENT_ON_ADD_STROKE event + * because references to it in the result work the same (using stroke index + * for string and point index for its characters)] + * + * voimAddStrokeParameters + * + * int sessionIndex - The index of the recognition session + * int strokeIndex - The index of the stroke in the recognition session + * bool successful - True if the operation was successful + */ + const voimAddStrokeParameters *p = (const voimAddStrokeParameters *)eventParameters; + + if (p->successful) { + qCDebug(qlcVKMyScript) << "a stroke with sessionIndex \"" << p->sessionIndex << "\", " << + "strokeIndex \"" << p->strokeIndex << "\" has been added"; + } else { + qCCritical(qlcVKMyScript) << "failed to add string"; + } + } + break; + + default: + break; + } + } + + void updateCandidateView(void) + { + Q_Q(MyScriptInputMethod); + + emit q->selectionListChanged(SelectionListModel::WordCandidateList); + emit q->selectionListActiveItemChanged(SelectionListModel::WordCandidateList, wordIndex); + } + + void updatePreeditTextCursor(int cursorPosition) + { + Q_Q(MyScriptInputMethod); + + InputContext *ic = q->inputContext(); + if (!ic) + return; + + qCDebug(qlcVKMyScript) << Q_FUNC_INFO; + qCDebug(qlcVKMyScript) << "preeditText:" << ic->preeditText(); + + bool isItemChanged = false; + int lastPosition = 0; + QVector<std::pair<int, CandidateItem *>>::const_iterator iter; + + for (iter = m_items.cbegin(); iter != m_items.cend(); iter++) { + int itemIndex = iter->first; + CandidateItem *candidateItem = iter->second; + int candidateIndex = candidateItem->candidateIndex; + QString candidate = candidateItem->candidates.at(candidateIndex); + + lastPosition += candidate.length(); + if (candidate != " " && cursorPosition <= lastPosition) { + m_itemStartPosition = lastPosition - candidate.length(); + m_itemLength = candidate.length(); + + if (m_itemIndex != itemIndex) { + clearCandidates(); + word = candidate; + wordIndex = candidateIndex; + wordCandidates = candidateItem->candidates; + + m_itemIndex = itemIndex; + isItemChanged = true; + } + + break; + } + } + + if (isItemChanged) + updateCandidateView(); + } + + MyScriptInputMethod *q_ptr; + + QScopedPointer<MyScriptRecognizeController> m_threadController; + + voimEngine *m_engine; + voimLanguageManager *m_languageManager; + voimRecognizer *m_recognizer; + bool m_onManagingResult; + bool m_isProcessing; + int m_commitTimer; + + QList<Trace *> traceList; + + InputEngine::TextCase textCase; + QStringList wordCandidates; + QString word; + int wordIndex; + + int m_itemIndex; + int m_itemStartPosition; + int m_itemLength; + QVector<std::pair<int, CandidateItem *>> m_items; + + QString m_locale; + Qt::InputMethodHints m_inputMethodHints; + + int m_preeditCursorPosition; +}; + +/*! + \class QtVirtualKeyboard::MyScriptInputMethod + \internal +*/ + +MyScriptInputMethod::MyScriptInputMethod(QObject *parent) : + AbstractInputMethod(parent), + d_ptr(new MyScriptInputMethodPrivate(this)) +{ + connect(this, SIGNAL(preeditTextChanged(QString, bool, int, int, int)), this, SLOT(setPreeditText(QString, bool, int, int, int))); + connect(this, SIGNAL(gestureDetected(int, int)), this, SLOT(doGestureAction(int, int))); +} + +MyScriptInputMethod::~MyScriptInputMethod() +{ + +} + +QList<InputEngine::InputMode> MyScriptInputMethod::inputModes(const QString &locale) +{ + Q_UNUSED(locale); + return QList<InputEngine::InputMode>() + << InputEngine::Latin; +} + +bool MyScriptInputMethod::setInputMode(const QString &locale, InputEngine::InputMode inputMode) +{ + Q_UNUSED(inputMode); + Q_D(MyScriptInputMethod); + InputContext *ic = inputContext(); + if (d->setMode(locale, ic->inputMethodHints())) { + d->m_locale = locale; + return true; + } + return false; +} + +bool MyScriptInputMethod::setTextCase(InputEngine::TextCase textCase) +{ + Q_D(MyScriptInputMethod); + d->textCase = textCase; + return true; +} + +bool MyScriptInputMethod::keyEvent(Qt::Key key, const QString &text, Qt::KeyboardModifiers modifiers) +{ + Q_UNUSED(text); + Q_UNUSED(modifiers); + + Q_D(MyScriptInputMethod); + switch (key) { + case Qt::Key_Backspace: + d->handleBackspace(); + break; + default: + d->cancelRecognition(); + if (inputContext()) + inputContext()->commit(); + break; + } + return false; +} + +void MyScriptInputMethod::reset() +{ + InputContext *ic = inputContext(); + if (ic) { + Q_D(MyScriptInputMethod); + d->clearCandidates(); + ic->commit(); + } +} + +void MyScriptInputMethod::update() +{ + Q_D(MyScriptInputMethod); + if (d->m_isProcessing) + d->cancelRecognition(); + + reset(); +} + +QList<SelectionListModel::Type> MyScriptInputMethod::selectionLists() +{ + return QList<SelectionListModel::Type>() << SelectionListModel::WordCandidateList; +} + +int MyScriptInputMethod::selectionListItemCount(SelectionListModel::Type type) +{ + Q_D(MyScriptInputMethod); + + if (type != SelectionListModel::WordCandidateList) + return 0; + + return d->wordCandidates.count(); +} + +QVariant MyScriptInputMethod::selectionListData(SelectionListModel::Type type, int index, int role) +{ + Q_D(MyScriptInputMethod); + + if (type != SelectionListModel::WordCandidateList) + return QVariant(); + + switch (role) { + case SelectionListModel::DisplayRole: + return QVariant(d->wordCandidates.at(index)); + case SelectionListModel::WordCompletionLengthRole: + { + const QString wordCandidate(d->wordCandidates.at(index)); + int wordCompletionLength = wordCandidate.length() - d->word.length(); + return QVariant((wordCompletionLength > 0 && wordCandidate.startsWith(d->word)) ? wordCompletionLength : 0); + } + default: + return AbstractInputMethod::selectionListData(type, index, role); + } +} + +void MyScriptInputMethod::selectionListItemSelected(SelectionListModel::Type type, int index) +{ + Q_D(MyScriptInputMethod); + + if (d->m_isProcessing) + return; + + InputContext *ic = inputContext(); + if (!ic) + return; + + qCDebug(qlcVKMyScript) << Q_FUNC_INFO; + + AbstractInputMethod::selectionListItemSelected(type, index); + + int itemIndex = d->m_itemIndex; + CandidateItem *candidateItem = d->m_items.at(itemIndex).second; + + QString candidate = candidateItem->candidates.at(index); + candidateItem->candidateIndex = index; + + QString label = ic->preeditText(); + label.replace(d->m_itemStartPosition, d->m_itemLength, candidate); + setPreeditText(label, true, d->m_preeditCursorPosition, d->m_itemStartPosition, candidate.length()); + + d->updatePreeditTextCursor(d->m_preeditCursorPosition); +} + +QList<InputEngine::PatternRecognitionMode> MyScriptInputMethod::patternRecognitionModes() const +{ + return QList<InputEngine::PatternRecognitionMode>() + << InputEngine::HandwritingRecoginition; +} + +Trace *MyScriptInputMethod::traceBegin(int traceId, InputEngine::PatternRecognitionMode patternRecognitionMode, + const QVariantMap &traceCaptureDeviceInfo, const QVariantMap &traceScreenInfo) +{ + Q_D(MyScriptInputMethod); + + return d->traceBegin(traceId, patternRecognitionMode, traceCaptureDeviceInfo, traceScreenInfo); +} + +bool MyScriptInputMethod::traceEnd(Trace *trace) +{ + Q_D(MyScriptInputMethod); + + d->traceEnd(trace); + return true; +} + +bool MyScriptInputMethod::clickPreeditText(int cursorPosition) +{ + Q_D(MyScriptInputMethod); + + if (d->m_isProcessing) + return true; + + InputContext *ic = inputContext(); + if (ic) { + setPreeditText(ic->preeditText(), true, cursorPosition); + } + + return true; +} + +void MyScriptInputMethod::timerEvent(QTimerEvent *timerEvent) +{ + Q_D(MyScriptInputMethod); + + if (timerEvent->timerId() == d->m_commitTimer) { + d->commit(); + } +} + +void MyScriptInputMethod::setPreeditText(QString label, bool isCommitted, int cursorPosition, int highlightStart, int highlightLength) +{ + Q_D(MyScriptInputMethod); + qCDebug(qlcVKMyScript) << Q_FUNC_INFO; + + QList<QInputMethodEvent::Attribute> attributes; + QBrush foreground = isCommitted ? QBrush(Qt::black) : QBrush(Qt::blue); + QBrush backgroundNormal = QBrush(Qt::white); + QBrush backgroundHighlight = QBrush(QColor(0x66, 0xCD, 0xAA)); + + QTextCharFormat textFormat; + textFormat.setUnderlineStyle(QTextCharFormat::SingleUnderline); + attributes.append(QInputMethodEvent::Attribute(QInputMethodEvent::TextFormat, 0, label.length(), textFormat)); + + int highlightEnd = highlightStart + highlightLength; + if (highlightLength > 0 && highlightStart <= label.length() && highlightEnd <= label.length()) { + + if (highlightStart > 0) { + QTextCharFormat normal; + normal.setBackground(backgroundNormal); + normal.setForeground(foreground); + attributes.append(QInputMethodEvent::Attribute(QInputMethodEvent::TextFormat, 0, highlightStart, normal)); + } + + QTextCharFormat highlight; + highlight.setBackground(backgroundHighlight); + highlight.setForeground(foreground); + attributes.append(QInputMethodEvent::Attribute(QInputMethodEvent::TextFormat, highlightStart, highlightLength, highlight)); + + if (highlightEnd < label.length()) { + QTextCharFormat normal; + int highlightLength = label.length() - highlightEnd; + normal.setBackground(backgroundNormal); + normal.setForeground(foreground); + attributes.append(QInputMethodEvent::Attribute(QInputMethodEvent::TextFormat, highlightEnd, highlightLength, normal)); + } + } else { + + QTextCharFormat normal; + normal.setBackground(backgroundNormal); + normal.setForeground(foreground); + attributes.append(QInputMethodEvent::Attribute(QInputMethodEvent::TextFormat, 0, label.length(), normal)); + } + + d->m_preeditCursorPosition = (cursorPosition != -1) ? cursorPosition : label.length(); + attributes.append(QInputMethodEvent::Attribute(QInputMethodEvent::Cursor, d->m_preeditCursorPosition, 1, QVariant())); + + inputContext()->setPreeditText(label, attributes); + if (isCommitted) { + Q_D(MyScriptInputMethod); + d->updatePreeditTextCursor(d->m_preeditCursorPosition); + } +} + +void MyScriptInputMethod::doGestureAction(const int gestureType, const int gestureCount) +{ + qCDebug(qlcVKMyScript) << Q_FUNC_INFO; + + Q_D(MyScriptInputMethod); + d->cancelRecognition(); + + InputContext *ic = inputContext(); + if (ic) { + switch (gestureType) { + case GESTURE_TYPE_LEFT_TO_RIGHT: + if (d->m_locale.contains("ar")) { + ic->inputEngine()->virtualKeyClick(Qt::Key_Backspace, QString(), Qt::NoModifier); + } else { + for (int i = 0; i < gestureCount; i++) + ic->inputEngine()->virtualKeyClick(Qt::Key_Space, QLatin1String(" "), Qt::NoModifier); + } + break; + + case GESTURE_TYPE_RIGHT_TO_LEFT: + if (d->m_locale.contains("ar")) { + for (int i = 0; i < gestureCount; i++) + ic->inputEngine()->virtualKeyClick(Qt::Key_Space, QLatin1String(" "), Qt::NoModifier); + } else { + ic->inputEngine()->virtualKeyClick(Qt::Key_Backspace, QString(), Qt::NoModifier); + } + break; + + case GESTURE_TYPE_DOWN_THEN_LEFT: + if (!d->m_locale.contains("ar")) + ic->inputEngine()->virtualKeyClick(Qt::Key_Return, QString(), Qt::NoModifier); + break; + + case GESTURE_TYPE_DOWN_THEN_RIGHT: + if (d->m_locale.contains("ar")) + ic->inputEngine()->virtualKeyClick(Qt::Key_Return, QString(), Qt::NoModifier); + break; + } + } +} + +MyScriptRecognizeWorker::MyScriptRecognizeWorker(voimEngine *engine, voimRecognizer *recognizer) + : QObject() + , m_engine(engine) + , m_recognizer(recognizer) + , m_resultLabel(QString()) +{ +} + +void MyScriptRecognizeWorker::manageRecognitionEnded() { + qCDebug(qlcVKMyScript) << "recognition has been ended (thread)"; + manageRecognitionResult(m_engine, m_recognizer, false); +} + +void MyScriptRecognizeWorker::manageRecognitionCommitted() { + qCDebug(qlcVKMyScript) << "recognition has been committed (thread)"; + manageRecognitionResult(m_engine, m_recognizer, true); +} + +void MyScriptRecognizeWorker::manageRecognitionResult(voimEngine *engine, voimRecognizer *recognizer, const bool isCommitted) +{ + Q_ASSERT(engine != nullptr && recognizer != nullptr); + + voimResult *result = voim_getResult(engine, recognizer, false, true); + if (result != NULL) { + + QString resultLabel = ""; + qCDebug(qlcVKMyScript) << ">>> recognition result"; + + QStringList wordCandidates; + QString word; + int wordIndex = -1; + + int gestureType = GESTURE_TYPE_NONE; + int gestureCount = 1; + + emit clearItem(); + + int itemCount = voim_getItemCount(engine, result); + for (int itemIndex = 0; itemIndex < itemCount; itemIndex++) { + + wordCandidates.clear(); + word = QString(); + wordIndex = -1; + + qCDebug(qlcVKMyScript) << " * item #" << itemIndex << " of " << itemCount; + + int candidateCount = voim_getItemCandidateCount(engine, result, itemIndex); + for (int candidateIndex = 0; candidateIndex < candidateCount; candidateIndex++) { + + int length = voim_getItemCandidateLabel(engine, result, itemIndex, candidateIndex, nullptr, 0, "UTF-8"); + + if (length > 0) { + + std::vector<char> bytes(length + 1); + char *temp = bytes.data(); + + voim_getItemCandidateLabel(engine, result, itemIndex, candidateIndex, temp, length, "UTF-8"); + float score = voim_getItemCandidateScore(engine, result, itemIndex, candidateIndex); + qCDebug(qlcVKMyScript) << " - candidate #" << candidateIndex << " of " << candidateCount << " :" << temp << "(" << score << ")"; + + QString label = QString::fromUtf8(temp); + + if (candidateIndex == 0) { + gestureType = isGesture(label); + + if (gestureType == GESTURE_TYPE_NONE) { + resultLabel += label; + } else { + gestureCount = label.length() / QString::fromStdString(GESTURE_STRING_LEFT_TO_RIGHT).length(); + break; + } + } + + if (isGesture(label) == GESTURE_TYPE_NONE) { + if (wordIndex == -1) { + word = label; + wordIndex = candidateIndex; + } + + wordCandidates << label; + } + } + } + + if (gestureType != GESTURE_TYPE_NONE) + break; + + emit newItem(itemIndex, wordIndex, wordCandidates); + } + + voim_destroyResult(m_engine, result); + + if (gestureType != GESTURE_TYPE_NONE) { + emit clearTraces(); + emit gestureDetected(gestureType, gestureCount); + } else { + m_resultLabel = resultLabel; + emit preeditChanged(m_resultLabel, false); + emit newCandidates(wordCandidates, word, wordIndex); + } + + } else if (result == NULL && voim_getError(m_engine) != VOIM_EC_NO_ERROR) { + qCCritical(qlcVKMyScript) << "voim_getResult() failed -" << getVoimErrorMessage(voim_getError(m_engine)); + } + + emit recognitionEnded(); + + if (isCommitted) { + emit clearTraces(); + emit preeditChanged(m_resultLabel, true); + emit recognitionCommitted(); + } +} + +int MyScriptRecognizeWorker::isGesture(const QString label) +{ + if (label.length() < 2) + return GESTURE_TYPE_NONE; + + if (label.contains(QString::fromUtf8(GESTURE_STRING_RIGHT_TO_LEFT))) + return GESTURE_TYPE_RIGHT_TO_LEFT; + + if (label.contains(QString::fromUtf8(GESTURE_STRING_LEFT_TO_RIGHT))) + return GESTURE_TYPE_LEFT_TO_RIGHT; + + if (label.contains(QString::fromUtf8(GESTURE_STRING_DOWN_THEN_LEFT))) + return GESTURE_TYPE_DOWN_THEN_LEFT; + + if (label.contains(QString::fromUtf8(GESTURE_STRING_DOWN_THEN_RIGHT))) + return GESTURE_TYPE_DOWN_THEN_RIGHT; + + return GESTURE_TYPE_NONE; +} + +MyScriptRecognizeController::MyScriptRecognizeController(MyScriptInputMethodPrivate *d_, voimEngine *engine, voimRecognizer *recognizer) + : QObject() + , d(d_) +{ + MyScriptRecognizeWorker *worker = new MyScriptRecognizeWorker(engine, recognizer); + worker->moveToThread(&workerThread); + connect(&workerThread, &QThread::finished, worker, &QObject::deleteLater); + connect(this, &MyScriptRecognizeController::recognitionEnded, worker, &MyScriptRecognizeWorker::manageRecognitionEnded); + connect(this, &MyScriptRecognizeController::recognitionCommitted, worker, &MyScriptRecognizeWorker::manageRecognitionCommitted); + connect(worker, &MyScriptRecognizeWorker::recognitionEnded, this, &MyScriptRecognizeController::handleRecognitionEnded); + connect(worker, &MyScriptRecognizeWorker::recognitionCommitted, this, &MyScriptRecognizeController::handleRecognitionCommitted); + connect(worker, &MyScriptRecognizeWorker::gestureDetected, this, &MyScriptRecognizeController::handelGestureDetected); + connect(worker, &MyScriptRecognizeWorker::preeditChanged, this, &MyScriptRecognizeController::handlePreeditChanged); + connect(worker, &MyScriptRecognizeWorker::clearItem, this, &MyScriptRecognizeController::handleClearItem); + connect(worker, &MyScriptRecognizeWorker::newItem, this, &MyScriptRecognizeController::handleNewItem); + connect(worker, &MyScriptRecognizeWorker::newCandidates, this, &MyScriptRecognizeController::handleNewCandidates); + connect(worker, &MyScriptRecognizeWorker::clearTraces, this, &MyScriptRecognizeController::handleClearTraces); + workerThread.start(); +} + +MyScriptRecognizeController::~MyScriptRecognizeController() +{ + workerThread.quit(); + workerThread.wait(); +} + +void MyScriptRecognizeController::emitRecognitionEnded() +{ + emit recognitionEnded(); +} + +void MyScriptRecognizeController::emitRecognitionCommitted() +{ + emit recognitionCommitted(); +} + +void MyScriptRecognizeController::handleRecognitionEnded() +{ + qCDebug(qlcVKMyScript) << Q_FUNC_INFO; + d->m_onManagingResult = false; +} + +void MyScriptRecognizeController::handleRecognitionCommitted() +{ + qCDebug(qlcVKMyScript) << Q_FUNC_INFO; + d->m_isProcessing = false; +} + +void MyScriptRecognizeController::handelGestureDetected(const int gestureType, const int gestureCount) +{ + qCDebug(qlcVKMyScript) << Q_FUNC_INFO; + emit d->q_ptr->gestureDetected(gestureType, gestureCount); +} + +void MyScriptRecognizeController::handlePreeditChanged(const QString &preedit, const bool isCommitted) +{ + emit d->q_ptr->preeditTextChanged(preedit, isCommitted, -1, 0, 0); +} + +void MyScriptRecognizeController::handleClearItem() +{ + d->clearItems(); +} + +void MyScriptRecognizeController::handleNewItem(const int itemIndex, const int candidateIndex, const QStringList &candidates) +{ + CandidateItem *candidateItem = new CandidateItem; + + candidateItem->candidateIndex = candidateIndex; + candidateItem->candidates = candidates; + + d->m_items.push_back(std::make_pair(itemIndex, candidateItem)); + + d->m_itemIndex = itemIndex; +} + +void MyScriptRecognizeController::handleNewCandidates(const QStringList &candidates, const QString &word, int wordIndex) +{ + d->wordCandidates = candidates; + d->word = word; + d->wordIndex = wordIndex; + + if (!word.isEmpty() && word != " " && word != "\u00A0") { + d->updateCandidateView(); + } +} + +void MyScriptRecognizeController::handleClearTraces() +{ + d->clearTraces(); +} + +} // namespace QtVirtualKeyboard +QT_END_NAMESPACE diff --git a/src/plugins/myscript/plugin/myscriptinputmethod_p.h b/src/plugins/myscript/plugin/myscriptinputmethod_p.h new file mode 100644 index 00000000..d62523b1 --- /dev/null +++ b/src/plugins/myscript/plugin/myscriptinputmethod_p.h @@ -0,0 +1,104 @@ +/**************************************************************************** +** +** Copyright (C) MyScript. Contact: https://www.myscript.com/about/contact-us/sales-inquiry/ +** Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB). Contact: https://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Qt Virtual Keyboard module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:GPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 or (at your option) any later version +** approved by the KDE Free Qt Foundation. The licenses are as published by +** the Free Software Foundation and appearing in the file LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef MYSCRIPTINPUTMETHOD_P_H +#define MYSCRIPTINPUTMETHOD_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include <QtVirtualKeyboard/abstractinputmethod.h> + +QT_BEGIN_NAMESPACE +namespace QtVirtualKeyboard { + +class MyScriptInputMethodPrivate; + +class MyScriptInputMethod : public AbstractInputMethod +{ + Q_OBJECT + Q_DECLARE_PRIVATE(MyScriptInputMethod) + Q_PROPERTY(bool superimposed READ superimposed CONSTANT) +public: + explicit MyScriptInputMethod(QObject *parent = nullptr); + ~MyScriptInputMethod(); + + QList<InputEngine::InputMode> inputModes(const QString &locale) override; + bool setInputMode(const QString &locale, InputEngine::InputMode inputMode) override; + bool setTextCase(InputEngine::TextCase textCase) override; + + bool keyEvent(Qt::Key key, const QString &text, Qt::KeyboardModifiers modifiers) override; + + void reset() override; + void update() override; + + QList<SelectionListModel::Type> selectionLists() override; + int selectionListItemCount(SelectionListModel::Type type) override; + QVariant selectionListData(SelectionListModel::Type type, int index, int role) override; + void selectionListItemSelected(SelectionListModel::Type type, int index) override; + + QList<InputEngine::PatternRecognitionMode> patternRecognitionModes() const override; + Trace *traceBegin(int traceId, InputEngine::PatternRecognitionMode patternRecognitionMode, + const QVariantMap &traceCaptureDeviceInfo, const QVariantMap &traceScreenInfo) override; + bool traceEnd(Trace *trace) override; + + bool clickPreeditText(int cursorPosition) override; + + bool superimposed() const { return true; } + +protected: + void timerEvent(QTimerEvent *timerEvent) override; + +Q_SIGNALS: + void preeditTextChanged(QString label, bool isCommitted, int cursorPosition, int highlightStart, int highlightEnd); + void recognitionCommitted(const int gestureType); + void gestureDetected(const int gestureType, const int gestureCount); + +protected Q_SLOTS: + void setPreeditText(QString label, bool isCommitted, int cursorPosition = -1, int highlightStart = 0, int highlightLength = 0); + void doGestureAction(const int gestureType, const int gestureCount); + +private: + QScopedPointer<MyScriptInputMethodPrivate> d_ptr; +}; + +} // namespace QtVirtualKeyboard +QT_END_NAMESPACE + +#endif diff --git a/src/plugins/myscript/plugin/myscriptinputmethod_p_p.h b/src/plugins/myscript/plugin/myscriptinputmethod_p_p.h new file mode 100644 index 00000000..7118e6ff --- /dev/null +++ b/src/plugins/myscript/plugin/myscriptinputmethod_p_p.h @@ -0,0 +1,122 @@ +/**************************************************************************** +** +** Copyright (C) MyScript. Contact: https://www.myscript.com/about/contact-us/sales-inquiry/ +** Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB). Contact: https://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Qt Virtual Keyboard module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:GPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 or (at your option) any later version +** approved by the KDE Free Qt Foundation. The licenses are as published by +** the Free Software Foundation and appearing in the file LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef MYSCRIPTINPUTMETHOD_P_P_H +#define MYSCRIPTINPUTMETHOD_P_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include <QObject> +#include <QString> +#include <QThread> +#include <QVector> + +typedef struct VOIM_ENGINE voimEngine; +typedef struct VOIM_RECOGNIZER voimRecognizer; +typedef struct CANDIDATE_ITEM CandidateItem; + +QT_BEGIN_NAMESPACE +namespace QtVirtualKeyboard { + +class MyScriptRecognizeWorker : public QObject +{ + Q_OBJECT + +public: + MyScriptRecognizeWorker(voimEngine* engine, voimRecognizer* recognizer); + +public slots: + void manageRecognitionEnded(); + void manageRecognitionCommitted(); + +signals: + void recognitionEnded(); + void recognitionCommitted(); + void gestureDetected(const int gestureType, const int gestureCount); + void preeditChanged(const QString &preedit, const bool isCommitted); + void clearItem(); + void newItem(const int itemIndex, const int candidateIndex, const QStringList &candidates); + void newCandidates(const QStringList &candidates, const QString &word, int wordIndex); + void clearTraces(); + +private: + void manageRecognitionResult(voimEngine *engine, voimRecognizer *recognizer, const bool isCommitted); + int isGesture(const QString label); + + voimEngine* m_engine; + voimRecognizer* m_recognizer; + QString m_resultLabel; +}; + +class MyScriptInputMethodPrivate; + +class MyScriptRecognizeController : public QObject +{ + Q_OBJECT +public: + MyScriptRecognizeController(MyScriptInputMethodPrivate *d, voimEngine *engine, voimRecognizer *recognizer); + ~MyScriptRecognizeController(); + + void emitRecognitionEnded(); + void emitRecognitionCommitted(); + +public slots: + void handleRecognitionEnded(); + void handleRecognitionCommitted(); + void handelGestureDetected(const int gestureType, const int gestureCount); + void handlePreeditChanged(const QString &preedit, const bool isCommitted); + void handleClearItem(); + void handleNewItem(const int itemIndex, const int candidateIndex, const QStringList &candidates); + void handleNewCandidates(const QStringList &candidates, const QString &word, int wordIndex); + void handleClearTraces(); + +signals: + void recognitionEnded(); + void recognitionCommitted(); + +private: + QThread workerThread; + MyScriptInputMethodPrivate *d; +}; + +} // namespace QtVirtualKeyboard +QT_END_NAMESPACE + +#endif // MYSCRIPTINPUTMETHOD_P_P_H diff --git a/src/plugins/myscript/plugin/myscriptplugin.cpp b/src/plugins/myscript/plugin/myscriptplugin.cpp new file mode 100644 index 00000000..1d7091ca --- /dev/null +++ b/src/plugins/myscript/plugin/myscriptplugin.cpp @@ -0,0 +1,43 @@ +/**************************************************************************** +** +** Copyright (C) 2018 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Qt Virtual Keyboard module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:GPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 or (at your option) any later version +** approved by the KDE Free Qt Foundation. The licenses are as published by +** the Free Software Foundation and appearing in the file LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "myscriptplugin.h" +#include "myscriptinputmethod_p.h" +#include <QtQml> + +QT_BEGIN_NAMESPACE + +using namespace QtVirtualKeyboard; + +void MyScriptPlugin::registerTypes(const char *uri) const +{ + qmlRegisterType<MyScriptInputMethod>(uri, 2, 0, "HandwritingInputMethod"); +} + +QT_END_NAMESPACE diff --git a/src/plugins/myscript/plugin/myscriptplugin.h b/src/plugins/myscript/plugin/myscriptplugin.h new file mode 100644 index 00000000..bf76807a --- /dev/null +++ b/src/plugins/myscript/plugin/myscriptplugin.h @@ -0,0 +1,49 @@ +/**************************************************************************** +** +** Copyright (C) 2018 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Qt Virtual Keyboard module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:GPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 or (at your option) any later version +** approved by the KDE Free Qt Foundation. The licenses are as published by +** the Free Software Foundation and appearing in the file LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef MYSCRIPTPLUGIN_H +#define MYSCRIPTPLUGIN_H + +#include <QVirtualKeyboardExtensionPlugin> + +QT_BEGIN_NAMESPACE + +class MyScriptPlugin : public QVirtualKeyboardExtensionPlugin +{ + Q_OBJECT + Q_INTERFACES(QVirtualKeyboardExtensionPlugin) + Q_PLUGIN_METADATA(IID QVirtualKeyboardExtensionPluginFactoryInterface_iid + FILE "myscript.json") +public: + void registerTypes(const char *uri) const; +}; + +QT_END_NAMESPACE + +#endif diff --git a/src/plugins/myscript/plugin/plugin.pro b/src/plugins/myscript/plugin/plugin.pro new file mode 100644 index 00000000..b4ee463e --- /dev/null +++ b/src/plugins/myscript/plugin/plugin.pro @@ -0,0 +1,108 @@ +TARGET = qtvirtualkeyboard_myscript +QT += qml virtualkeyboard + +include(../../../config.pri) + +equals(MYSCRIPT_FOUND, 0): \ + error("MyScript SDK could not be found. For more information, see" \ + "the documentation in Building Qt Virtual Keyboard") +HEADERS += \ + myscriptplugin.h \ + myscriptinputmethod_p.h \ + myscriptinputmethod_p_p.h +SOURCES += \ + myscriptplugin.cpp \ + myscriptinputmethod.cpp \ + $$MYSCRIPT_PATH/voim/api/c/examples/common/Properties.c \ + $$MYSCRIPT_PATH/voim/api/c/examples/common/PortabilityDefinitions.c +OTHER_FILES += \ + myscript.json +INCLUDEPATH += \ + $$MYSCRIPT_PATH/voim/api/c/include \ + $$MYSCRIPT_PATH/voim/api/c/examples +MYSCRIPT_DATA = qtvirtualkeyboard/myscript +DEFINES += MYSCRIPT_CERTIFICATE=\\\"$$MYSCRIPT_PATH/edk/c/examples/certificates/MyCertificate.c\\\" +DEFINES += MYSCRIPT_VOIM_PROPERTY_PATH=\\\"$$MYSCRIPT_DATA/$$MYSCRIPT_VOIM_CONF\\\" +DEFINES += MYSCRIPT_LANGUAGE_CONF_PATH=\\\"$$MYSCRIPT_DATA/$$MYSCRIPT_LANGUAGE_CONF\\\" +DEFINES += MYSCRIPT_VOIM_NAME=\\\"$${MYSCRIPT_LIB_PREFIX}voim$${MYSCRIPT_LIB_SUFFIX}\\\" +DEFINES += MYSCRIPT_ENGINE_NAME=\\\"$${MYSCRIPT_LIB_PREFIX}MyScriptEngine$${MYSCRIPT_LIB_SUFFIX}\\\" +LIBS += $$MYSCRIPT_VOIM_LIB +unix:linux:!android: QMAKE_RPATHDIR += $$MYSCRIPT_PATH/$$MYSCRIPT_VOIM_PATH +myscript_engine_bins.files = $$MYSCRIPT_ENGINE_BINS +myscript_engine_bins.path = $$[QT_INSTALL_BINS] +myscript_voim_conf.files = $$MYSCRIPT_PATH/$$MYSCRIPT_VOIM_CONF +myscript_voim_conf.path = $$[QT_INSTALL_DATA]/$$MYSCRIPT_DATA/voim +myscript_language_conf.files = $$MYSCRIPT_PATH/$$MYSCRIPT_LANGUAGE_CONF +myscript_language_conf.path = $$[QT_INSTALL_DATA]/$$MYSCRIPT_DATA +myscript_resources.files = $$MYSCRIPT_PATH/$$MYSCRIPT_RESOURCES +myscript_resources.path = $$[QT_INSTALL_DATA]/$$MYSCRIPT_DATA +INSTALLS += \ + myscript_engine_bins \ + myscript_voim_conf \ + myscript_language_conf \ + myscript_resources +!prefix_build: COPIES += \ + myscript_engine_bins \ + myscript_voim_conf \ + myscript_language_conf \ + myscript_resources + +LAYOUT_FILES += $$LAYOUTS_BASE/content/layouts/fallback/handwriting.qml +contains(CONFIG, lang-en(_GB)?): LAYOUT_FILES += $$LAYOUTS_BASE/content/layouts/en_GB/handwriting.fallback +contains(CONFIG, lang-en(_US)?): LAYOUT_FILES += $$LAYOUTS_BASE/content/layouts/en_US/handwriting.fallback +contains(CONFIG, lang-ar.*): LAYOUT_FILES += $$LAYOUTS_BASE/content/layouts/ar_AR/handwriting.qml +contains(CONFIG, lang-bg.*): LAYOUT_FILES += $$LAYOUTS_BASE/content/layouts/bg_BG/handwriting.fallback +contains(CONFIG, lang-cs.*): LAYOUT_FILES += $$LAYOUTS_BASE/content/layouts/cs_CZ/handwriting.qml +contains(CONFIG, lang-da.*): LAYOUT_FILES += $$LAYOUTS_BASE/content/layouts/da_DK/handwriting.fallback +contains(CONFIG, lang-de.*): LAYOUT_FILES += $$LAYOUTS_BASE/content/layouts/de_DE/handwriting.fallback +contains(CONFIG, lang-el.*): LAYOUT_FILES += $$LAYOUTS_BASE/content/layouts/el_GR/handwriting.qml +contains(CONFIG, lang-es(_ES)?): LAYOUT_FILES += $$LAYOUTS_BASE/content/layouts/es_ES/handwriting.qml +contains(CONFIG, lang-es(_MX)?): LAYOUT_FILES += $$LAYOUTS_BASE/content/layouts/es_MX/handwriting.qml +contains(CONFIG, lang-et.*): LAYOUT_FILES += $$LAYOUTS_BASE/content/layouts/et_EE/handwriting.fallback +contains(CONFIG, lang-fa.*): LAYOUT_FILES += $$LAYOUTS_BASE/content/layouts/fa_FA/handwriting.qml +contains(CONFIG, lang-fi.*): LAYOUT_FILES += $$LAYOUTS_BASE/content/layouts/fi_FI/handwriting.fallback +contains(CONFIG, lang-fr(_FR)?): LAYOUT_FILES += $$LAYOUTS_BASE/content/layouts/fr_FR/handwriting.fallback +contains(CONFIG, lang-fr(_CA)?): LAYOUT_FILES += $$LAYOUTS_BASE/content/layouts/fr_CA/handwriting.fallback +contains(CONFIG, lang-he.*): LAYOUT_FILES += $$LAYOUTS_BASE/content/layouts/he_IL/handwriting.qml +contains(CONFIG, lang-hi.*): LAYOUT_FILES += $$LAYOUTS_BASE/content/layouts/hi_IN/handwriting.qml +contains(CONFIG, lang-hr.*): LAYOUT_FILES += $$LAYOUTS_BASE/content/layouts/hr_HR/handwriting.qml +contains(CONFIG, lang-hu.*): LAYOUT_FILES += $$LAYOUTS_BASE/content/layouts/hu_HU/handwriting.qml +contains(CONFIG, lang-id.*): LAYOUT_FILES += $$LAYOUTS_BASE/content/layouts/id_ID/handwriting.fallback +contains(CONFIG, lang-it.*): LAYOUT_FILES += $$LAYOUTS_BASE/content/layouts/it_IT/handwriting.fallback +contains(CONFIG, lang-ja.*): LAYOUT_FILES += $$LAYOUTS_BASE/content/layouts/ja_JP/handwriting.qml +contains(CONFIG, lang-ko.*): LAYOUT_FILES += $$LAYOUTS_BASE/content/layouts/ko_KR/handwriting.qml +contains(CONFIG, lang-ms.*): LAYOUT_FILES += $$LAYOUTS_BASE/content/layouts/ms_MY/handwriting.fallback +contains(CONFIG, lang-nb.*): LAYOUT_FILES += $$LAYOUTS_BASE/content/layouts/nb_NO/handwriting.fallback +contains(CONFIG, lang-nl.*): LAYOUT_FILES += $$LAYOUTS_BASE/content/layouts/nl_NL/handwriting.fallback +contains(CONFIG, lang-pl.*): LAYOUT_FILES += $$LAYOUTS_BASE/content/layouts/pl_PL/handwriting.fallback +contains(CONFIG, lang-pt(_BR)?): LAYOUT_FILES += $$LAYOUTS_BASE/content/layouts/pt_BR/handwriting.fallback +contains(CONFIG, lang-pt(_PT)?): LAYOUT_FILES += $$LAYOUTS_BASE/content/layouts/pt_PT/handwriting.fallback +contains(CONFIG, lang-ro.*): LAYOUT_FILES += $$LAYOUTS_BASE/content/layouts/ro_RO/handwriting.qml +contains(CONFIG, lang-ru.*): LAYOUT_FILES += $$LAYOUTS_BASE/content/layouts/ru_RU/handwriting.fallback +contains(CONFIG, lang-sk.*): LAYOUT_FILES += $$LAYOUTS_BASE/content/layouts/sk_SK/handwriting.fallback +contains(CONFIG, lang-sl.*): LAYOUT_FILES += $$LAYOUTS_BASE/content/layouts/sl_SI/handwriting.fallback +contains(CONFIG, lang-sq.*): LAYOUT_FILES += $$LAYOUTS_BASE/content/layouts/sq_AL/handwriting.fallback +contains(CONFIG, lang-sr.*): LAYOUT_FILES += $$LAYOUTS_BASE/content/layouts/sr_SP/handwriting.qml +contains(CONFIG, lang-sv.*): LAYOUT_FILES += $$LAYOUTS_BASE/content/layouts/sv_SE/handwriting.fallback +contains(CONFIG, lang-tr.*): LAYOUT_FILES += $$LAYOUTS_BASE/content/layouts/tr_TR/handwriting.fallback +contains(CONFIG, lang-uk.*): LAYOUT_FILES += $$LAYOUTS_BASE/content/layouts/uk_UA/handwriting.fallback +contains(CONFIG, lang-vi.*): LAYOUT_FILES += $$LAYOUTS_BASE/content/layouts/vi_VN/handwriting.fallback +contains(CONFIG, lang-zh(_CN)?): LAYOUT_FILES += $$LAYOUTS_BASE/content/layouts/zh_CN/handwriting.qml +contains(CONFIG, lang-zh(_TW)?): LAYOUT_FILES += $$LAYOUTS_BASE/content/layouts/zh_TW/handwriting.qml + +OTHER_FILES += \ + $$LAYOUT_FILES + +layouts.files = $$LAYOUT_FILES +layouts.base = $$LAYOUTS_BASE +layouts.prefix = $$LAYOUTS_PREFIX +RESOURCES += layouts + +win32 { + QMAKE_TARGET_PRODUCT = "Qt Virtual Keyboard MyScript (Qt $$QT_VERSION)" + QMAKE_TARGET_DESCRIPTION = "Virtual Keyboard Extension for Qt." +} + +PLUGIN_TYPE = virtualkeyboard +PLUGIN_CLASS_NAME = MyScriptPlugin +load(qt_plugin) diff --git a/src/plugins/openwnn/plugin/plugin.pro b/src/plugins/openwnn/plugin/plugin.pro index b7dc6ee1..3adb47d0 100644 --- a/src/plugins/openwnn/plugin/plugin.pro +++ b/src/plugins/openwnn/plugin/plugin.pro @@ -13,9 +13,15 @@ OTHER_FILES += \ include(../../../config.pri) LAYOUT_FILES += \ + $$LAYOUTS_BASE/content/layouts/ja_JP/dialpad.fallback \ + $$LAYOUTS_BASE/content/layouts/ja_JP/digits.fallback \ $$LAYOUTS_BASE/content/layouts/ja_JP/main.qml \ + $$LAYOUTS_BASE/content/layouts/ja_JP/numbers.fallback \ $$LAYOUTS_BASE/content/layouts/ja_JP/symbols.qml +OTHER_FILES += \ + $$LAYOUT_FILES + layouts.files = $$LAYOUT_FILES layouts.base = $$LAYOUTS_BASE layouts.prefix = $$LAYOUTS_PREFIX diff --git a/src/plugins/pinyin/plugin/plugin.pro b/src/plugins/pinyin/plugin/plugin.pro index 09315759..69bea13c 100644 --- a/src/plugins/pinyin/plugin/plugin.pro +++ b/src/plugins/pinyin/plugin/plugin.pro @@ -15,9 +15,15 @@ OTHER_FILES += \ include(../../../config.pri) LAYOUT_FILES += \ + $$LAYOUTS_BASE/content/layouts/zh_CN/dialpad.fallback \ + $$LAYOUTS_BASE/content/layouts/zh_CN/digits.fallback \ $$LAYOUTS_BASE/content/layouts/zh_CN/main.qml \ + $$LAYOUTS_BASE/content/layouts/zh_CN/numbers.fallback \ $$LAYOUTS_BASE/content/layouts/zh_CN/symbols.qml +OTHER_FILES += \ + $$LAYOUT_FILES + layouts.files = $$LAYOUT_FILES layouts.base = $$LAYOUTS_BASE layouts.prefix = $$LAYOUTS_PREFIX diff --git a/src/plugins/plugins.pro b/src/plugins/plugins.pro index 858dda3f..ce5a5cc1 100644 --- a/src/plugins/plugins.pro +++ b/src/plugins/plugins.pro @@ -12,3 +12,5 @@ openwnn: SUBDIRS += openwnn pinyin: SUBDIRS += pinyin t9write: SUBDIRS += t9write tcime: SUBDIRS += tcime +myscript: SUBDIRS += myscript +thai: SUBDIRS += thai diff --git a/src/plugins/t9write/plugin/plugin.pro b/src/plugins/t9write/plugin/plugin.pro index 6b0b754a..85fcc339 100644 --- a/src/plugins/t9write/plugin/plugin.pro +++ b/src/plugins/t9write/plugin/plugin.pro @@ -22,32 +22,44 @@ equals(T9WRITE_FOUND, 0): \ error("T9Write SDK could not be found. For more information, see" \ "the documentation in Building Qt Virtual Keyboard") +LAYOUT_FILES += $$LAYOUTS_BASE/content/layouts/fallback/handwriting.qml t9write-alphabetic { - contains(CONFIG, lang-en.*): LAYOUT_FILES += $$LAYOUTS_BASE/content/layouts/en_GB/handwriting.qml + contains(CONFIG, lang-en(_GB)?): LAYOUT_FILES += $$LAYOUTS_BASE/content/layouts/en_GB/handwriting.fallback + contains(CONFIG, lang-en(_US)?): LAYOUT_FILES += $$LAYOUTS_BASE/content/layouts/en_US/handwriting.fallback contains(CONFIG, lang-ar.*): LAYOUT_FILES += $$LAYOUTS_BASE/content/layouts/ar_AR/handwriting.qml contains(CONFIG, lang-bg.*): LAYOUT_FILES += $$LAYOUTS_BASE/content/layouts/bg_BG/handwriting.qml contains(CONFIG, lang-cs.*): LAYOUT_FILES += $$LAYOUTS_BASE/content/layouts/cs_CZ/handwriting.qml - contains(CONFIG, lang-da.*): LAYOUT_FILES += $$LAYOUTS_BASE/content/layouts/da_DK/handwriting.qml - contains(CONFIG, lang-de.*): LAYOUT_FILES += $$LAYOUTS_BASE/content/layouts/de_DE/handwriting.qml + contains(CONFIG, lang-da.*): LAYOUT_FILES += $$LAYOUTS_BASE/content/layouts/da_DK/handwriting.fallback + contains(CONFIG, lang-de.*): LAYOUT_FILES += $$LAYOUTS_BASE/content/layouts/de_DE/handwriting.fallback contains(CONFIG, lang-el.*): LAYOUT_FILES += $$LAYOUTS_BASE/content/layouts/el_GR/handwriting.qml - contains(CONFIG, lang-es.*): LAYOUT_FILES += $$LAYOUTS_BASE/content/layouts/es_ES/handwriting.qml - contains(CONFIG, lang-et.*): LAYOUT_FILES += $$LAYOUTS_BASE/content/layouts/et_EE/handwriting.qml + contains(CONFIG, lang-es(_ES)?): LAYOUT_FILES += $$LAYOUTS_BASE/content/layouts/es_ES/handwriting.qml + contains(CONFIG, lang-es(_MX)?): LAYOUT_FILES += $$LAYOUTS_BASE/content/layouts/es_MX/handwriting.qml + contains(CONFIG, lang-et.*): LAYOUT_FILES += $$LAYOUTS_BASE/content/layouts/et_EE/handwriting.fallback contains(CONFIG, lang-fa.*): LAYOUT_FILES += $$LAYOUTS_BASE/content/layouts/fa_FA/handwriting.qml - contains(CONFIG, lang-fi.*): LAYOUT_FILES += $$LAYOUTS_BASE/content/layouts/fi_FI/handwriting.qml - contains(CONFIG, lang-fr.*): LAYOUT_FILES += $$LAYOUTS_BASE/content/layouts/fr_FR/handwriting.qml + contains(CONFIG, lang-fi.*): LAYOUT_FILES += $$LAYOUTS_BASE/content/layouts/fi_FI/handwriting.fallback + contains(CONFIG, lang-fr(_FR)?): LAYOUT_FILES += $$LAYOUTS_BASE/content/layouts/fr_FR/handwriting.fallback + contains(CONFIG, lang-fr(_CA)?): LAYOUT_FILES += $$LAYOUTS_BASE/content/layouts/fr_CA/handwriting.fallback contains(CONFIG, lang-he.*): LAYOUT_FILES += $$LAYOUTS_BASE/content/layouts/he_IL/handwriting.qml contains(CONFIG, lang-hr.*): LAYOUT_FILES += $$LAYOUTS_BASE/content/layouts/hr_HR/handwriting.qml contains(CONFIG, lang-hu.*): LAYOUT_FILES += $$LAYOUTS_BASE/content/layouts/hu_HU/handwriting.qml - contains(CONFIG, lang-it.*): LAYOUT_FILES += $$LAYOUTS_BASE/content/layouts/it_IT/handwriting.qml - contains(CONFIG, lang-nb.*): LAYOUT_FILES += $$LAYOUTS_BASE/content/layouts/nb_NO/handwriting.qml - contains(CONFIG, lang-nl.*): LAYOUT_FILES += $$LAYOUTS_BASE/content/layouts/nl_NL/handwriting.qml - contains(CONFIG, lang-pl.*): LAYOUT_FILES += $$LAYOUTS_BASE/content/layouts/pl_PL/handwriting.qml - contains(CONFIG, lang-pt.*): LAYOUT_FILES += $$LAYOUTS_BASE/content/layouts/pt_PT/handwriting.qml + contains(CONFIG, lang-id.*): LAYOUT_FILES += $$LAYOUTS_BASE/content/layouts/id_ID/handwriting.fallback + contains(CONFIG, lang-it.*): LAYOUT_FILES += $$LAYOUTS_BASE/content/layouts/it_IT/handwriting.fallback + contains(CONFIG, lang-ms.*): LAYOUT_FILES += $$LAYOUTS_BASE/content/layouts/ms_MY/handwriting.fallback + contains(CONFIG, lang-nb.*): LAYOUT_FILES += $$LAYOUTS_BASE/content/layouts/nb_NO/handwriting.fallback + contains(CONFIG, lang-nl.*): LAYOUT_FILES += $$LAYOUTS_BASE/content/layouts/nl_NL/handwriting.fallback + contains(CONFIG, lang-pl.*): LAYOUT_FILES += $$LAYOUTS_BASE/content/layouts/pl_PL/handwriting.fallback + contains(CONFIG, lang-pt(_BR)?): LAYOUT_FILES += $$LAYOUTS_BASE/content/layouts/pt_BR/handwriting.fallback + contains(CONFIG, lang-pt(_PT)?): LAYOUT_FILES += $$LAYOUTS_BASE/content/layouts/pt_PT/handwriting.fallback contains(CONFIG, lang-ro.*): LAYOUT_FILES += $$LAYOUTS_BASE/content/layouts/ro_RO/handwriting.qml - contains(CONFIG, lang-ru.*): LAYOUT_FILES += $$LAYOUTS_BASE/content/layouts/ru_RU/handwriting.qml + contains(CONFIG, lang-ru.*): LAYOUT_FILES += $$LAYOUTS_BASE/content/layouts/ru_RU/handwriting.fallback + contains(CONFIG, lang-sk.*): LAYOUT_FILES += $$LAYOUTS_BASE/content/layouts/sk_SK/handwriting.fallback + contains(CONFIG, lang-sl.*): LAYOUT_FILES += $$LAYOUTS_BASE/content/layouts/sl_SI/handwriting.fallback + contains(CONFIG, lang-sq.*): LAYOUT_FILES += $$LAYOUTS_BASE/content/layouts/sq_AL/handwriting.fallback contains(CONFIG, lang-sr.*): LAYOUT_FILES += $$LAYOUTS_BASE/content/layouts/sr_SP/handwriting.qml - contains(CONFIG, lang-sv.*): LAYOUT_FILES += $$LAYOUTS_BASE/content/layouts/sv_SE/handwriting.qml - contains(CONFIG, lang-vi.*): LAYOUT_FILES += $$LAYOUTS_BASE/content/layouts/vi_VN/handwriting.qml + contains(CONFIG, lang-sv.*): LAYOUT_FILES += $$LAYOUTS_BASE/content/layouts/sv_SE/handwriting.fallback + contains(CONFIG, lang-tr.*): LAYOUT_FILES += $$LAYOUTS_BASE/content/layouts/tr_TR/handwriting.fallback + contains(CONFIG, lang-uk.*): LAYOUT_FILES += $$LAYOUTS_BASE/content/layouts/uk_UA/handwriting.fallback + contains(CONFIG, lang-vi.*): LAYOUT_FILES += $$LAYOUTS_BASE/content/layouts/vi_VN/handwriting.fallback } t9write-cjk { contains(CONFIG, lang-ja.*): LAYOUT_FILES += $$LAYOUTS_BASE/content/layouts/ja_JP/handwriting.qml @@ -56,6 +68,9 @@ t9write-cjk { contains(CONFIG, lang-zh(_TW)?): LAYOUT_FILES += $$LAYOUTS_BASE/content/layouts/zh_TW/handwriting.qml } +OTHER_FILES += \ + $$LAYOUT_FILES + layouts.files = $$LAYOUT_FILES layouts.base = $$LAYOUTS_BASE layouts.prefix = $$LAYOUTS_PREFIX diff --git a/src/plugins/t9write/plugin/t9writeinputmethod.cpp b/src/plugins/t9write/plugin/t9writeinputmethod.cpp index 7c8927fc..891fe621 100644 --- a/src/plugins/t9write/plugin/t9writeinputmethod.cpp +++ b/src/plugins/t9write/plugin/t9writeinputmethod.cpp @@ -754,7 +754,8 @@ public: } else if (inputMethodHints.testFlag(Qt::ImhUrlCharactersOnly)) { symbolCategories.append(DECUMA_CATEGORY_URL); } else { - if (language == DECUMA_LANG_EN || language == DECUMA_LANG_NL) + if (language == DECUMA_LANG_EN || language == DECUMA_LANG_NL || + language == DECUMA_LANG_MS || language == DECUMA_LANG_IN) symbolCategories.append(DECUMA_CATEGORY_ANSI); else symbolCategories.append(DECUMA_CATEGORY_ISO8859_1); diff --git a/src/plugins/tcime/plugin/plugin.pro b/src/plugins/tcime/plugin/plugin.pro index 524dfaad..d92696f1 100644 --- a/src/plugins/tcime/plugin/plugin.pro +++ b/src/plugins/tcime/plugin/plugin.pro @@ -13,7 +13,10 @@ OTHER_FILES += \ include(../../../config.pri) LAYOUT_FILES += \ + $$LAYOUTS_BASE/content/layouts/zh_TW/dialpad.fallback \ + $$LAYOUTS_BASE/content/layouts/zh_TW/digits.fallback \ $$LAYOUTS_BASE/content/layouts/zh_TW/main.qml \ + $$LAYOUTS_BASE/content/layouts/zh_TW/numbers.fallback \ $$LAYOUTS_BASE/content/layouts/zh_TW/symbols.qml layouts.files = $$LAYOUT_FILES diff --git a/src/plugins/thai/plugin/plugin.pro b/src/plugins/thai/plugin/plugin.pro new file mode 100644 index 00000000..2ad1893f --- /dev/null +++ b/src/plugins/thai/plugin/plugin.pro @@ -0,0 +1,41 @@ +TARGET = qtvirtualkeyboard_thai +QT += qml virtualkeyboard + +HEADERS += \ + thaiinputmethod_p.h \ + thaiplugin.h +SOURCES += \ + thaiinputmethod.cpp \ + thaiplugin.cpp +OTHER_FILES += \ + thai.json + +include(../../../config.pri) + +!disable-hunspell { + QT += hunspellinputmethod-private +} + +LAYOUT_FILES += \ + $$LAYOUTS_BASE/content/layouts/th_TH/dialpad.fallback \ + $$LAYOUTS_BASE/content/layouts/th_TH/digits.fallback \ + $$LAYOUTS_BASE/content/layouts/th_TH/main.qml \ + $$LAYOUTS_BASE/content/layouts/th_TH/numbers.fallback \ + $$LAYOUTS_BASE/content/layouts/th_TH/symbols.qml + +OTHER_FILES += \ + $$LAYOUT_FILES + +layouts.files = $$LAYOUT_FILES +layouts.base = $$LAYOUTS_BASE +layouts.prefix = $$LAYOUTS_PREFIX +RESOURCES += layouts + +win32 { + QMAKE_TARGET_PRODUCT = "Qt Virtual Keyboard Thai (Qt $$QT_VERSION)" + QMAKE_TARGET_DESCRIPTION = "Virtual Keyboard Extension for Qt." +} + +PLUGIN_TYPE = virtualkeyboard +PLUGIN_CLASS_NAME = ThaiPlugin +load(qt_plugin) diff --git a/src/plugins/thai/plugin/thai.json b/src/plugins/thai/plugin/thai.json new file mode 100644 index 00000000..aac036cb --- /dev/null +++ b/src/plugins/thai/plugin/thai.json @@ -0,0 +1,6 @@ +{ + "Name": "thai", + "Provider": "Qt Thai Extension", + "InputMethod": "ThaiInputMethod", + "Version": 100 +} diff --git a/src/plugins/thai/plugin/thaiinputmethod.cpp b/src/plugins/thai/plugin/thaiinputmethod.cpp new file mode 100644 index 00000000..0330d105 --- /dev/null +++ b/src/plugins/thai/plugin/thaiinputmethod.cpp @@ -0,0 +1,94 @@ +/**************************************************************************** +** +** Copyright (C) 2018 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Qt Virtual Keyboard module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:GPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 or (at your option) any later version +** approved by the KDE Free Qt Foundation. The licenses are as published by +** the Free Software Foundation and appearing in the file LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "thaiinputmethod_p.h" +#include <QtVirtualKeyboard/inputengine.h> +#include <QtVirtualKeyboard/inputcontext.h> + +QT_BEGIN_NAMESPACE +namespace QtVirtualKeyboard { + +/*! + \class QtVirtualKeyboard::ThaiInputMethod + \internal +*/ + +ThaiInputMethod::ThaiInputMethod(QObject *parent) : + ThaiInputMethodBase(parent) +{ +} + +#ifndef HAVE_HUNSPELL +QList<InputEngine::InputMode> ThaiInputMethod::inputModes( + const QString &locale) +{ + Q_UNUSED(locale) + return QList<InputEngine::InputMode>() << InputEngine::Latin; +} + +bool ThaiInputMethod::setInputMode(const QString &locale, + InputEngine::InputMode inputMode) +{ + Q_UNUSED(locale) + Q_UNUSED(inputMode) + return true; +} + +bool ThaiInputMethod::setTextCase(InputEngine::TextCase textCase) +{ + Q_UNUSED(textCase) + return true; +} +#endif + +bool ThaiInputMethod::keyEvent(Qt::Key key, + const QString &text, + Qt::KeyboardModifiers modifiers) +{ + const bool isMark = text.length() == 2 && text.at(0) == QChar(' '); +#ifdef HAVE_HUNSPELL + if (isMark) { + const QString mark(text.right(1)); + return ThaiInputMethodBase::keyEvent(static_cast<Qt::Key>(mark.at(0).unicode()), + mark, modifiers); + } + return ThaiInputMethodBase::keyEvent(key, text, modifiers); +#else + Q_UNUSED(key) + if (isMark) { + const QString mark(text.right(1)); + inputContext()->sendKeyClick(static_cast<Qt::Key>(mark.at(0).unicode()), mark, modifiers); + return true; + } + return false; +#endif +} + +} // namespace QtVirtualKeyboard +QT_END_NAMESPACE diff --git a/src/plugins/thai/plugin/thaiinputmethod_p.h b/src/plugins/thai/plugin/thaiinputmethod_p.h new file mode 100644 index 00000000..d59cfac6 --- /dev/null +++ b/src/plugins/thai/plugin/thaiinputmethod_p.h @@ -0,0 +1,65 @@ +/**************************************************************************** +** +** Copyright (C) 2018 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Qt Virtual Keyboard module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:GPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 or (at your option) any later version +** approved by the KDE Free Qt Foundation. The licenses are as published by +** the Free Software Foundation and appearing in the file LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef THAIINPUTMETHOD_H +#define THAIINPUTMETHOD_H + +#ifdef HAVE_HUNSPELL +#include <QtHunspellInputMethod/private/hunspellinputmethod_p.h> +#define ThaiInputMethodBase HunspellInputMethod +#else +#include <QtVirtualKeyboard/abstractinputmethod.h> +#define ThaiInputMethodBase AbstractInputMethod +#endif + +QT_BEGIN_NAMESPACE +namespace QtVirtualKeyboard { + +class ThaiInputMethodPrivate; + +class ThaiInputMethod : public ThaiInputMethodBase +{ + Q_OBJECT + Q_DECLARE_PRIVATE(ThaiInputMethod) +public: + explicit ThaiInputMethod(QObject *parent = nullptr); + +#ifndef HAVE_HUNSPELL + QList<InputEngine::InputMode> inputModes(const QString &locale); + bool setInputMode(const QString &locale, InputEngine::InputMode inputMode); + bool setTextCase(InputEngine::TextCase textCase); +#endif + + bool keyEvent(Qt::Key key, const QString &text, Qt::KeyboardModifiers modifiers); +}; + +} // namespace QtVirtualKeyboard +QT_END_NAMESPACE + +#endif diff --git a/src/plugins/thai/plugin/thaiplugin.cpp b/src/plugins/thai/plugin/thaiplugin.cpp new file mode 100644 index 00000000..7267c668 --- /dev/null +++ b/src/plugins/thai/plugin/thaiplugin.cpp @@ -0,0 +1,43 @@ +/**************************************************************************** +** +** Copyright (C) 2018 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Qt Virtual Keyboard module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:GPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 or (at your option) any later version +** approved by the KDE Free Qt Foundation. The licenses are as published by +** the Free Software Foundation and appearing in the file LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "thaiplugin.h" +#include "thaiinputmethod_p.h" +#include <QtQml> + +QT_BEGIN_NAMESPACE + +using namespace QtVirtualKeyboard; + +void ThaiPlugin::registerTypes(const char *uri) const +{ + qmlRegisterType<ThaiInputMethod>(uri, 2, 3, "ThaiInputMethod"); +} + +QT_END_NAMESPACE diff --git a/src/plugins/thai/plugin/thaiplugin.h b/src/plugins/thai/plugin/thaiplugin.h new file mode 100644 index 00000000..cd9a225a --- /dev/null +++ b/src/plugins/thai/plugin/thaiplugin.h @@ -0,0 +1,49 @@ +/**************************************************************************** +** +** Copyright (C) 2018 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Qt Virtual Keyboard module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:GPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 or (at your option) any later version +** approved by the KDE Free Qt Foundation. The licenses are as published by +** the Free Software Foundation and appearing in the file LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef THAIPLUGIN_H +#define THAIPLUGIN_H + +#include <QVirtualKeyboardExtensionPlugin> + +QT_BEGIN_NAMESPACE + +class ThaiPlugin : public QVirtualKeyboardExtensionPlugin +{ + Q_OBJECT + Q_INTERFACES(QVirtualKeyboardExtensionPlugin) + Q_PLUGIN_METADATA(IID QVirtualKeyboardExtensionPluginFactoryInterface_iid + FILE "thai.json") +public: + void registerTypes(const char *uri) const; +}; + +QT_END_NAMESPACE + +#endif diff --git a/src/plugins/thai/thai.pro b/src/plugins/thai/thai.pro new file mode 100644 index 00000000..b6e92972 --- /dev/null +++ b/src/plugins/thai/thai.pro @@ -0,0 +1,4 @@ +TEMPLATE = subdirs + +SUBDIRS += \ + plugin diff --git a/src/styles/SelectionListItem.qml b/src/styles/SelectionListItem.qml index f3c9fdc9..1ed9a844 100644 --- a/src/styles/SelectionListItem.qml +++ b/src/styles/SelectionListItem.qml @@ -27,7 +27,7 @@ ** ****************************************************************************/ -import QtQuick 2.0 +import QtQuick 2.11 /*! \qmltype SelectionListItem @@ -60,5 +60,12 @@ Item { selectionListItem.ListView.view.currentIndex = index selectionListItem.ListView.view.model.selectItem(index) } + onPressAndHold: { + if (index === -1) + return + if (typeof selectionListItem.ListView.view.longPressItem != "function") + return + selectionListItem.ListView.view.longPressItem(index) + } } } diff --git a/src/styles/TraceCanvas.qml b/src/styles/TraceCanvas.qml index ffee8538..ce8f03a7 100644 --- a/src/styles/TraceCanvas.qml +++ b/src/styles/TraceCanvas.qml @@ -149,4 +149,13 @@ Canvas { onLengthChanged: if (renderFunction) canvas.requestAnimationFrame(renderFunction) onFinalChanged: if (renderFunction) canvas.requestAnimationFrame(renderFunction) } + + opacity: trace ? trace.opacity : 1.0 + + Behavior on opacity { + NumberAnimation { + duration: 1500 + easing.type: Easing.InOutQuad + } + } } diff --git a/src/virtualkeyboard/abstractinputmethod.cpp b/src/virtualkeyboard/abstractinputmethod.cpp index 78305f13..622e6333 100644 --- a/src/virtualkeyboard/abstractinputmethod.cpp +++ b/src/virtualkeyboard/abstractinputmethod.cpp @@ -165,6 +165,13 @@ void AbstractInputMethod::selectionListItemSelected(SelectionListModel::Type typ Q_UNUSED(index) } +bool AbstractInputMethod::selectionListRemoveItem(SelectionListModel::Type type, int index) +{ + Q_UNUSED(type) + Q_UNUSED(index) + return false; +} + /*! \since QtQuick.VirtualKeyboard 2.0 @@ -232,6 +239,20 @@ bool AbstractInputMethod::reselect(int cursorPosition, const InputEngine::Resele } /*! + \since QtQuick.VirtualKeyboard 2.4 + + Called when the user clicks on pre-edit text at \a cursorPosition. + + The function should return \c true if it handles the event. Otherwise the input + falls back to \l reselect() for further processing. +*/ +bool AbstractInputMethod::clickPreeditText(int cursorPosition) +{ + Q_UNUSED(cursorPosition) + return false; +} + +/*! \fn QList<QtVirtualKeyboard::InputEngine::InputMode> QtVirtualKeyboard::AbstractInputMethod::inputModes(const QString& locale) Returns the list of input modes for \a locale. @@ -291,7 +312,7 @@ bool AbstractInputMethod::reselect(int cursorPosition, const InputEngine::Resele /*! \fn QVariant QtVirtualKeyboard::AbstractInputMethod::selectionListData(SelectionListModel::Type type, int index, int role) - Returns item data for the selection list identified by \a type. The \a role + Returns item data for the selection list identified by \a type. The \a \l {QtVirtualKeyboard::SelectionListModel::Role}{role} parameter specifies which data is requested. The \a index parameter is a zero based index into the list. */ @@ -304,6 +325,14 @@ bool AbstractInputMethod::reselect(int cursorPosition, const InputEngine::Resele */ /*! + \fn bool QtVirtualKeyboard::AbstractInputMethod::selectionListRemoveItem(SelectionListModel::Type type, int index) + + This method is called when an item at \a index must be removed from dictionary. + The selection list is identified by the \a type parameter. + The function returns \c true if the word was successfully removed. +*/ + +/*! \fn void QtVirtualKeyboard::AbstractInputMethod::selectionListChanged(int type) The input method emits this signal when the contents of the selection list diff --git a/src/virtualkeyboard/abstractinputmethod.h b/src/virtualkeyboard/abstractinputmethod.h index d211e13b..8689d84d 100644 --- a/src/virtualkeyboard/abstractinputmethod.h +++ b/src/virtualkeyboard/abstractinputmethod.h @@ -60,6 +60,7 @@ public: virtual int selectionListItemCount(SelectionListModel::Type type); virtual QVariant selectionListData(SelectionListModel::Type type, int index, int role); virtual void selectionListItemSelected(SelectionListModel::Type type, int index); + virtual bool selectionListRemoveItem(SelectionListModel::Type type, int index); virtual QList<InputEngine::PatternRecognitionMode> patternRecognitionModes() const; virtual Trace *traceBegin(int traceId, InputEngine::PatternRecognitionMode patternRecognitionMode, @@ -67,6 +68,7 @@ public: virtual bool traceEnd(Trace *trace); virtual bool reselect(int cursorPosition, const InputEngine::ReselectFlags &reselectFlags); + virtual bool clickPreeditText(int cursorPosition); Q_SIGNALS: void selectionListChanged(int type); diff --git a/src/virtualkeyboard/content/components/Keyboard.qml b/src/virtualkeyboard/content/components/Keyboard.qml index 8485d3c2..47b096e7 100644 --- a/src/virtualkeyboard/content/components/Keyboard.qml +++ b/src/virtualkeyboard/content/components/Keyboard.qml @@ -30,7 +30,7 @@ import QtQuick 2.0 import QtQuick.Layouts 1.0 import QtQuick.Window 2.2 -import QtQuick.VirtualKeyboard 2.2 +import QtQuick.VirtualKeyboard 2.3 import QtQuick.VirtualKeyboard.Styles 2.1 import QtQuick.VirtualKeyboard.Settings 2.2 import Qt.labs.folderlistmodel 2.0 @@ -184,6 +184,10 @@ Item { } break } + if (wordCandidateContextMenu.active) { + hideWordCandidateContextMenu() + break + } if (wordCandidateView.count) { if (wordCandidateView.currentIndex > 0) { wordCandidateView.decrementCurrentIndex() @@ -230,6 +234,14 @@ Item { alternativeKeys.close() keyboardInputArea.setActiveKey(null) keyboardInputArea.navigateToNextKey(0, 0, false) + } else if (wordCandidateContextMenu.active) { + if (wordCandidateContextMenuList.currentIndex > 0) { + wordCandidateContextMenuList.decrementCurrentIndex() + } else if (wordCandidateContextMenuList.keyNavigationWraps && wordCandidateContextMenuList.count > 1) { + wordCandidateContextMenuList.currentIndex = wordCandidateContextMenuList.count - 1 + } else { + hideWordCandidateContextMenu() + } } else if (keyboard.navigationModeActive && !keyboardInputArea.initialKey && wordCandidateView.count) { keyboardInputArea.navigateToNextKey(0, 0, false) initialKey = keyboardInputArea.initialKey @@ -262,6 +274,10 @@ Item { } break } + if (wordCandidateContextMenu.active) { + hideWordCandidateContextMenu() + break + } if (wordCandidateView.count) { if (wordCandidateView.currentIndex + 1 < wordCandidateView.count) { wordCandidateView.incrementCurrentIndex() @@ -308,6 +324,16 @@ Item { alternativeKeys.close() keyboardInputArea.setActiveKey(null) keyboardInputArea.navigateToNextKey(0, 0, false) + } else if (wordCandidateContextMenu.active) { + if (wordCandidateContextMenuList.currentIndex + 1 < wordCandidateContextMenuList.count) { + wordCandidateContextMenuList.incrementCurrentIndex() + } else if (wordCandidateContextMenuList.keyNavigationWraps && wordCandidateContextMenuList.count > 1) { + wordCandidateContextMenuList.currentIndex = 0 + } else { + hideWordCandidateContextMenu() + keyboardInputArea.setActiveKey(null) + keyboardInputArea.navigateToNextKey(0, 0, false) + } } else if (keyboard.navigationModeActive && !keyboardInputArea.initialKey && wordCandidateView.count) { keyboardInputArea.navigateToNextKey(0, 0, false) initialKey = keyboardInputArea.initialKey @@ -343,10 +369,10 @@ Item { keyboardInputArea.setActiveKey(keyboardInputArea.initialKey) keyboardInputArea.press(keyboardInputArea.initialKey, true) } - } else if (wordCandidateView.count > 0) { - wordCandidateView.model.selectItem(wordCandidateView.currentIndex) - if (!InputContext.preeditText.length) - keyboardInputArea.navigateToNextKey(0, 1, true) + } else if (!wordCandidateContextMenu.active && wordCandidateView.count > 0) { + if (!isAutoRepeat) { + pressAndHoldTimer.restart() + } } break default: @@ -361,13 +387,26 @@ Item { languagePopupList.model.selectItem(languagePopupList.currentIndex) break } - if (!languagePopupListActive && !alternativeKeys.active && keyboard.activeKey && !isAutoRepeat) { + if (isAutoRepeat) + break + if (!languagePopupListActive && !alternativeKeys.active && !wordCandidateContextMenu.active && keyboard.activeKey) { keyboardInputArea.release(keyboard.activeKey) pressAndHoldTimer.stop() alternativeKeys.close() keyboardInputArea.setActiveKey(null) if (!languagePopupListActive && keyboardInputArea.navigationCursor !== Qt.point(-1, -1)) keyboardInputArea.navigateToNextKey(0, 0, false) + } else if (wordCandidateContextMenu.active) { + if (!wordCandidateContextMenu.openedByNavigationKeyLongPress) { + wordCandidateContextMenu.selectCurrentItem() + keyboardInputArea.navigateToNextKey(0, 0, false) + } else { + wordCandidateContextMenu.openedByNavigationKeyLongPress = false + } + } else if (!wordCandidateContextMenu.active && wordCandidateView.count > 0) { + wordCandidateView.model.selectItem(wordCandidateView.currentIndex) + if (!InputContext.preeditText.length) + keyboardInputArea.navigateToNextKey(0, 1, true) } break default: @@ -444,6 +483,9 @@ Item { keyboardInputArea.initialKey = null if (keyboardInputArea.navigationCursor !== Qt.point(-1, -1)) keyboardInputArea.navigateToNextKey(0, 0, false) + } else if (!wordCandidateContextMenu.active) { + wordCandidateContextMenu.show(wordCandidateView.currentIndex) + wordCandidateContextMenu.openedByNavigationKeyLongPress = true } } } @@ -507,6 +549,8 @@ Item { return languagePopupList.highlightItem } else if (alternativeKeys.listView.count > 0) { return alternativeKeys.listView.highlightItem + } else if (wordCandidateContextMenu.active) { + return wordCandidateContextMenuList.highlightItem } else if (wordCandidateView.count > 0) { return wordCandidateView.highlightItem } @@ -620,6 +664,7 @@ Item { if (empty) wordCandidateViewAutoHideTimer.restart() wordCandidateView.empty = empty + keyboard.hideWordCandidateContextMenu() } } Connections { @@ -664,6 +709,10 @@ Item { } } } + + function longPressItem(index) { + return keyboard.showWordCandidateContextMenu(index) + } } Item { @@ -1012,6 +1061,7 @@ Item { } Item { + id: languagePopup z: 1 anchors.fill: parent @@ -1021,13 +1071,19 @@ Item { enabled: languagePopupList.enabled } - LanguagePopupList { + PopupList { id: languagePopupList + objectName: "languagePopupList" z: 2 anchors.left: parent.left anchors.top: parent.top enabled: false model: languageListModel + delegate: keyboard.style ? keyboard.style.languageListDelegate : null + highlight: keyboard.style ? keyboard.style.languageListHighlight : defaultHighlight + add: keyboard.style ? keyboard.style.languageListAdd : null + remove: keyboard.style ? keyboard.style.languageListRemove : null + background: keyboard.style ? keyboard.style.languageListBackground : null property rect previewRect: Qt.rect(keyboard.x + languagePopupList.x, keyboard.y + languagePopupList.y, languagePopupList.width, @@ -1058,42 +1114,165 @@ Item { } } } - } - function showLanguagePopup(parentItem, customLayoutsOnly) { - if (!languagePopupList.enabled) { - var locales = keyboard.listLocales(customLayoutsOnly, parent.externalLanguageSwitchEnabled) - if (parent.externalLanguageSwitchEnabled) { - var currentIndex = 0 + function show(locales, parentItem, customLayoutsOnly) { + if (!languagePopupList.enabled) { + languageListModel.clear() for (var i = 0; i < locales.length; i++) { - if (locales[i] === keyboard.locale) { - currentIndex = i - break - } + languageListModel.append({localeName: locales[i].name, displayName: locales[i].locale.nativeLanguageName, localeIndex: locales[i].index}) + if (locales[i].index === keyboard.localeIndex) + languagePopupList.currentIndex = i } - parent.externalLanguageSwitch(locales, currentIndex) - return + languagePopupList.positionViewAtIndex(languagePopupList.currentIndex, ListView.Center) + languagePopupList.anchors.leftMargin = Qt.binding(function() {return Math.round(keyboard.mapFromItem(parentItem, (parentItem.width - languagePopupList.width) / 2, 0).x)}) + languagePopupList.anchors.topMargin = Qt.binding(function() {return Math.round(keyboard.mapFromItem(parentItem, 0, -languagePopupList.height).y)}) + } + languagePopupList.enabled = true + } + + function hide() { + if (languagePopupList.enabled) { + languagePopupList.enabled = false + languagePopupList.anchors.leftMargin = undefined + languagePopupList.anchors.topMargin = undefined + languageListModel.clear() } - languageListModel.clear() - for (i = 0; i < locales.length; i++) { - languageListModel.append({localeName: locales[i].name, displayName: locales[i].locale.nativeLanguageName, localeIndex: locales[i].index}) - if (locales[i].index === keyboard.localeIndex) - languagePopupList.currentIndex = i + } + } + + function showLanguagePopup(parentItem, customLayoutsOnly) { + var locales = keyboard.listLocales(customLayoutsOnly, parent.externalLanguageSwitchEnabled) + if (parent.externalLanguageSwitchEnabled) { + var currentIndex = 0 + for (var i = 0; i < locales.length; i++) { + if (locales[i] === keyboard.locale) { + currentIndex = i + break + } } - languagePopupList.positionViewAtIndex(languagePopupList.currentIndex, ListView.Center) - languagePopupList.anchors.leftMargin = Qt.binding(function() {return Math.round(keyboard.mapFromItem(parentItem, (parentItem.width - languagePopupList.width) / 2, 0).x)}) - languagePopupList.anchors.topMargin = Qt.binding(function() {return Math.round(keyboard.mapFromItem(parentItem, 0, -languagePopupList.height).y)}) + parent.externalLanguageSwitch(locales, currentIndex) + return } - languagePopupList.enabled = true + languagePopup.show(locales, parentItem, customLayoutsOnly) } function hideLanguagePopup() { - if (languagePopupList.enabled) { - languagePopupList.enabled = false - languagePopupList.anchors.leftMargin = undefined - languagePopupList.anchors.topMargin = undefined - languageListModel.clear() + languagePopup.hide() + } + + MouseArea { + anchors.left: parent.left + anchors.right: parent.right + anchors.bottom: parent.bottom + height: keyboard.parent.parent ? keyboard.parent.parent.height : Screen.height + onPressed: keyboard.hideWordCandidateContextMenu() + enabled: wordCandidateContextMenuList.enabled + } + + Item { + id: wordCandidateContextMenu + objectName: "wordCandidateContextMenu" + z: 1 + anchors.fill: parent + property int previousWordCandidateIndex: -1 + readonly property bool active: wordCandidateContextMenuList.visible + property bool openedByNavigationKeyLongPress + + PopupList { + id: wordCandidateContextMenuList + objectName: "wordCandidateContextMenuList" + z: 2 + anchors.left: parent.left + anchors.top: parent.top + enabled: false + model: wordCandidateContextMenuListModel + property rect previewRect: Qt.rect(keyboard.x + wordCandidateContextMenuList.x, + keyboard.y + wordCandidateContextMenuList.y, + wordCandidateContextMenuList.width, + wordCandidateContextMenuList.height) + } + + ListModel { + id: wordCandidateContextMenuListModel + + function selectItem(index) { + wordCandidateContextMenu.previousWordCandidateIndex = -1 + wordCandidateContextMenuList.currentIndex = index + keyboard.soundEffect.play(wordCandidateContextMenuList.currentItem.soundEffect) + switch (get(index).action) { + case "remove": + wordCandidateView.model.removeItem(wordCandidateView.currentIndex) + break + } + keyboard.hideWordCandidateContextMenu() + } } + + function show(wordCandidateIndex) { + if (wordCandidateContextMenu.enabled) + wordCandidateContextMenu.hide() + + wordCandidateContextMenuListModel.clear() + + var canRemoveSuggestion = wordCandidateView.model.dataAt(wordCandidateIndex, SelectionListModel.CanRemoveSuggestionRole) + if (canRemoveSuggestion) { + var dictionaryType = wordCandidateView.model.dataAt(wordCandidateIndex, SelectionListModel.DictionaryTypeRole) + var removeItemText; + switch (dictionaryType) { + case SelectionListModel.UserDictionary: + //~ VirtualKeyboard Context menu for word suggestion if it can be removed from the user dictionary. + removeItemText = qsTr("Remove from dictionary") + break + case SelectionListModel.DefaultDictionary: + // Fallthrough + default: + //~ VirtualKeyboard Context menu for word suggestion if it can be removed from the default dictionary. + removeItemText = qsTr("Block word") + break + } + wordCandidateContextMenuListModel.append({action: "remove", display: removeItemText, wordCompletionLength: 0}) + } + + if (wordCandidateContextMenuListModel.count === 0) + return + + previousWordCandidateIndex = wordCandidateView.currentIndex + wordCandidateView.currentIndex = wordCandidateIndex + + wordCandidateContextMenuList.anchors.leftMargin = Qt.binding(function() { + var leftBorder = Math.round(wordCandidateView.mapFromItem(wordCandidateView.currentItem, (wordCandidateView.currentItem.width - wordCandidateContextMenuList.width) / 2, 0).x) + var rightBorder = Math.round(wordCandidateContextMenuList.parent.width - wordCandidateContextMenuList.width) + return Math.min(leftBorder, rightBorder) + }) + + wordCandidateContextMenuList.enabled = true + } + + function hide() { + if (wordCandidateContextMenuList.enabled) { + if (previousWordCandidateIndex !== -1) { + wordCandidateView.currentIndex = previousWordCandidateIndex + previousWordCandidateIndex = -1 + } + wordCandidateContextMenuList.enabled = false + wordCandidateContextMenuList.anchors.leftMargin = undefined + wordCandidateContextMenuListModel.clear() + } + openedByNavigationKeyLongPress = false + } + + function selectCurrentItem() { + if (active && wordCandidateContextMenuList.currentIndex !== -1) + wordCandidateContextMenuListModel.selectItem(wordCandidateContextMenuList.currentIndex) + } + } + + function showWordCandidateContextMenu(wordCandidateIndex) { + wordCandidateContextMenu.show(wordCandidateIndex) + } + + function hideWordCandidateContextMenu() { + wordCandidateContextMenu.hide() } function updateInputMethod() { @@ -1228,10 +1407,12 @@ Item { function updateAvailableLocaleIndices() { // Update list of all available locales - var baseLayoutIndex = findLocale("en_GB", -1) + var fallbackIndex = findFallbackIndex() var newIndices = [] var newAvailableLocales = [] for (var i = 0; i < layoutsModel.count; i++) { + if (i === fallbackIndex) + continue var localeName = layoutsModel.get(i, "fileName") if (isValidLocale(i) && newIndices.indexOf(i) === -1 && findLayout(localeName, "main")) { newIndices.push(i) @@ -1241,17 +1422,14 @@ Item { // Handle case where the VirtualKeyboardSettings.activeLocales contains no valid entries if (newIndices.length === 0) { - if (baseLayoutIndex !== -1) { - newIndices.push(baseLayoutIndex) - newAvailableLocales.push("en_GB") - } else { - for (i = 0; i < layoutsModel.count; i++) { - localeName = layoutsModel.get(i, "fileName") - if (Qt.locale(localeName).name !== "C" && findLayout(localeName, "main")) { - newIndices.push(i) - newAvailableLocales.push(localeName) - break - } + for (i = 0; i < layoutsModel.count; i++) { + if (i === fallbackIndex) + continue + localeName = layoutsModel.get(i, "fileName") + if (Qt.locale(localeName).name !== "C" && findLayout(localeName, "main")) { + newIndices.push(i) + newAvailableLocales.push(localeName) + break } } } @@ -1265,9 +1443,7 @@ Item { newIndices = [] for (i = 0; i < availableLocaleIndices.length; i++) { if (availableLocaleIndices[i] === localeIndex || - ((availableLocaleIndices[i] !== baseLayoutIndex || - (layoutType === "handwriting" && availableLocaleIndices.indexOf(baseLayoutIndex) !== -1)) && - layoutExists(layoutsModel.get(availableLocaleIndices[i], "fileName"), layoutType))) + layoutExists(layoutsModel.get(availableLocaleIndices[i], "fileName"), layoutType)) newIndices.push(availableLocaleIndices[i]) } availableCustomLocaleIndices = newIndices @@ -1324,6 +1500,15 @@ Item { return (languageMatch != -1) ? languageMatch : defaultValue } + function findFallbackIndex() { + for (var i = 0; i < layoutsModel.count; i++) { + var layoutFolder = layoutsModel.get(i, "fileName") + if (layoutFolder === "fallback") + return i + } + return -1 + } + function isValidLocale(localeNameOrIndex) { var localeName if (typeof localeNameOrIndex == "number") { @@ -1334,6 +1519,9 @@ Item { localeName = localeNameOrIndex } + if (localeName === "fallback") + return false + if (Qt.locale(localeName).name === "C") return false @@ -1349,17 +1537,29 @@ Item { return layoutsModel.folder + "/" + localeName + "/" + layoutType + ".qml" } + function getFallbackFile(localeName, layoutType) { + if (localeName === "" || layoutType === "") + return "" + return layoutsModel.folder + "/" + localeName + "/" + layoutType + ".fallback" + } + function layoutExists(localeName, layoutType) { - return InputContext.fileExists(getLayoutFile(localeName, layoutType)) + var result = InputContext.fileExists(getLayoutFile(localeName, layoutType)) + if (!result && layoutType === "handwriting") + result = InputContext.fileExists(getFallbackFile(localeName, layoutType)) + return result } function findLayout(localeName, layoutType) { var layoutFile = getLayoutFile(localeName, layoutType) if (InputContext.fileExists(layoutFile)) return layoutFile - layoutFile = getLayoutFile("en_GB", layoutType) - if (InputContext.fileExists(layoutFile)) - return layoutFile + var fallbackFile = getFallbackFile(localeName, layoutType) + if (InputContext.fileExists(fallbackFile)) { + layoutFile = getLayoutFile("fallback", layoutType) + if (InputContext.fileExists(layoutFile)) + return layoutFile + } return "" } diff --git a/src/virtualkeyboard/content/components/LanguagePopupList.qml b/src/virtualkeyboard/content/components/PopupList.qml index 2c8b8c99..dcd02ee1 100644 --- a/src/virtualkeyboard/content/components/LanguagePopupList.qml +++ b/src/virtualkeyboard/content/components/PopupList.qml @@ -28,15 +28,14 @@ ****************************************************************************/ import QtQuick 2.0 -import QtQuick.VirtualKeyboard 2.1 +import QtQuick.VirtualKeyboard 2.3 ListView { - id: languagePopupList - objectName: "languagePopupList" - property int maxVisibleItems: 5 readonly property int preferredVisibleItems: count < maxVisibleItems ? count : maxVisibleItems readonly property real contentWidth: contentItem.childrenRect.width + property alias background: popupListBackground.sourceComponent + property alias defaultHighlight: defaultHighlight clip: true visible: enabled && count > 0 @@ -44,12 +43,12 @@ ListView { height: currentItem ? currentItem.height * preferredVisibleItems + (spacing * preferredVisibleItems - 1) : 0 orientation: ListView.Vertical snapMode: ListView.SnapToItem - delegate: keyboard.style.languageListDelegate - highlight: keyboard.style.languageListHighlight ? keyboard.style.languageListHighlight : defaultHighlight + delegate: keyboard.style.popupListDelegate + highlight: keyboard.style.popupListHighlight ? keyboard.style.popupListHighlight : defaultHighlight highlightMoveDuration: 0 highlightResizeDuration: 0 - add: keyboard.style.languageListAdd - remove: keyboard.style.languageListRemove + add: keyboard.style.popupListAdd + remove: keyboard.style.popupListRemove keyNavigationWraps: true onCurrentItemChanged: if (currentItem) keyboard.soundEffect.register(currentItem.soundEffect) @@ -60,7 +59,8 @@ ListView { } Loader { - sourceComponent: keyboard.style.languageListBackground + id: popupListBackground + sourceComponent: keyboard.style.popupListBackground anchors.fill: parent z: -1 } diff --git a/src/virtualkeyboard/content/components/WordCandidatePopupList.qml b/src/virtualkeyboard/content/components/WordCandidatePopupList.qml index 7740cbf9..e255142a 100644 --- a/src/virtualkeyboard/content/components/WordCandidatePopupList.qml +++ b/src/virtualkeyboard/content/components/WordCandidatePopupList.qml @@ -28,12 +28,11 @@ ****************************************************************************/ import QtQuick 2.0 -import QtQuick.VirtualKeyboard 2.1 +import QtQuick.VirtualKeyboard 2.3 -ListView { +PopupList { id: wordCandidatePopupList - property int maxVisibleItems: 5 readonly property int preferredVisibleItems: { if (!currentItem) return 0 @@ -43,13 +42,10 @@ ListView { --result return result } - readonly property real contentWidth: contentItem.childrenRect.width readonly property bool flipVertical: currentItem && Qt.inputMethod.cursorRectangle.y + (Qt.inputMethod.cursorRectangle.height / 2) > (parent.height / 2) && Qt.inputMethod.cursorRectangle.y + Qt.inputMethod.cursorRectangle.height + (currentItem.height * 2) > parent.height - clip: true - visible: enabled && count > 0 height: currentItem ? currentItem.height * preferredVisibleItems + (spacing * preferredVisibleItems - 1) : 0 Binding { target: wordCandidatePopupList @@ -66,19 +62,9 @@ ListView { value: Math.round(wordCandidatePopupList.flipVertical ? Qt.inputMethod.cursorRectangle.y - wordCandidatePopupList.height : Qt.inputMethod.cursorRectangle.y + Qt.inputMethod.cursorRectangle.height) when: wordCandidatePopupList.visible } - orientation: ListView.Vertical - snapMode: ListView.SnapToItem - delegate: keyboard.style.popupListDelegate - highlight: keyboard.style.popupListHighlight ? keyboard.style.popupListHighlight : null - highlightMoveDuration: 0 - highlightResizeDuration: 0 - add: keyboard.style.popupListAdd - remove: keyboard.style.popupListRemove - keyNavigationWraps: true model: enabled ? InputContext.inputEngine.wordCandidateListModel : null onContentWidthChanged: viewResizeTimer.restart() - onCurrentItemChanged: if (currentItem) keyboard.soundEffect.register(currentItem.soundEffect) Timer { id: viewResizeTimer @@ -92,10 +78,4 @@ ListView { onActiveItemChanged: wordCandidatePopupList.currentIndex = index onItemSelected: if (wordCandidatePopupList.currentItem) keyboard.soundEffect.play(wordCandidatePopupList.currentItem.soundEffect) } - - Loader { - sourceComponent: keyboard.style.popupListBackground - anchors.fill: parent - z: -1 - } } diff --git a/src/virtualkeyboard/content/content.qrc b/src/virtualkeyboard/content/content.qrc index d29dbe33..1e6392f4 100644 --- a/src/virtualkeyboard/content/content.qrc +++ b/src/virtualkeyboard/content/content.qrc @@ -27,7 +27,7 @@ <file>components/TraceInputArea.qml</file> <file>components/HandwritingModeKey.qml</file> <file>components/WordCandidatePopupList.qml</file> - <file>components/LanguagePopupList.qml</file> + <file>components/PopupList.qml</file> <file>components/SelectionControl.qml</file> <file>components/ShadowInputControl.qml</file> <file>components/InputModeKey.qml</file> diff --git a/src/virtualkeyboard/content/layouts/ar_AR/dialpad.fallback b/src/virtualkeyboard/content/layouts/ar_AR/dialpad.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/ar_AR/dialpad.fallback diff --git a/src/virtualkeyboard/content/layouts/bg_BG/dialpad.fallback b/src/virtualkeyboard/content/layouts/bg_BG/dialpad.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/bg_BG/dialpad.fallback diff --git a/src/virtualkeyboard/content/layouts/bg_BG/digits.fallback b/src/virtualkeyboard/content/layouts/bg_BG/digits.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/bg_BG/digits.fallback diff --git a/src/virtualkeyboard/content/layouts/bg_BG/numbers.fallback b/src/virtualkeyboard/content/layouts/bg_BG/numbers.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/bg_BG/numbers.fallback diff --git a/src/virtualkeyboard/content/layouts/bg_BG/symbols.fallback b/src/virtualkeyboard/content/layouts/bg_BG/symbols.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/bg_BG/symbols.fallback diff --git a/src/virtualkeyboard/content/layouts/bg_BG/symbols.qml b/src/virtualkeyboard/content/layouts/bg_BG/symbols.qml deleted file mode 100644 index a649017b..00000000 --- a/src/virtualkeyboard/content/layouts/bg_BG/symbols.qml +++ /dev/null @@ -1,376 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Virtual Keyboard module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 -import QtQuick.Layouts 1.0 -import QtQuick.VirtualKeyboard 2.3 - -KeyboardLayoutLoader { - property bool secondPage - onVisibleChanged: if (!visible) secondPage = false - sourceComponent: secondPage ? page2 : page1 - Component { - id: page1 - KeyboardLayout { - keyWeight: 160 - KeyboardRow { - Key { - key: Qt.Key_1 - text: "1" - } - Key { - key: Qt.Key_2 - text: "2" - } - Key { - key: Qt.Key_3 - text: "3" - } - Key { - key: Qt.Key_4 - text: "4" - } - Key { - key: Qt.Key_5 - text: "5" - } - Key { - key: Qt.Key_6 - text: "6" - } - Key { - key: Qt.Key_7 - text: "7" - } - Key { - key: Qt.Key_8 - text: "8" - } - Key { - key: Qt.Key_9 - text: "9" - } - Key { - key: Qt.Key_0 - text: "0" - } - BackspaceKey {} - } - KeyboardRow { - FillerKey { - weight: 56 - } - Key { - key: Qt.Key_At - text: "@" - } - Key { - key: Qt.Key_NumberSign - text: "#" - } - Key { - key: Qt.Key_Percent - text: "%" - } - Key { - key: Qt.Key_Ampersand - text: "&" - } - Key { - key: Qt.Key_Asterisk - text: "*" - } - Key { - key: Qt.Key_Minus - text: "-" - } - Key { - key: Qt.Key_Plus - text: "+" - } - Key { - key: Qt.Key_ParenLeft - text: "(" - } - Key { - key: Qt.Key_ParenRight - text: ")" - } - EnterKey { - weight: 283 - } - } - KeyboardRow { - keyWeight: 156 - Key { - displayText: "1/2" - functionKey: true - onClicked: secondPage = !secondPage - } - Key { - key: Qt.Key_Exclam - text: "!" - } - Key { - key: Qt.Key_QuoteDbl - text: '"' - } - Key { - key: Qt.Key_Less - text: "<" - } - Key { - key: Qt.Key_Greater - text: ">" - } - Key { - key: Qt.Key_Apostrophe - text: "'" - } - Key { - key: Qt.Key_Colon - text: ":" - } - Key { - key: Qt.Key_Semicolon - text: ";" - } - Key { - key: Qt.Key_Slash - text: "/" - } - Key { - key: Qt.Key_Question - text: "?" - } - Key { - weight: 204 - displayText: "1/2" - functionKey: true - onClicked: secondPage = !secondPage - } - } - KeyboardRow { - keyWeight: 154 - SymbolModeKey { - weight: 217 - displayText: InputContext.inputEngine.inputMode === InputEngine.Cyrillic ? "АБВ" : "ABC" - } - ChangeLanguageKey { - weight: 154 - } - SpaceKey { - weight: 864 - } - Key { - key: Qt.Key_Period - text: "." - alternativeKeys: ".," - } - Key { - key: 0xE000 - text: ":-)" - alternativeKeys: [ ";-)", ":-)", ":-D", ":-(", "<3" ] - } - HideKeyboardKey { - weight: 204 - } - } - } - } - Component { - id: page2 - KeyboardLayout { - keyWeight: 160 - KeyboardRow { - Key { - key: Qt.Key_AsciiTilde - text: "~" - } - Key { - key: Qt.Key_Agrave - text: "`" - } - Key { - key: Qt.Key_Bar - text: "|" - } - Key { - key: 0x7B - text: "·" - } - Key { - key: 0x221A - text: "√" - } - Key { - key: Qt.Key_division - text: "÷" - } - Key { - key: Qt.Key_multiply - text: "×" - } - Key { - key: Qt.Key_onehalf - text: "½" - alternativeKeys: "¼⅓½¾⅞" - } - Key { - key: Qt.Key_BraceLeft - text: "{" - } - Key { - key: Qt.Key_BraceRight - text: "}" - } - BackspaceKey {} - } - KeyboardRow { - FillerKey { - weight: 56 - } - Key { - key: Qt.Key_Dollar - text: "$" - } - Key { - key: 0x20AC - text: "€" - } - Key { - key: 0xC2 - text: "£" - } - Key { - key: 0xA2 - text: "¢" - } - Key { - key: 0xA5 - text: "¥" - } - Key { - key: Qt.Key_Equal - text: "=" - } - Key { - key: Qt.Key_section - text: "§" - } - Key { - key: Qt.Key_BracketLeft - text: "[" - } - Key { - key: Qt.Key_BracketRight - text: "]" - } - EnterKey { - weight: 283 - } - } - KeyboardRow { - keyWeight: 156 - Key { - displayText: "2/2" - functionKey: true - onClicked: secondPage = !secondPage - } - Key { - key: Qt.Key_Underscore - text: "_" - } - Key { - key: 0x2122 - text: '™' - } - Key { - key: 0x00AE - text: '®' - } - Key { - key: Qt.Key_guillemotleft - text: '«' - } - Key { - key: Qt.Key_guillemotright - text: '»' - } - Key { - key: 0x201C - text: '“' - } - Key { - key: 0x201D - text: '”' - } - Key { - key: Qt.Key_Backslash - text: "\\" - } - Key { - key: Qt.Key_AsciiCircum - text: "^" - } - Key { - weight: 204 - displayText: "2/2" - functionKey: true - onClicked: secondPage = !secondPage - } - } - KeyboardRow { - keyWeight: 154 - SymbolModeKey { - weight: 217 - displayText: InputContext.inputEngine.inputMode === InputEngine.Cyrillic ? "АБВ" : "ABC" - } - ChangeLanguageKey { - weight: 154 - } - SpaceKey { - weight: 864 - } - Key { - key: 0x2026 - text: "\u2026" - } - Key { - key: 0xE000 - text: ":-)" - alternativeKeys: [ ";-)", ":-)", ":-D", ":-(", "<3" ] - } - HideKeyboardKey { - weight: 204 - } - } - } - } -} diff --git a/src/virtualkeyboard/content/layouts/cs_CZ/dialpad.fallback b/src/virtualkeyboard/content/layouts/cs_CZ/dialpad.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/cs_CZ/dialpad.fallback diff --git a/src/virtualkeyboard/content/layouts/cs_CZ/digits.fallback b/src/virtualkeyboard/content/layouts/cs_CZ/digits.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/cs_CZ/digits.fallback diff --git a/src/virtualkeyboard/content/layouts/cs_CZ/numbers.fallback b/src/virtualkeyboard/content/layouts/cs_CZ/numbers.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/cs_CZ/numbers.fallback diff --git a/src/virtualkeyboard/content/layouts/cs_CZ/symbols.fallback b/src/virtualkeyboard/content/layouts/cs_CZ/symbols.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/cs_CZ/symbols.fallback diff --git a/src/virtualkeyboard/content/layouts/cs_CZ/symbols.qml b/src/virtualkeyboard/content/layouts/cs_CZ/symbols.qml deleted file mode 100644 index 76c06493..00000000 --- a/src/virtualkeyboard/content/layouts/cs_CZ/symbols.qml +++ /dev/null @@ -1,376 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Virtual Keyboard module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 -import QtQuick.Layouts 1.0 -import QtQuick.VirtualKeyboard 2.3 - -KeyboardLayoutLoader { - property bool secondPage - onVisibleChanged: if (!visible) secondPage = false - sourceComponent: secondPage ? page2 : page1 - Component { - id: page1 - KeyboardLayout { - keyWeight: 160 - KeyboardRow { - Key { - key: Qt.Key_1 - text: "1" - } - Key { - key: Qt.Key_2 - text: "2" - } - Key { - key: Qt.Key_3 - text: "3" - } - Key { - key: Qt.Key_4 - text: "4" - } - Key { - key: Qt.Key_5 - text: "5" - } - Key { - key: Qt.Key_6 - text: "6" - } - Key { - key: Qt.Key_7 - text: "7" - } - Key { - key: Qt.Key_8 - text: "8" - } - Key { - key: Qt.Key_9 - text: "9" - } - Key { - key: Qt.Key_0 - text: "0" - } - BackspaceKey {} - } - KeyboardRow { - FillerKey { - weight: 56 - } - Key { - key: Qt.Key_At - text: "@" - } - Key { - key: Qt.Key_NumberSign - text: "#" - } - Key { - key: Qt.Key_Percent - text: "%" - } - Key { - key: Qt.Key_Ampersand - text: "&" - } - Key { - key: Qt.Key_Asterisk - text: "*" - } - Key { - key: Qt.Key_Minus - text: "-" - } - Key { - key: Qt.Key_Plus - text: "+" - } - Key { - key: Qt.Key_ParenLeft - text: "(" - } - Key { - key: Qt.Key_ParenRight - text: ")" - } - EnterKey { - weight: 283 - } - } - KeyboardRow { - keyWeight: 156 - Key { - displayText: "1/2" - functionKey: true - onClicked: secondPage = !secondPage - } - Key { - key: Qt.Key_Exclam - text: "!" - } - Key { - key: Qt.Key_QuoteDbl - text: '"' - } - Key { - key: Qt.Key_Apostrophe - text: "'" - } - Key { - key: Qt.Key_Less - text: "<" - } - Key { - key: Qt.Key_Greater - text: ">" - } - Key { - key: Qt.Key_Colon - text: ":" - } - Key { - key: Qt.Key_Semicolon - text: ";" - } - Key { - key: Qt.Key_Slash - text: "/" - } - Key { - key: Qt.Key_Question - text: "?" - } - Key { - weight: 204 - displayText: "1/2" - functionKey: true - onClicked: secondPage = !secondPage - } - } - KeyboardRow { - keyWeight: 154 - SymbolModeKey { - weight: 217 - displayText: "ABC" - } - ChangeLanguageKey { - weight: 154 - } - SpaceKey { - weight: 864 - } - Key { - key: Qt.Key_Period - text: "." - alternativeKeys: ".," - } - Key { - key: 0xE000 - text: ":-)" - alternativeKeys: [ ";-)", ":-)", ":-D", ":-(", "<3" ] - } - HideKeyboardKey { - weight: 204 - } - } - } - } - Component { - id: page2 - KeyboardLayout { - keyWeight: 160 - KeyboardRow { - Key { - key: Qt.Key_AsciiTilde - text: "~" - } - Key { - key: Qt.Key_Agrave - text: "`" - } - Key { - key: Qt.Key_Bar - text: "|" - } - Key { - key: 0x7B - text: "·" - } - Key { - key: 0x221A - text: "√" - } - Key { - key: Qt.Key_division - text: "÷" - } - Key { - key: Qt.Key_multiply - text: "×" - } - Key { - key: Qt.Key_onehalf - text: "½" - alternativeKeys: "¼⅓½¾⅞" - } - Key { - key: Qt.Key_BraceLeft - text: "{" - } - Key { - key: Qt.Key_BraceRight - text: "}" - } - BackspaceKey {} - } - KeyboardRow { - FillerKey { - weight: 56 - } - Key { - key: Qt.Key_Dollar - text: "$" - } - Key { - key: 0x20AC - text: "€" - } - Key { - key: 0xC2 - text: "£" - } - Key { - key: 0xA2 - text: "¢" - } - Key { - key: 0xA5 - text: "¥" - } - Key { - key: Qt.Key_Equal - text: "=" - } - Key { - key: Qt.Key_section - text: "§" - } - Key { - key: Qt.Key_BracketLeft - text: "[" - } - Key { - key: Qt.Key_BracketRight - text: "]" - } - EnterKey { - weight: 283 - } - } - KeyboardRow { - keyWeight: 156 - Key { - displayText: "2/2" - functionKey: true - onClicked: secondPage = !secondPage - } - Key { - key: Qt.Key_Underscore - text: "_" - } - Key { - key: 0x2122 - text: '™' - } - Key { - key: 0x00AE - text: '®' - } - Key { - key: Qt.Key_guillemotleft - text: '«' - } - Key { - key: Qt.Key_guillemotright - text: '»' - } - Key { - key: 0x201C - text: '“' - } - Key { - key: 0x201D - text: '”' - } - Key { - key: Qt.Key_Backslash - text: "\\" - } - Key { - key: Qt.Key_AsciiCircum - text: "^" - } - Key { - weight: 204 - displayText: "2/2" - functionKey: true - onClicked: secondPage = !secondPage - } - } - KeyboardRow { - keyWeight: 154 - SymbolModeKey { - weight: 217 - displayText: "ABC" - } - ChangeLanguageKey { - weight: 154 - } - SpaceKey { - weight: 864 - } - Key { - key: 0x2026 - text: "\u2026" - } - Key { - key: 0xE000 - text: ":-)" - alternativeKeys: [ ";-)", ":-)", ":-D", ":-(", "<3" ] - } - HideKeyboardKey { - weight: 204 - } - } - } - } -} diff --git a/src/virtualkeyboard/content/layouts/da_DK/dialpad.fallback b/src/virtualkeyboard/content/layouts/da_DK/dialpad.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/da_DK/dialpad.fallback diff --git a/src/virtualkeyboard/content/layouts/da_DK/digits.fallback b/src/virtualkeyboard/content/layouts/da_DK/digits.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/da_DK/digits.fallback diff --git a/src/virtualkeyboard/content/layouts/da_DK/handwriting.fallback b/src/virtualkeyboard/content/layouts/da_DK/handwriting.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/da_DK/handwriting.fallback diff --git a/src/virtualkeyboard/content/layouts/da_DK/handwriting.qml b/src/virtualkeyboard/content/layouts/da_DK/handwriting.qml deleted file mode 100644 index d42de535..00000000 --- a/src/virtualkeyboard/content/layouts/da_DK/handwriting.qml +++ /dev/null @@ -1,97 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Virtual Keyboard module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 -import QtQuick.Layouts 1.0 -import QtQuick.VirtualKeyboard 2.3 - -KeyboardLayout { - function createInputMethod() { - return Qt.createQmlObject('import QtQuick 2.0; import QtQuick.VirtualKeyboard 2.3; HandwritingInputMethod {}', parent) - } - sharedLayouts: ['symbols'] - inputMode: InputEngine.Latin - - KeyboardRow { - Layout.preferredHeight: 3 - KeyboardColumn { - Layout.preferredWidth: bottomRow.width - hideKeyboardKey.width - KeyboardRow { - TraceInputKey { - objectName: "hwrInputArea" - patternRecognitionMode: InputEngine.HandwritingRecoginition - } - } - } - KeyboardColumn { - Layout.preferredWidth: hideKeyboardKey.width - KeyboardRow { - BackspaceKey {} - } - KeyboardRow { - EnterKey {} - } - KeyboardRow { - ShiftKey { } - } - } - } - KeyboardRow { - id: bottomRow - Layout.preferredHeight: 1 - keyWeight: 154 - InputModeKey { - weight: 217 - } - ChangeLanguageKey { - weight: 154 - customLayoutsOnly: true - } - HandwritingModeKey { - weight: 154 - } - SpaceKey { - weight: 864 - } - Key { - key: Qt.Key_Apostrophe - text: "'" - alternativeKeys: "<>()#%&*/\\\"'=+-_" - } - Key { - key: Qt.Key_Period - text: "." - alternativeKeys: ":;,.?!" - } - HideKeyboardKey { - id: hideKeyboardKey - weight: 204 - } - } -} diff --git a/src/virtualkeyboard/content/layouts/da_DK/numbers.fallback b/src/virtualkeyboard/content/layouts/da_DK/numbers.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/da_DK/numbers.fallback diff --git a/src/virtualkeyboard/content/layouts/da_DK/symbols.fallback b/src/virtualkeyboard/content/layouts/da_DK/symbols.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/da_DK/symbols.fallback diff --git a/src/virtualkeyboard/content/layouts/de_DE/dialpad.fallback b/src/virtualkeyboard/content/layouts/de_DE/dialpad.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/de_DE/dialpad.fallback diff --git a/src/virtualkeyboard/content/layouts/de_DE/digits.fallback b/src/virtualkeyboard/content/layouts/de_DE/digits.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/de_DE/digits.fallback diff --git a/src/virtualkeyboard/content/layouts/de_DE/handwriting.fallback b/src/virtualkeyboard/content/layouts/de_DE/handwriting.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/de_DE/handwriting.fallback diff --git a/src/virtualkeyboard/content/layouts/de_DE/numbers.fallback b/src/virtualkeyboard/content/layouts/de_DE/numbers.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/de_DE/numbers.fallback diff --git a/src/virtualkeyboard/content/layouts/de_DE/symbols.fallback b/src/virtualkeyboard/content/layouts/de_DE/symbols.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/de_DE/symbols.fallback diff --git a/src/virtualkeyboard/content/layouts/de_DE/symbols.qml b/src/virtualkeyboard/content/layouts/de_DE/symbols.qml deleted file mode 100644 index 06d815d8..00000000 --- a/src/virtualkeyboard/content/layouts/de_DE/symbols.qml +++ /dev/null @@ -1,376 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Virtual Keyboard module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 -import QtQuick.Layouts 1.0 -import QtQuick.VirtualKeyboard 2.1 - -KeyboardLayoutLoader { - property bool secondPage - onVisibleChanged: if (!visible) secondPage = false - sourceComponent: secondPage ? page2 : page1 - Component { - id: page1 - KeyboardLayout { - keyWeight: 160 - KeyboardRow { - Key { - key: Qt.Key_1 - text: "1" - } - Key { - key: Qt.Key_2 - text: "2" - } - Key { - key: Qt.Key_3 - text: "3" - } - Key { - key: Qt.Key_4 - text: "4" - } - Key { - key: Qt.Key_5 - text: "5" - } - Key { - key: Qt.Key_6 - text: "6" - } - Key { - key: Qt.Key_7 - text: "7" - } - Key { - key: Qt.Key_8 - text: "8" - } - Key { - key: Qt.Key_9 - text: "9" - } - Key { - key: Qt.Key_0 - text: "0" - } - BackspaceKey {} - } - KeyboardRow { - FillerKey { - weight: 56 - } - Key { - key: Qt.Key_At - text: "@" - } - Key { - key: Qt.Key_NumberSign - text: "#" - } - Key { - key: Qt.Key_Percent - text: "%" - } - Key { - key: Qt.Key_Ampersand - text: "&" - } - Key { - key: Qt.Key_Asterisk - text: "*" - } - Key { - key: Qt.Key_Minus - text: "-" - } - Key { - key: Qt.Key_Plus - text: "+" - } - Key { - key: Qt.Key_ParenLeft - text: "(" - } - Key { - key: Qt.Key_ParenRight - text: ")" - } - EnterKey { - weight: 283 - } - } - KeyboardRow { - keyWeight: 156 - Key { - displayText: "1/2" - functionKey: true - onClicked: secondPage = !secondPage - } - Key { - key: Qt.Key_Exclam - text: "!" - } - Key { - key: Qt.Key_QuoteDbl - text: '"' - } - Key { - key: Qt.Key_Less - text: "<" - } - Key { - key: Qt.Key_Greater - text: ">" - } - Key { - key: Qt.Key_Apostrophe - text: "'" - } - Key { - key: Qt.Key_Colon - text: ":" - } - Key { - key: Qt.Key_Semicolon - text: ";" - } - Key { - key: Qt.Key_Slash - text: "/" - } - Key { - key: Qt.Key_Question - text: "?" - } - Key { - weight: 204 - displayText: "1/2" - functionKey: true - onClicked: secondPage = !secondPage - } - } - KeyboardRow { - keyWeight: 154 - SymbolModeKey { - weight: 217 - displayText: "ABC" - } - ChangeLanguageKey { - weight: 154 - } - SpaceKey { - weight: 864 - } - Key { - key: Qt.Key_Period - text: "." - alternativeKeys: ".," - } - Key { - key: 0xE000 - text: ":-)" - alternativeKeys: [ ";-)", ":-)", ":-D", ":-(", "<3" ] - } - HideKeyboardKey { - weight: 204 - } - } - } - } - Component { - id: page2 - KeyboardLayout { - keyWeight: 160 - KeyboardRow { - Key { - key: Qt.Key_AsciiTilde - text: "~" - } - Key { - key: Qt.Key_Agrave - text: "`" - } - Key { - key: Qt.Key_Bar - text: "|" - } - Key { - key: 0x7B - text: "·" - } - Key { - key: 0x221A - text: "√" - } - Key { - key: Qt.Key_division - text: "÷" - } - Key { - key: Qt.Key_multiply - text: "×" - } - Key { - key: Qt.Key_onehalf - text: "½" - alternativeKeys: "¼⅓½¾⅞" - } - Key { - key: Qt.Key_BraceLeft - text: "{" - } - Key { - key: Qt.Key_BraceRight - text: "}" - } - BackspaceKey {} - } - KeyboardRow { - FillerKey { - weight: 56 - } - Key { - key: Qt.Key_Dollar - text: "$" - } - Key { - key: 0x20AC - text: "€" - } - Key { - key: 0xC2 - text: "£" - } - Key { - key: 0xA2 - text: "¢" - } - Key { - key: 0xA5 - text: "¥" - } - Key { - key: Qt.Key_Equal - text: "=" - } - Key { - key: Qt.Key_section - text: "§" - } - Key { - key: Qt.Key_BracketLeft - text: "[" - } - Key { - key: Qt.Key_BracketRight - text: "]" - } - EnterKey { - weight: 283 - } - } - KeyboardRow { - keyWeight: 156 - Key { - displayText: "2/2" - functionKey: true - onClicked: secondPage = !secondPage - } - Key { - key: Qt.Key_Underscore - text: "_" - } - Key { - key: 0x2122 - text: '™' - } - Key { - key: 0x00AE - text: '®' - } - Key { - key: Qt.Key_guillemotleft - text: '«' - } - Key { - key: Qt.Key_guillemotright - text: '»' - } - Key { - key: 0x201C - text: '“' - } - Key { - key: 0x201D - text: '”' - } - Key { - key: Qt.Key_Backslash - text: "\\" - } - Key { - key: Qt.Key_AsciiCircum - text: "^" - } - Key { - weight: 204 - displayText: "2/2" - functionKey: true - onClicked: secondPage = !secondPage - } - } - KeyboardRow { - keyWeight: 154 - SymbolModeKey { - weight: 217 - displayText: "ABC" - } - ChangeLanguageKey { - weight: 154 - } - SpaceKey { - weight: 864 - } - Key { - key: 0x2026 - text: "\u2026" - } - Key { - key: 0xE000 - text: ":-)" - alternativeKeys: [ ";-)", ":-)", ":-D", ":-(", "<3" ] - } - HideKeyboardKey { - weight: 204 - } - } - } - } -} diff --git a/src/virtualkeyboard/content/layouts/el_GR/dialpad.fallback b/src/virtualkeyboard/content/layouts/el_GR/dialpad.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/el_GR/dialpad.fallback diff --git a/src/virtualkeyboard/content/layouts/el_GR/digits.fallback b/src/virtualkeyboard/content/layouts/el_GR/digits.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/el_GR/digits.fallback diff --git a/src/virtualkeyboard/content/layouts/el_GR/numbers.fallback b/src/virtualkeyboard/content/layouts/el_GR/numbers.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/el_GR/numbers.fallback diff --git a/src/virtualkeyboard/content/layouts/el_GR/symbols.fallback b/src/virtualkeyboard/content/layouts/el_GR/symbols.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/el_GR/symbols.fallback diff --git a/src/virtualkeyboard/content/layouts/el_GR/symbols.qml b/src/virtualkeyboard/content/layouts/el_GR/symbols.qml deleted file mode 100644 index b5eda063..00000000 --- a/src/virtualkeyboard/content/layouts/el_GR/symbols.qml +++ /dev/null @@ -1,376 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Virtual Keyboard module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 -import QtQuick.Layouts 1.0 -import QtQuick.VirtualKeyboard 2.3 - -KeyboardLayoutLoader { - property bool secondPage - onVisibleChanged: if (!visible) secondPage = false - sourceComponent: secondPage ? page2 : page1 - Component { - id: page1 - KeyboardLayout { - keyWeight: 160 - KeyboardRow { - Key { - key: Qt.Key_1 - text: "1" - } - Key { - key: Qt.Key_2 - text: "2" - } - Key { - key: Qt.Key_3 - text: "3" - } - Key { - key: Qt.Key_4 - text: "4" - } - Key { - key: Qt.Key_5 - text: "5" - } - Key { - key: Qt.Key_6 - text: "6" - } - Key { - key: Qt.Key_7 - text: "7" - } - Key { - key: Qt.Key_8 - text: "8" - } - Key { - key: Qt.Key_9 - text: "9" - } - Key { - key: Qt.Key_0 - text: "0" - } - BackspaceKey {} - } - KeyboardRow { - FillerKey { - weight: 56 - } - Key { - key: Qt.Key_At - text: "@" - } - Key { - key: Qt.Key_NumberSign - text: "#" - } - Key { - key: Qt.Key_Percent - text: "%" - } - Key { - key: Qt.Key_Ampersand - text: "&" - } - Key { - key: Qt.Key_Asterisk - text: "*" - } - Key { - key: Qt.Key_Minus - text: "-" - } - Key { - key: Qt.Key_Plus - text: "+" - } - Key { - key: Qt.Key_ParenLeft - text: "(" - } - Key { - key: Qt.Key_ParenRight - text: ")" - } - EnterKey { - weight: 283 - } - } - KeyboardRow { - keyWeight: 156 - Key { - displayText: "1/2" - functionKey: true - onClicked: secondPage = !secondPage - } - Key { - key: Qt.Key_Exclam - text: "!" - } - Key { - key: Qt.Key_QuoteDbl - text: '"' - } - Key { - key: Qt.Key_Less - text: "<" - } - Key { - key: Qt.Key_Greater - text: ">" - } - Key { - key: Qt.Key_Apostrophe - text: "'" - } - Key { - key: Qt.Key_Colon - text: ":" - } - Key { - key: Qt.Key_Semicolon - text: ";" - } - Key { - key: Qt.Key_Slash - text: "/" - } - Key { - key: Qt.Key_Question - text: "?" - } - Key { - weight: 204 - displayText: "1/2" - functionKey: true - onClicked: secondPage = !secondPage - } - } - KeyboardRow { - keyWeight: 154 - SymbolModeKey { - weight: 217 - displayText: InputContext.inputEngine.inputMode === InputEngine.Greek ? "ΑΒΓ" : "ABC" - } - ChangeLanguageKey { - weight: 154 - } - SpaceKey { - weight: 864 - } - Key { - key: Qt.Key_Period - text: "." - alternativeKeys: ".," - } - Key { - key: 0xE000 - text: ":-)" - alternativeKeys: [ ";-)", ":-)", ":-D", ":-(", "<3" ] - } - HideKeyboardKey { - weight: 204 - } - } - } - } - Component { - id: page2 - KeyboardLayout { - keyWeight: 160 - KeyboardRow { - Key { - key: Qt.Key_AsciiTilde - text: "~" - } - Key { - key: Qt.Key_Agrave - text: "`" - } - Key { - key: Qt.Key_Bar - text: "|" - } - Key { - key: 0x7B - text: "·" - } - Key { - key: 0x221A - text: "√" - } - Key { - key: Qt.Key_division - text: "÷" - } - Key { - key: Qt.Key_multiply - text: "×" - } - Key { - key: Qt.Key_onehalf - text: "½" - alternativeKeys: "¼⅓½¾⅞" - } - Key { - key: Qt.Key_BraceLeft - text: "{" - } - Key { - key: Qt.Key_BraceRight - text: "}" - } - BackspaceKey {} - } - KeyboardRow { - FillerKey { - weight: 56 - } - Key { - key: Qt.Key_Dollar - text: "$" - } - Key { - key: 0x20AC - text: "€" - } - Key { - key: 0xC2 - text: "£" - } - Key { - key: 0xA2 - text: "¢" - } - Key { - key: 0xA5 - text: "¥" - } - Key { - key: Qt.Key_Equal - text: "=" - } - Key { - key: Qt.Key_section - text: "§" - } - Key { - key: Qt.Key_BracketLeft - text: "[" - } - Key { - key: Qt.Key_BracketRight - text: "]" - } - EnterKey { - weight: 283 - } - } - KeyboardRow { - keyWeight: 156 - Key { - displayText: "2/2" - functionKey: true - onClicked: secondPage = !secondPage - } - Key { - key: Qt.Key_Underscore - text: "_" - } - Key { - key: 0x2122 - text: '™' - } - Key { - key: 0x00AE - text: '®' - } - Key { - key: Qt.Key_guillemotleft - text: '«' - } - Key { - key: Qt.Key_guillemotright - text: '»' - } - Key { - key: 0x201C - text: '“' - } - Key { - key: 0x201D - text: '”' - } - Key { - key: Qt.Key_Backslash - text: "\\" - } - Key { - key: Qt.Key_AsciiCircum - text: "^" - } - Key { - weight: 204 - displayText: "2/2" - functionKey: true - onClicked: secondPage = !secondPage - } - } - KeyboardRow { - keyWeight: 154 - SymbolModeKey { - weight: 217 - displayText: InputContext.inputEngine.inputMode === InputEngine.Greek ? "ΑΒΓ" : "ABC" - } - ChangeLanguageKey { - weight: 154 - } - SpaceKey { - weight: 864 - } - Key { - key: 0x2026 - text: "\u2026" - } - Key { - key: 0xE000 - text: ":-)" - alternativeKeys: [ ";-)", ":-)", ":-D", ":-(", "<3" ] - } - HideKeyboardKey { - weight: 204 - } - } - } - } -} diff --git a/src/virtualkeyboard/content/layouts/en_GB/dialpad.fallback b/src/virtualkeyboard/content/layouts/en_GB/dialpad.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/en_GB/dialpad.fallback diff --git a/src/virtualkeyboard/content/layouts/en_GB/digits.fallback b/src/virtualkeyboard/content/layouts/en_GB/digits.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/en_GB/digits.fallback diff --git a/src/virtualkeyboard/content/layouts/en_GB/handwriting.fallback b/src/virtualkeyboard/content/layouts/en_GB/handwriting.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/en_GB/handwriting.fallback diff --git a/src/virtualkeyboard/content/layouts/en_GB/main.fallback b/src/virtualkeyboard/content/layouts/en_GB/main.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/en_GB/main.fallback diff --git a/src/virtualkeyboard/content/layouts/en_GB/numbers.fallback b/src/virtualkeyboard/content/layouts/en_GB/numbers.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/en_GB/numbers.fallback diff --git a/src/virtualkeyboard/content/layouts/en_GB/symbols.fallback b/src/virtualkeyboard/content/layouts/en_GB/symbols.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/en_GB/symbols.fallback diff --git a/src/virtualkeyboard/content/layouts/en_US/dialpad.fallback b/src/virtualkeyboard/content/layouts/en_US/dialpad.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/en_US/dialpad.fallback diff --git a/src/virtualkeyboard/content/layouts/en_US/digits.fallback b/src/virtualkeyboard/content/layouts/en_US/digits.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/en_US/digits.fallback diff --git a/src/virtualkeyboard/content/layouts/en_US/handwriting.fallback b/src/virtualkeyboard/content/layouts/en_US/handwriting.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/en_US/handwriting.fallback diff --git a/src/virtualkeyboard/content/layouts/en_US/main.fallback b/src/virtualkeyboard/content/layouts/en_US/main.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/en_US/main.fallback diff --git a/src/virtualkeyboard/content/layouts/en_US/numbers.fallback b/src/virtualkeyboard/content/layouts/en_US/numbers.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/en_US/numbers.fallback diff --git a/src/virtualkeyboard/content/layouts/en_US/symbols.fallback b/src/virtualkeyboard/content/layouts/en_US/symbols.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/en_US/symbols.fallback diff --git a/src/virtualkeyboard/content/layouts/es_ES/dialpad.fallback b/src/virtualkeyboard/content/layouts/es_ES/dialpad.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/es_ES/dialpad.fallback diff --git a/src/virtualkeyboard/content/layouts/es_ES/digits.fallback b/src/virtualkeyboard/content/layouts/es_ES/digits.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/es_ES/digits.fallback diff --git a/src/virtualkeyboard/content/layouts/es_ES/numbers.fallback b/src/virtualkeyboard/content/layouts/es_ES/numbers.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/es_ES/numbers.fallback diff --git a/src/virtualkeyboard/content/layouts/es_MX/dialpad.fallback b/src/virtualkeyboard/content/layouts/es_MX/dialpad.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/es_MX/dialpad.fallback diff --git a/src/virtualkeyboard/content/layouts/es_MX/digits.fallback b/src/virtualkeyboard/content/layouts/es_MX/digits.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/es_MX/digits.fallback diff --git a/src/virtualkeyboard/content/layouts/de_DE/handwriting.qml b/src/virtualkeyboard/content/layouts/es_MX/handwriting.qml index d42de535..0b929162 100644 --- a/src/virtualkeyboard/content/layouts/de_DE/handwriting.qml +++ b/src/virtualkeyboard/content/layouts/es_MX/handwriting.qml @@ -87,7 +87,7 @@ KeyboardLayout { Key { key: Qt.Key_Period text: "." - alternativeKeys: ":;,.?!" + alternativeKeys: ":;,.¿?¡!" } HideKeyboardKey { id: hideKeyboardKey diff --git a/src/virtualkeyboard/content/layouts/es_MX/main.qml b/src/virtualkeyboard/content/layouts/es_MX/main.qml new file mode 100644 index 00000000..528d1f18 --- /dev/null +++ b/src/virtualkeyboard/content/layouts/es_MX/main.qml @@ -0,0 +1,211 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Qt Virtual Keyboard module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:GPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 or (at your option) any later version +** approved by the KDE Free Qt Foundation. The licenses are as published by +** the Free Software Foundation and appearing in the file LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.0 +import QtQuick.VirtualKeyboard 2.1 + +KeyboardLayout { + inputMode: InputEngine.Latin + keyWeight: 160 + KeyboardRow { + Key { + key: Qt.Key_Q + text: "q" + } + Key { + key: Qt.Key_W + text: "w" + } + Key { + key: Qt.Key_E + text: "e" + alternativeKeys: "ēęėëeêèé" + } + Key { + key: Qt.Key_R + text: "r" + } + Key { + key: Qt.Key_T + text: "t" + } + Key { + key: Qt.Key_Y + text: "y" + } + Key { + key: Qt.Key_U + text: "u" + alternativeKeys: "üûuùú" + } + Key { + key: Qt.Key_I + text: "i" + alternativeKeys: "ïįîiìí" + } + Key { + key: Qt.Key_O + text: "o" + alternativeKeys: "öõôoòóº" + } + Key { + key: Qt.Key_P + text: "p" + } + BackspaceKey { + weight: 180 + } + } + KeyboardRow { + keyWeight: 156 + FillerKey { + weight: 56 + } + Key { + key: Qt.Key_A + text: "a" + alternativeKeys: "äãaâàáª" + } + Key { + key: Qt.Key_S + text: "s" + } + Key { + key: Qt.Key_D + text: "d" + } + Key { + key: Qt.Key_F + text: "f" + } + Key { + key: Qt.Key_G + text: "g" + } + Key { + key: Qt.Key_H + text: "h" + } + Key { + key: Qt.Key_J + text: "j" + } + Key { + key: Qt.Key_K + text: "k" + } + Key { + key: Qt.Key_L + text: "l" + } + Key { + key: Qt.Key_Ntilde + text: "ñ" + } + EnterKey { + weight: 246 + } + } + KeyboardRow { + keyWeight: 156 + ShiftKey {} + Key { + key: Qt.Key_Z + text: "z" + } + Key { + key: Qt.Key_X + text: "x" + } + Key { + key: Qt.Key_C + text: "c" + alternativeKeys: "čcçć" + } + Key { + key: Qt.Key_V + text: "v" + } + Key { + key: Qt.Key_B + text: "b" + } + Key { + key: Qt.Key_N + text: "n" + } + Key { + key: Qt.Key_M + text: "m" + } + Key { + key: Qt.Key_Comma + text: "," + } + Key { + key: Qt.Key_Period + text: "." + } + Key { + key: Qt.Key_Minus + text: "-" + } + ShiftKey { + weight: 264 + } + } + KeyboardRow { + keyWeight: 154 + SymbolModeKey { + weight: 217 + } + ChangeLanguageKey { + weight: 154 + } + HandwritingModeKey { + weight: 154 + } + SpaceKey { + weight: 864 + } + Key { + key: Qt.Key_Question + text: "?" + alternativeKeys: "¿?¡!" + } + Key { + key: 0xE000 + text: ":-)" + alternativeKeys: [ ";-)", ":-)", ":-D", ":-(", "<3" ] + } + HideKeyboardKey { + weight: 204 + } + } +} diff --git a/src/virtualkeyboard/content/layouts/es_MX/numbers.fallback b/src/virtualkeyboard/content/layouts/es_MX/numbers.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/es_MX/numbers.fallback diff --git a/src/virtualkeyboard/content/layouts/en_GB/symbols.qml b/src/virtualkeyboard/content/layouts/es_MX/symbols.qml index 06d815d8..17bd3c36 100644 --- a/src/virtualkeyboard/content/layouts/en_GB/symbols.qml +++ b/src/virtualkeyboard/content/layouts/es_MX/symbols.qml @@ -134,8 +134,9 @@ KeyboardLayoutLoader { onClicked: secondPage = !secondPage } Key { - key: Qt.Key_Exclam - text: "!" + key: Qt.Key_exclamdown + text: "¡" + alternativeKeys: "¡!" } Key { key: Qt.Key_QuoteDbl @@ -166,8 +167,9 @@ KeyboardLayoutLoader { text: "/" } Key { - key: Qt.Key_Question - text: "?" + key: Qt.Key_questiondown + text: "¿" + alternativeKeys: "¿?" } Key { weight: 204 diff --git a/src/virtualkeyboard/content/layouts/et_EE/dialpad.fallback b/src/virtualkeyboard/content/layouts/et_EE/dialpad.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/et_EE/dialpad.fallback diff --git a/src/virtualkeyboard/content/layouts/et_EE/digits.fallback b/src/virtualkeyboard/content/layouts/et_EE/digits.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/et_EE/digits.fallback diff --git a/src/virtualkeyboard/content/layouts/et_EE/handwriting.fallback b/src/virtualkeyboard/content/layouts/et_EE/handwriting.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/et_EE/handwriting.fallback diff --git a/src/virtualkeyboard/content/layouts/et_EE/numbers.fallback b/src/virtualkeyboard/content/layouts/et_EE/numbers.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/et_EE/numbers.fallback diff --git a/src/virtualkeyboard/content/layouts/et_EE/symbols.fallback b/src/virtualkeyboard/content/layouts/et_EE/symbols.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/et_EE/symbols.fallback diff --git a/src/virtualkeyboard/content/layouts/et_EE/symbols.qml b/src/virtualkeyboard/content/layouts/et_EE/symbols.qml deleted file mode 100644 index 49f6e709..00000000 --- a/src/virtualkeyboard/content/layouts/et_EE/symbols.qml +++ /dev/null @@ -1,376 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Virtual Keyboard module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 -import QtQuick.Layouts 1.0 -import QtQuick.VirtualKeyboard 2.1 - -KeyboardLayoutLoader { - property bool secondPage - onVisibleChanged: if (!visible) secondPage = false - sourceComponent: secondPage ? page2 : page1 - Component { - id: page1 - KeyboardLayout { - keyWeight: 160 - KeyboardRow { - Key { - key: Qt.Key_1 - text: "1" - } - Key { - key: Qt.Key_2 - text: "2" - } - Key { - key: Qt.Key_3 - text: "3" - } - Key { - key: Qt.Key_4 - text: "4" - } - Key { - key: Qt.Key_5 - text: "5" - } - Key { - key: Qt.Key_6 - text: "6" - } - Key { - key: Qt.Key_7 - text: "7" - } - Key { - key: Qt.Key_8 - text: "8" - } - Key { - key: Qt.Key_9 - text: "9" - } - Key { - key: Qt.Key_0 - text: "0" - } - BackspaceKey {} - } - KeyboardRow { - FillerKey { - weight: 56 - } - Key { - key: Qt.Key_At - text: "@" - } - Key { - key: Qt.Key_NumberSign - text: "#" - } - Key { - key: Qt.Key_Percent - text: "%" - } - Key { - key: Qt.Key_Ampersand - text: "&" - } - Key { - key: Qt.Key_Asterisk - text: "*" - } - Key { - key: Qt.Key_Minus - text: "-" - } - Key { - key: Qt.Key_Plus - text: "+" - } - Key { - key: Qt.Key_ParenLeft - text: "(" - } - Key { - key: Qt.Key_ParenRight - text: ")" - } - EnterKey { - weight: 283 - } - } - KeyboardRow { - keyWeight: 156 - Key { - displayText: "1/2" - functionKey: true - onClicked: secondPage = !secondPage - } - Key { - key: Qt.Key_Exclam - text: "!" - } - Key { - key: Qt.Key_QuoteDbl - text: '"' - } - Key { - key: Qt.Key_Less - text: "<" - } - Key { - key: Qt.Key_Greater - text: ">" - } - Key { - key: Qt.Key_Apostrophe - text: "'" - } - Key { - key: Qt.Key_Colon - text: ":" - } - Key { - key: Qt.Key_Semicolon - text: ";" - } - Key { - key: Qt.Key_Slash - text: "/" - } - Key { - key: Qt.Key_Question - text: "?" - } - Key { - weight: 204 - displayText: "1/2" - functionKey: true - onClicked: secondPage = !secondPage - } - } - KeyboardRow { - keyWeight: 154 - SymbolModeKey { - weight: 217 - displayText: "ABC" - } - ChangeLanguageKey { - weight: 154 - } - SpaceKey { - weight: 864 - } - Key { - key: Qt.Key_Period - text: "." - alternativeKeys: ".," - } - Key { - key: 0xE000 - text: ":-)" - alternativeKeys: [ ";-)", ":-)", ":-D", ":-(", "<3" ] - } - HideKeyboardKey { - weight: 204 - } - } - } - } - Component { - id: page2 - KeyboardLayout { - keyWeight: 160 - KeyboardRow { - Key { - key: Qt.Key_AsciiTilde - text: "~" - } - Key { - key: Qt.Key_Agrave - text: "`" - } - Key { - key: Qt.Key_Bar - text: "|" - } - Key { - key: 0x7B - text: "·" - } - Key { - key: 0x221A - text: "√" - } - Key { - key: Qt.Key_division - text: "÷" - } - Key { - key: Qt.Key_multiply - text: "×" - } - Key { - key: Qt.Key_onehalf - text: "½" - alternativeKeys: "¼⅓½¾⅞" - } - Key { - key: Qt.Key_BraceLeft - text: "{" - } - Key { - key: Qt.Key_BraceRight - text: "}" - } - BackspaceKey {} - } - KeyboardRow { - FillerKey { - weight: 56 - } - Key { - key: Qt.Key_Dollar - text: "$" - } - Key { - key: 0x20AC - text: "€" - } - Key { - key: 0xC2 - text: "£" - } - Key { - key: 0xA2 - text: "¢" - } - Key { - key: 0xA5 - text: "¥" - } - Key { - key: Qt.Key_Equal - text: "=" - } - Key { - key: Qt.Key_section - text: "§" - } - Key { - key: Qt.Key_BracketLeft - text: "[" - } - Key { - key: Qt.Key_BracketRight - text: "]" - } - EnterKey { - weight: 283 - } - } - KeyboardRow { - keyWeight: 156 - Key { - displayText: "2/2" - functionKey: true - onClicked: secondPage = !secondPage - } - Key { - key: Qt.Key_Underscore - text: "_" - } - Key { - key: 0x2122 - text: '™' - } - Key { - key: 0x00AE - text: '®' - } - Key { - key: Qt.Key_guillemotleft - text: '«' - } - Key { - key: Qt.Key_guillemotright - text: '»' - } - Key { - key: 0x201C - text: '“' - } - Key { - key: 0x201D - text: '”' - } - Key { - key: Qt.Key_Backslash - text: "\\" - } - Key { - key: Qt.Key_AsciiCircum - text: "^" - } - Key { - weight: 204 - displayText: "2/2" - functionKey: true - onClicked: secondPage = !secondPage - } - } - KeyboardRow { - keyWeight: 154 - SymbolModeKey { - weight: 217 - displayText: "ABC" - } - ChangeLanguageKey { - weight: 154 - } - SpaceKey { - weight: 864 - } - Key { - key: 0x2026 - text: "\u2026" - } - Key { - key: 0xE000 - text: ":-)" - alternativeKeys: [ ";-)", ":-)", ":-D", ":-(", "<3" ] - } - HideKeyboardKey { - weight: 204 - } - } - } - } -} diff --git a/src/virtualkeyboard/content/layouts/fa_FA/dialpad.fallback b/src/virtualkeyboard/content/layouts/fa_FA/dialpad.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/fa_FA/dialpad.fallback diff --git a/src/virtualkeyboard/content/layouts/en_GB/dialpad.qml b/src/virtualkeyboard/content/layouts/fallback/dialpad.qml index 95a40db9..95a40db9 100644 --- a/src/virtualkeyboard/content/layouts/en_GB/dialpad.qml +++ b/src/virtualkeyboard/content/layouts/fallback/dialpad.qml diff --git a/src/virtualkeyboard/content/layouts/en_GB/digits.qml b/src/virtualkeyboard/content/layouts/fallback/digits.qml index 5a59d3f3..5a59d3f3 100644 --- a/src/virtualkeyboard/content/layouts/en_GB/digits.qml +++ b/src/virtualkeyboard/content/layouts/fallback/digits.qml diff --git a/src/virtualkeyboard/content/layouts/en_GB/handwriting.qml b/src/virtualkeyboard/content/layouts/fallback/handwriting.qml index d42de535..d4e9640a 100644 --- a/src/virtualkeyboard/content/layouts/en_GB/handwriting.qml +++ b/src/virtualkeyboard/content/layouts/fallback/handwriting.qml @@ -36,7 +36,6 @@ KeyboardLayout { return Qt.createQmlObject('import QtQuick 2.0; import QtQuick.VirtualKeyboard 2.3; HandwritingInputMethod {}', parent) } sharedLayouts: ['symbols'] - inputMode: InputEngine.Latin KeyboardRow { Layout.preferredHeight: 3 diff --git a/src/virtualkeyboard/content/layouts/en_GB/main.qml b/src/virtualkeyboard/content/layouts/fallback/main.qml index 0c6370ae..0c6370ae 100644 --- a/src/virtualkeyboard/content/layouts/en_GB/main.qml +++ b/src/virtualkeyboard/content/layouts/fallback/main.qml diff --git a/src/virtualkeyboard/content/layouts/en_GB/numbers.qml b/src/virtualkeyboard/content/layouts/fallback/numbers.qml index 88491ac5..88491ac5 100644 --- a/src/virtualkeyboard/content/layouts/en_GB/numbers.qml +++ b/src/virtualkeyboard/content/layouts/fallback/numbers.qml diff --git a/src/virtualkeyboard/content/layouts/sr_SP/symbols.qml b/src/virtualkeyboard/content/layouts/fallback/symbols.qml index 42f8f3b6..9c8d53f9 100644 --- a/src/virtualkeyboard/content/layouts/sr_SP/symbols.qml +++ b/src/virtualkeyboard/content/layouts/fallback/symbols.qml @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2017 The Qt Company Ltd. +** Copyright (C) 2018 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Virtual Keyboard module of the Qt Toolkit. @@ -29,7 +29,7 @@ import QtQuick 2.0 import QtQuick.Layouts 1.0 -import QtQuick.VirtualKeyboard 2.3 +import QtQuick.VirtualKeyboard 2.1 KeyboardLayoutLoader { property bool secondPage @@ -142,10 +142,6 @@ KeyboardLayoutLoader { text: '"' } Key { - key: Qt.Key_Apostrophe - text: "'" - } - Key { key: Qt.Key_Less text: "<" } @@ -154,6 +150,10 @@ KeyboardLayoutLoader { text: ">" } Key { + key: Qt.Key_Apostrophe + text: "'" + } + Key { key: Qt.Key_Colon text: ":" } diff --git a/src/virtualkeyboard/content/layouts/fi_FI/dialpad.fallback b/src/virtualkeyboard/content/layouts/fi_FI/dialpad.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/fi_FI/dialpad.fallback diff --git a/src/virtualkeyboard/content/layouts/fi_FI/digits.fallback b/src/virtualkeyboard/content/layouts/fi_FI/digits.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/fi_FI/digits.fallback diff --git a/src/virtualkeyboard/content/layouts/fi_FI/handwriting.fallback b/src/virtualkeyboard/content/layouts/fi_FI/handwriting.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/fi_FI/handwriting.fallback diff --git a/src/virtualkeyboard/content/layouts/fi_FI/handwriting.qml b/src/virtualkeyboard/content/layouts/fi_FI/handwriting.qml deleted file mode 100644 index d42de535..00000000 --- a/src/virtualkeyboard/content/layouts/fi_FI/handwriting.qml +++ /dev/null @@ -1,97 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Virtual Keyboard module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 -import QtQuick.Layouts 1.0 -import QtQuick.VirtualKeyboard 2.3 - -KeyboardLayout { - function createInputMethod() { - return Qt.createQmlObject('import QtQuick 2.0; import QtQuick.VirtualKeyboard 2.3; HandwritingInputMethod {}', parent) - } - sharedLayouts: ['symbols'] - inputMode: InputEngine.Latin - - KeyboardRow { - Layout.preferredHeight: 3 - KeyboardColumn { - Layout.preferredWidth: bottomRow.width - hideKeyboardKey.width - KeyboardRow { - TraceInputKey { - objectName: "hwrInputArea" - patternRecognitionMode: InputEngine.HandwritingRecoginition - } - } - } - KeyboardColumn { - Layout.preferredWidth: hideKeyboardKey.width - KeyboardRow { - BackspaceKey {} - } - KeyboardRow { - EnterKey {} - } - KeyboardRow { - ShiftKey { } - } - } - } - KeyboardRow { - id: bottomRow - Layout.preferredHeight: 1 - keyWeight: 154 - InputModeKey { - weight: 217 - } - ChangeLanguageKey { - weight: 154 - customLayoutsOnly: true - } - HandwritingModeKey { - weight: 154 - } - SpaceKey { - weight: 864 - } - Key { - key: Qt.Key_Apostrophe - text: "'" - alternativeKeys: "<>()#%&*/\\\"'=+-_" - } - Key { - key: Qt.Key_Period - text: "." - alternativeKeys: ":;,.?!" - } - HideKeyboardKey { - id: hideKeyboardKey - weight: 204 - } - } -} diff --git a/src/virtualkeyboard/content/layouts/fi_FI/numbers.fallback b/src/virtualkeyboard/content/layouts/fi_FI/numbers.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/fi_FI/numbers.fallback diff --git a/src/virtualkeyboard/content/layouts/fi_FI/symbols.fallback b/src/virtualkeyboard/content/layouts/fi_FI/symbols.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/fi_FI/symbols.fallback diff --git a/src/virtualkeyboard/content/layouts/fi_FI/symbols.qml b/src/virtualkeyboard/content/layouts/fi_FI/symbols.qml deleted file mode 100644 index 06d815d8..00000000 --- a/src/virtualkeyboard/content/layouts/fi_FI/symbols.qml +++ /dev/null @@ -1,376 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Virtual Keyboard module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 -import QtQuick.Layouts 1.0 -import QtQuick.VirtualKeyboard 2.1 - -KeyboardLayoutLoader { - property bool secondPage - onVisibleChanged: if (!visible) secondPage = false - sourceComponent: secondPage ? page2 : page1 - Component { - id: page1 - KeyboardLayout { - keyWeight: 160 - KeyboardRow { - Key { - key: Qt.Key_1 - text: "1" - } - Key { - key: Qt.Key_2 - text: "2" - } - Key { - key: Qt.Key_3 - text: "3" - } - Key { - key: Qt.Key_4 - text: "4" - } - Key { - key: Qt.Key_5 - text: "5" - } - Key { - key: Qt.Key_6 - text: "6" - } - Key { - key: Qt.Key_7 - text: "7" - } - Key { - key: Qt.Key_8 - text: "8" - } - Key { - key: Qt.Key_9 - text: "9" - } - Key { - key: Qt.Key_0 - text: "0" - } - BackspaceKey {} - } - KeyboardRow { - FillerKey { - weight: 56 - } - Key { - key: Qt.Key_At - text: "@" - } - Key { - key: Qt.Key_NumberSign - text: "#" - } - Key { - key: Qt.Key_Percent - text: "%" - } - Key { - key: Qt.Key_Ampersand - text: "&" - } - Key { - key: Qt.Key_Asterisk - text: "*" - } - Key { - key: Qt.Key_Minus - text: "-" - } - Key { - key: Qt.Key_Plus - text: "+" - } - Key { - key: Qt.Key_ParenLeft - text: "(" - } - Key { - key: Qt.Key_ParenRight - text: ")" - } - EnterKey { - weight: 283 - } - } - KeyboardRow { - keyWeight: 156 - Key { - displayText: "1/2" - functionKey: true - onClicked: secondPage = !secondPage - } - Key { - key: Qt.Key_Exclam - text: "!" - } - Key { - key: Qt.Key_QuoteDbl - text: '"' - } - Key { - key: Qt.Key_Less - text: "<" - } - Key { - key: Qt.Key_Greater - text: ">" - } - Key { - key: Qt.Key_Apostrophe - text: "'" - } - Key { - key: Qt.Key_Colon - text: ":" - } - Key { - key: Qt.Key_Semicolon - text: ";" - } - Key { - key: Qt.Key_Slash - text: "/" - } - Key { - key: Qt.Key_Question - text: "?" - } - Key { - weight: 204 - displayText: "1/2" - functionKey: true - onClicked: secondPage = !secondPage - } - } - KeyboardRow { - keyWeight: 154 - SymbolModeKey { - weight: 217 - displayText: "ABC" - } - ChangeLanguageKey { - weight: 154 - } - SpaceKey { - weight: 864 - } - Key { - key: Qt.Key_Period - text: "." - alternativeKeys: ".," - } - Key { - key: 0xE000 - text: ":-)" - alternativeKeys: [ ";-)", ":-)", ":-D", ":-(", "<3" ] - } - HideKeyboardKey { - weight: 204 - } - } - } - } - Component { - id: page2 - KeyboardLayout { - keyWeight: 160 - KeyboardRow { - Key { - key: Qt.Key_AsciiTilde - text: "~" - } - Key { - key: Qt.Key_Agrave - text: "`" - } - Key { - key: Qt.Key_Bar - text: "|" - } - Key { - key: 0x7B - text: "·" - } - Key { - key: 0x221A - text: "√" - } - Key { - key: Qt.Key_division - text: "÷" - } - Key { - key: Qt.Key_multiply - text: "×" - } - Key { - key: Qt.Key_onehalf - text: "½" - alternativeKeys: "¼⅓½¾⅞" - } - Key { - key: Qt.Key_BraceLeft - text: "{" - } - Key { - key: Qt.Key_BraceRight - text: "}" - } - BackspaceKey {} - } - KeyboardRow { - FillerKey { - weight: 56 - } - Key { - key: Qt.Key_Dollar - text: "$" - } - Key { - key: 0x20AC - text: "€" - } - Key { - key: 0xC2 - text: "£" - } - Key { - key: 0xA2 - text: "¢" - } - Key { - key: 0xA5 - text: "¥" - } - Key { - key: Qt.Key_Equal - text: "=" - } - Key { - key: Qt.Key_section - text: "§" - } - Key { - key: Qt.Key_BracketLeft - text: "[" - } - Key { - key: Qt.Key_BracketRight - text: "]" - } - EnterKey { - weight: 283 - } - } - KeyboardRow { - keyWeight: 156 - Key { - displayText: "2/2" - functionKey: true - onClicked: secondPage = !secondPage - } - Key { - key: Qt.Key_Underscore - text: "_" - } - Key { - key: 0x2122 - text: '™' - } - Key { - key: 0x00AE - text: '®' - } - Key { - key: Qt.Key_guillemotleft - text: '«' - } - Key { - key: Qt.Key_guillemotright - text: '»' - } - Key { - key: 0x201C - text: '“' - } - Key { - key: 0x201D - text: '”' - } - Key { - key: Qt.Key_Backslash - text: "\\" - } - Key { - key: Qt.Key_AsciiCircum - text: "^" - } - Key { - weight: 204 - displayText: "2/2" - functionKey: true - onClicked: secondPage = !secondPage - } - } - KeyboardRow { - keyWeight: 154 - SymbolModeKey { - weight: 217 - displayText: "ABC" - } - ChangeLanguageKey { - weight: 154 - } - SpaceKey { - weight: 864 - } - Key { - key: 0x2026 - text: "\u2026" - } - Key { - key: 0xE000 - text: ":-)" - alternativeKeys: [ ";-)", ":-)", ":-D", ":-(", "<3" ] - } - HideKeyboardKey { - weight: 204 - } - } - } - } -} diff --git a/src/virtualkeyboard/content/layouts/fr_CA/dialpad.fallback b/src/virtualkeyboard/content/layouts/fr_CA/dialpad.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/fr_CA/dialpad.fallback diff --git a/src/virtualkeyboard/content/layouts/fr_CA/digits.fallback b/src/virtualkeyboard/content/layouts/fr_CA/digits.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/fr_CA/digits.fallback diff --git a/src/virtualkeyboard/content/layouts/fr_CA/handwriting.fallback b/src/virtualkeyboard/content/layouts/fr_CA/handwriting.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/fr_CA/handwriting.fallback diff --git a/src/virtualkeyboard/content/layouts/nl_NL/main.qml b/src/virtualkeyboard/content/layouts/fr_CA/main.qml index 1deb766a..d71442bf 100644 --- a/src/virtualkeyboard/content/layouts/nl_NL/main.qml +++ b/src/virtualkeyboard/content/layouts/fr_CA/main.qml @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2017 The Qt Company Ltd. +** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Virtual Keyboard module of the Qt Toolkit. @@ -45,7 +45,7 @@ KeyboardLayout { Key { key: Qt.Key_E text: "e" - alternativeKeys: "êeëèé" + alternativeKeys: "éèeêë" } Key { key: Qt.Key_R @@ -58,22 +58,22 @@ KeyboardLayout { Key { key: Qt.Key_Y text: "y" - alternativeKeys: "yijÿýŷ" + alternativeKeys: "yÿ" } Key { key: Qt.Key_U text: "u" - alternativeKeys: "űūũûüuùú" + alternativeKeys: "ùuûü" } Key { key: Qt.Key_I text: "i" - alternativeKeys: "îïīĩiìí" + alternativeKeys: "îiï" } Key { key: Qt.Key_O text: "o" - alternativeKeys: "œøõôöòóo" + alternativeKeys: "ôoœ" } Key { key: Qt.Key_P @@ -88,7 +88,7 @@ KeyboardLayout { Key { key: Qt.Key_A text: "a" - alternativeKeys: "aäåãâàá" + alternativeKeys: "aàâæ" } Key { key: Qt.Key_S @@ -140,6 +140,7 @@ KeyboardLayout { Key { key: Qt.Key_C text: "c" + alternativeKeys: "cç" } Key { key: Qt.Key_V diff --git a/src/virtualkeyboard/content/layouts/fr_CA/numbers.fallback b/src/virtualkeyboard/content/layouts/fr_CA/numbers.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/fr_CA/numbers.fallback diff --git a/src/virtualkeyboard/content/layouts/fr_CA/symbols.fallback b/src/virtualkeyboard/content/layouts/fr_CA/symbols.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/fr_CA/symbols.fallback diff --git a/src/virtualkeyboard/content/layouts/fr_FR/dialpad.fallback b/src/virtualkeyboard/content/layouts/fr_FR/dialpad.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/fr_FR/dialpad.fallback diff --git a/src/virtualkeyboard/content/layouts/fr_FR/digits.fallback b/src/virtualkeyboard/content/layouts/fr_FR/digits.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/fr_FR/digits.fallback diff --git a/src/virtualkeyboard/content/layouts/fr_FR/handwriting.fallback b/src/virtualkeyboard/content/layouts/fr_FR/handwriting.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/fr_FR/handwriting.fallback diff --git a/src/virtualkeyboard/content/layouts/fr_FR/handwriting.qml b/src/virtualkeyboard/content/layouts/fr_FR/handwriting.qml deleted file mode 100644 index d42de535..00000000 --- a/src/virtualkeyboard/content/layouts/fr_FR/handwriting.qml +++ /dev/null @@ -1,97 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Virtual Keyboard module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 -import QtQuick.Layouts 1.0 -import QtQuick.VirtualKeyboard 2.3 - -KeyboardLayout { - function createInputMethod() { - return Qt.createQmlObject('import QtQuick 2.0; import QtQuick.VirtualKeyboard 2.3; HandwritingInputMethod {}', parent) - } - sharedLayouts: ['symbols'] - inputMode: InputEngine.Latin - - KeyboardRow { - Layout.preferredHeight: 3 - KeyboardColumn { - Layout.preferredWidth: bottomRow.width - hideKeyboardKey.width - KeyboardRow { - TraceInputKey { - objectName: "hwrInputArea" - patternRecognitionMode: InputEngine.HandwritingRecoginition - } - } - } - KeyboardColumn { - Layout.preferredWidth: hideKeyboardKey.width - KeyboardRow { - BackspaceKey {} - } - KeyboardRow { - EnterKey {} - } - KeyboardRow { - ShiftKey { } - } - } - } - KeyboardRow { - id: bottomRow - Layout.preferredHeight: 1 - keyWeight: 154 - InputModeKey { - weight: 217 - } - ChangeLanguageKey { - weight: 154 - customLayoutsOnly: true - } - HandwritingModeKey { - weight: 154 - } - SpaceKey { - weight: 864 - } - Key { - key: Qt.Key_Apostrophe - text: "'" - alternativeKeys: "<>()#%&*/\\\"'=+-_" - } - Key { - key: Qt.Key_Period - text: "." - alternativeKeys: ":;,.?!" - } - HideKeyboardKey { - id: hideKeyboardKey - weight: 204 - } - } -} diff --git a/src/virtualkeyboard/content/layouts/fr_FR/numbers.fallback b/src/virtualkeyboard/content/layouts/fr_FR/numbers.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/fr_FR/numbers.fallback diff --git a/src/virtualkeyboard/content/layouts/fr_FR/symbols.fallback b/src/virtualkeyboard/content/layouts/fr_FR/symbols.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/fr_FR/symbols.fallback diff --git a/src/virtualkeyboard/content/layouts/fr_FR/symbols.qml b/src/virtualkeyboard/content/layouts/fr_FR/symbols.qml deleted file mode 100644 index 06d815d8..00000000 --- a/src/virtualkeyboard/content/layouts/fr_FR/symbols.qml +++ /dev/null @@ -1,376 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Virtual Keyboard module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 -import QtQuick.Layouts 1.0 -import QtQuick.VirtualKeyboard 2.1 - -KeyboardLayoutLoader { - property bool secondPage - onVisibleChanged: if (!visible) secondPage = false - sourceComponent: secondPage ? page2 : page1 - Component { - id: page1 - KeyboardLayout { - keyWeight: 160 - KeyboardRow { - Key { - key: Qt.Key_1 - text: "1" - } - Key { - key: Qt.Key_2 - text: "2" - } - Key { - key: Qt.Key_3 - text: "3" - } - Key { - key: Qt.Key_4 - text: "4" - } - Key { - key: Qt.Key_5 - text: "5" - } - Key { - key: Qt.Key_6 - text: "6" - } - Key { - key: Qt.Key_7 - text: "7" - } - Key { - key: Qt.Key_8 - text: "8" - } - Key { - key: Qt.Key_9 - text: "9" - } - Key { - key: Qt.Key_0 - text: "0" - } - BackspaceKey {} - } - KeyboardRow { - FillerKey { - weight: 56 - } - Key { - key: Qt.Key_At - text: "@" - } - Key { - key: Qt.Key_NumberSign - text: "#" - } - Key { - key: Qt.Key_Percent - text: "%" - } - Key { - key: Qt.Key_Ampersand - text: "&" - } - Key { - key: Qt.Key_Asterisk - text: "*" - } - Key { - key: Qt.Key_Minus - text: "-" - } - Key { - key: Qt.Key_Plus - text: "+" - } - Key { - key: Qt.Key_ParenLeft - text: "(" - } - Key { - key: Qt.Key_ParenRight - text: ")" - } - EnterKey { - weight: 283 - } - } - KeyboardRow { - keyWeight: 156 - Key { - displayText: "1/2" - functionKey: true - onClicked: secondPage = !secondPage - } - Key { - key: Qt.Key_Exclam - text: "!" - } - Key { - key: Qt.Key_QuoteDbl - text: '"' - } - Key { - key: Qt.Key_Less - text: "<" - } - Key { - key: Qt.Key_Greater - text: ">" - } - Key { - key: Qt.Key_Apostrophe - text: "'" - } - Key { - key: Qt.Key_Colon - text: ":" - } - Key { - key: Qt.Key_Semicolon - text: ";" - } - Key { - key: Qt.Key_Slash - text: "/" - } - Key { - key: Qt.Key_Question - text: "?" - } - Key { - weight: 204 - displayText: "1/2" - functionKey: true - onClicked: secondPage = !secondPage - } - } - KeyboardRow { - keyWeight: 154 - SymbolModeKey { - weight: 217 - displayText: "ABC" - } - ChangeLanguageKey { - weight: 154 - } - SpaceKey { - weight: 864 - } - Key { - key: Qt.Key_Period - text: "." - alternativeKeys: ".," - } - Key { - key: 0xE000 - text: ":-)" - alternativeKeys: [ ";-)", ":-)", ":-D", ":-(", "<3" ] - } - HideKeyboardKey { - weight: 204 - } - } - } - } - Component { - id: page2 - KeyboardLayout { - keyWeight: 160 - KeyboardRow { - Key { - key: Qt.Key_AsciiTilde - text: "~" - } - Key { - key: Qt.Key_Agrave - text: "`" - } - Key { - key: Qt.Key_Bar - text: "|" - } - Key { - key: 0x7B - text: "·" - } - Key { - key: 0x221A - text: "√" - } - Key { - key: Qt.Key_division - text: "÷" - } - Key { - key: Qt.Key_multiply - text: "×" - } - Key { - key: Qt.Key_onehalf - text: "½" - alternativeKeys: "¼⅓½¾⅞" - } - Key { - key: Qt.Key_BraceLeft - text: "{" - } - Key { - key: Qt.Key_BraceRight - text: "}" - } - BackspaceKey {} - } - KeyboardRow { - FillerKey { - weight: 56 - } - Key { - key: Qt.Key_Dollar - text: "$" - } - Key { - key: 0x20AC - text: "€" - } - Key { - key: 0xC2 - text: "£" - } - Key { - key: 0xA2 - text: "¢" - } - Key { - key: 0xA5 - text: "¥" - } - Key { - key: Qt.Key_Equal - text: "=" - } - Key { - key: Qt.Key_section - text: "§" - } - Key { - key: Qt.Key_BracketLeft - text: "[" - } - Key { - key: Qt.Key_BracketRight - text: "]" - } - EnterKey { - weight: 283 - } - } - KeyboardRow { - keyWeight: 156 - Key { - displayText: "2/2" - functionKey: true - onClicked: secondPage = !secondPage - } - Key { - key: Qt.Key_Underscore - text: "_" - } - Key { - key: 0x2122 - text: '™' - } - Key { - key: 0x00AE - text: '®' - } - Key { - key: Qt.Key_guillemotleft - text: '«' - } - Key { - key: Qt.Key_guillemotright - text: '»' - } - Key { - key: 0x201C - text: '“' - } - Key { - key: 0x201D - text: '”' - } - Key { - key: Qt.Key_Backslash - text: "\\" - } - Key { - key: Qt.Key_AsciiCircum - text: "^" - } - Key { - weight: 204 - displayText: "2/2" - functionKey: true - onClicked: secondPage = !secondPage - } - } - KeyboardRow { - keyWeight: 154 - SymbolModeKey { - weight: 217 - displayText: "ABC" - } - ChangeLanguageKey { - weight: 154 - } - SpaceKey { - weight: 864 - } - Key { - key: 0x2026 - text: "\u2026" - } - Key { - key: 0xE000 - text: ":-)" - alternativeKeys: [ ";-)", ":-)", ":-D", ":-(", "<3" ] - } - HideKeyboardKey { - weight: 204 - } - } - } - } -} diff --git a/src/virtualkeyboard/content/layouts/he_IL/dialpad.fallback b/src/virtualkeyboard/content/layouts/he_IL/dialpad.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/he_IL/dialpad.fallback diff --git a/src/virtualkeyboard/content/layouts/he_IL/digits.fallback b/src/virtualkeyboard/content/layouts/he_IL/digits.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/he_IL/digits.fallback diff --git a/src/virtualkeyboard/content/layouts/he_IL/numbers.fallback b/src/virtualkeyboard/content/layouts/he_IL/numbers.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/he_IL/numbers.fallback diff --git a/src/virtualkeyboard/content/layouts/hi_IN/dialpad.fallback b/src/virtualkeyboard/content/layouts/hi_IN/dialpad.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/hi_IN/dialpad.fallback diff --git a/src/virtualkeyboard/content/layouts/hi_IN/digits.fallback b/src/virtualkeyboard/content/layouts/hi_IN/digits.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/hi_IN/digits.fallback diff --git a/src/virtualkeyboard/content/layouts/et_EE/handwriting.qml b/src/virtualkeyboard/content/layouts/hi_IN/handwriting.qml index d42de535..a8147bd4 100644 --- a/src/virtualkeyboard/content/layouts/et_EE/handwriting.qml +++ b/src/virtualkeyboard/content/layouts/hi_IN/handwriting.qml @@ -29,14 +29,13 @@ import QtQuick 2.0 import QtQuick.Layouts 1.0 -import QtQuick.VirtualKeyboard 2.3 +import QtQuick.VirtualKeyboard 2.1 KeyboardLayout { function createInputMethod() { - return Qt.createQmlObject('import QtQuick 2.0; import QtQuick.VirtualKeyboard 2.3; HandwritingInputMethod {}', parent) + return Qt.createQmlObject('import QtQuick 2.0; import QtQuick.VirtualKeyboard 2.1; HandwritingInputMethod {}', parent) } sharedLayouts: ['symbols'] - inputMode: InputEngine.Latin KeyboardRow { Layout.preferredHeight: 3 @@ -66,8 +65,15 @@ KeyboardLayout { id: bottomRow Layout.preferredHeight: 1 keyWeight: 154 - InputModeKey { + Key { weight: 217 + key: Qt.Key_Mode_switch + noKeyEvent: true + functionKey: true + text: InputContext.inputEngine.inputMode === InputEngine.Latin ? "123" : "ABC" + onClicked: InputContext.inputEngine.inputMode = InputContext.inputEngine.inputMode === InputEngine.Latin ? InputEngine.Numeric : InputEngine.Latin + enabled: !(InputContext.inputMethodHints & (Qt.ImhDialableCharactersOnly | Qt.ImhFormattedNumbersOnly | Qt.ImhDigitsOnly)) + keyPanelDelegate: keyboard.style ? keyboard.style.symbolKeyPanel : undefined } ChangeLanguageKey { weight: 154 diff --git a/src/virtualkeyboard/content/layouts/hi_IN/main.qml b/src/virtualkeyboard/content/layouts/hi_IN/main.qml index 3d71adb0..974ba2ab 100644 --- a/src/virtualkeyboard/content/layouts/hi_IN/main.qml +++ b/src/virtualkeyboard/content/layouts/hi_IN/main.qml @@ -164,6 +164,9 @@ KeyboardLayoutLoader { ChangeLanguageKey { weight: 154 } + HandwritingModeKey { + weight: 154 + } SpaceKey { weight: 864 } @@ -312,6 +315,9 @@ KeyboardLayoutLoader { ChangeLanguageKey { weight: 154 } + HandwritingModeKey { + weight: 154 + } SpaceKey { weight: 864 } diff --git a/src/virtualkeyboard/content/layouts/hi_IN/numbers.fallback b/src/virtualkeyboard/content/layouts/hi_IN/numbers.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/hi_IN/numbers.fallback diff --git a/src/virtualkeyboard/content/layouts/hr_HR/dialpad.fallback b/src/virtualkeyboard/content/layouts/hr_HR/dialpad.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/hr_HR/dialpad.fallback diff --git a/src/virtualkeyboard/content/layouts/hr_HR/digits.fallback b/src/virtualkeyboard/content/layouts/hr_HR/digits.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/hr_HR/digits.fallback diff --git a/src/virtualkeyboard/content/layouts/hr_HR/numbers.fallback b/src/virtualkeyboard/content/layouts/hr_HR/numbers.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/hr_HR/numbers.fallback diff --git a/src/virtualkeyboard/content/layouts/hr_HR/symbols.fallback b/src/virtualkeyboard/content/layouts/hr_HR/symbols.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/hr_HR/symbols.fallback diff --git a/src/virtualkeyboard/content/layouts/hu_HU/dialpad.fallback b/src/virtualkeyboard/content/layouts/hu_HU/dialpad.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/hu_HU/dialpad.fallback diff --git a/src/virtualkeyboard/content/layouts/hu_HU/digits.fallback b/src/virtualkeyboard/content/layouts/hu_HU/digits.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/hu_HU/digits.fallback diff --git a/src/virtualkeyboard/content/layouts/hu_HU/numbers.fallback b/src/virtualkeyboard/content/layouts/hu_HU/numbers.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/hu_HU/numbers.fallback diff --git a/src/virtualkeyboard/content/layouts/hu_HU/symbols.fallback b/src/virtualkeyboard/content/layouts/hu_HU/symbols.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/hu_HU/symbols.fallback diff --git a/src/virtualkeyboard/content/layouts/hu_HU/symbols.qml b/src/virtualkeyboard/content/layouts/hu_HU/symbols.qml deleted file mode 100644 index 76c06493..00000000 --- a/src/virtualkeyboard/content/layouts/hu_HU/symbols.qml +++ /dev/null @@ -1,376 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Virtual Keyboard module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 -import QtQuick.Layouts 1.0 -import QtQuick.VirtualKeyboard 2.3 - -KeyboardLayoutLoader { - property bool secondPage - onVisibleChanged: if (!visible) secondPage = false - sourceComponent: secondPage ? page2 : page1 - Component { - id: page1 - KeyboardLayout { - keyWeight: 160 - KeyboardRow { - Key { - key: Qt.Key_1 - text: "1" - } - Key { - key: Qt.Key_2 - text: "2" - } - Key { - key: Qt.Key_3 - text: "3" - } - Key { - key: Qt.Key_4 - text: "4" - } - Key { - key: Qt.Key_5 - text: "5" - } - Key { - key: Qt.Key_6 - text: "6" - } - Key { - key: Qt.Key_7 - text: "7" - } - Key { - key: Qt.Key_8 - text: "8" - } - Key { - key: Qt.Key_9 - text: "9" - } - Key { - key: Qt.Key_0 - text: "0" - } - BackspaceKey {} - } - KeyboardRow { - FillerKey { - weight: 56 - } - Key { - key: Qt.Key_At - text: "@" - } - Key { - key: Qt.Key_NumberSign - text: "#" - } - Key { - key: Qt.Key_Percent - text: "%" - } - Key { - key: Qt.Key_Ampersand - text: "&" - } - Key { - key: Qt.Key_Asterisk - text: "*" - } - Key { - key: Qt.Key_Minus - text: "-" - } - Key { - key: Qt.Key_Plus - text: "+" - } - Key { - key: Qt.Key_ParenLeft - text: "(" - } - Key { - key: Qt.Key_ParenRight - text: ")" - } - EnterKey { - weight: 283 - } - } - KeyboardRow { - keyWeight: 156 - Key { - displayText: "1/2" - functionKey: true - onClicked: secondPage = !secondPage - } - Key { - key: Qt.Key_Exclam - text: "!" - } - Key { - key: Qt.Key_QuoteDbl - text: '"' - } - Key { - key: Qt.Key_Apostrophe - text: "'" - } - Key { - key: Qt.Key_Less - text: "<" - } - Key { - key: Qt.Key_Greater - text: ">" - } - Key { - key: Qt.Key_Colon - text: ":" - } - Key { - key: Qt.Key_Semicolon - text: ";" - } - Key { - key: Qt.Key_Slash - text: "/" - } - Key { - key: Qt.Key_Question - text: "?" - } - Key { - weight: 204 - displayText: "1/2" - functionKey: true - onClicked: secondPage = !secondPage - } - } - KeyboardRow { - keyWeight: 154 - SymbolModeKey { - weight: 217 - displayText: "ABC" - } - ChangeLanguageKey { - weight: 154 - } - SpaceKey { - weight: 864 - } - Key { - key: Qt.Key_Period - text: "." - alternativeKeys: ".," - } - Key { - key: 0xE000 - text: ":-)" - alternativeKeys: [ ";-)", ":-)", ":-D", ":-(", "<3" ] - } - HideKeyboardKey { - weight: 204 - } - } - } - } - Component { - id: page2 - KeyboardLayout { - keyWeight: 160 - KeyboardRow { - Key { - key: Qt.Key_AsciiTilde - text: "~" - } - Key { - key: Qt.Key_Agrave - text: "`" - } - Key { - key: Qt.Key_Bar - text: "|" - } - Key { - key: 0x7B - text: "·" - } - Key { - key: 0x221A - text: "√" - } - Key { - key: Qt.Key_division - text: "÷" - } - Key { - key: Qt.Key_multiply - text: "×" - } - Key { - key: Qt.Key_onehalf - text: "½" - alternativeKeys: "¼⅓½¾⅞" - } - Key { - key: Qt.Key_BraceLeft - text: "{" - } - Key { - key: Qt.Key_BraceRight - text: "}" - } - BackspaceKey {} - } - KeyboardRow { - FillerKey { - weight: 56 - } - Key { - key: Qt.Key_Dollar - text: "$" - } - Key { - key: 0x20AC - text: "€" - } - Key { - key: 0xC2 - text: "£" - } - Key { - key: 0xA2 - text: "¢" - } - Key { - key: 0xA5 - text: "¥" - } - Key { - key: Qt.Key_Equal - text: "=" - } - Key { - key: Qt.Key_section - text: "§" - } - Key { - key: Qt.Key_BracketLeft - text: "[" - } - Key { - key: Qt.Key_BracketRight - text: "]" - } - EnterKey { - weight: 283 - } - } - KeyboardRow { - keyWeight: 156 - Key { - displayText: "2/2" - functionKey: true - onClicked: secondPage = !secondPage - } - Key { - key: Qt.Key_Underscore - text: "_" - } - Key { - key: 0x2122 - text: '™' - } - Key { - key: 0x00AE - text: '®' - } - Key { - key: Qt.Key_guillemotleft - text: '«' - } - Key { - key: Qt.Key_guillemotright - text: '»' - } - Key { - key: 0x201C - text: '“' - } - Key { - key: 0x201D - text: '”' - } - Key { - key: Qt.Key_Backslash - text: "\\" - } - Key { - key: Qt.Key_AsciiCircum - text: "^" - } - Key { - weight: 204 - displayText: "2/2" - functionKey: true - onClicked: secondPage = !secondPage - } - } - KeyboardRow { - keyWeight: 154 - SymbolModeKey { - weight: 217 - displayText: "ABC" - } - ChangeLanguageKey { - weight: 154 - } - SpaceKey { - weight: 864 - } - Key { - key: 0x2026 - text: "\u2026" - } - Key { - key: 0xE000 - text: ":-)" - alternativeKeys: [ ";-)", ":-)", ":-D", ":-(", "<3" ] - } - HideKeyboardKey { - weight: 204 - } - } - } - } -} diff --git a/src/virtualkeyboard/content/layouts/id_ID/dialpad.fallback b/src/virtualkeyboard/content/layouts/id_ID/dialpad.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/id_ID/dialpad.fallback diff --git a/src/virtualkeyboard/content/layouts/id_ID/digits.fallback b/src/virtualkeyboard/content/layouts/id_ID/digits.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/id_ID/digits.fallback diff --git a/src/virtualkeyboard/content/layouts/id_ID/handwriting.fallback b/src/virtualkeyboard/content/layouts/id_ID/handwriting.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/id_ID/handwriting.fallback diff --git a/src/virtualkeyboard/content/layouts/id_ID/main.fallback b/src/virtualkeyboard/content/layouts/id_ID/main.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/id_ID/main.fallback diff --git a/src/virtualkeyboard/content/layouts/id_ID/numbers.fallback b/src/virtualkeyboard/content/layouts/id_ID/numbers.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/id_ID/numbers.fallback diff --git a/src/virtualkeyboard/content/layouts/id_ID/symbols.fallback b/src/virtualkeyboard/content/layouts/id_ID/symbols.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/id_ID/symbols.fallback diff --git a/src/virtualkeyboard/content/layouts/it_IT/dialpad.fallback b/src/virtualkeyboard/content/layouts/it_IT/dialpad.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/it_IT/dialpad.fallback diff --git a/src/virtualkeyboard/content/layouts/it_IT/digits.fallback b/src/virtualkeyboard/content/layouts/it_IT/digits.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/it_IT/digits.fallback diff --git a/src/virtualkeyboard/content/layouts/it_IT/handwriting.fallback b/src/virtualkeyboard/content/layouts/it_IT/handwriting.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/it_IT/handwriting.fallback diff --git a/src/virtualkeyboard/content/layouts/it_IT/handwriting.qml b/src/virtualkeyboard/content/layouts/it_IT/handwriting.qml deleted file mode 100644 index d42de535..00000000 --- a/src/virtualkeyboard/content/layouts/it_IT/handwriting.qml +++ /dev/null @@ -1,97 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Virtual Keyboard module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 -import QtQuick.Layouts 1.0 -import QtQuick.VirtualKeyboard 2.3 - -KeyboardLayout { - function createInputMethod() { - return Qt.createQmlObject('import QtQuick 2.0; import QtQuick.VirtualKeyboard 2.3; HandwritingInputMethod {}', parent) - } - sharedLayouts: ['symbols'] - inputMode: InputEngine.Latin - - KeyboardRow { - Layout.preferredHeight: 3 - KeyboardColumn { - Layout.preferredWidth: bottomRow.width - hideKeyboardKey.width - KeyboardRow { - TraceInputKey { - objectName: "hwrInputArea" - patternRecognitionMode: InputEngine.HandwritingRecoginition - } - } - } - KeyboardColumn { - Layout.preferredWidth: hideKeyboardKey.width - KeyboardRow { - BackspaceKey {} - } - KeyboardRow { - EnterKey {} - } - KeyboardRow { - ShiftKey { } - } - } - } - KeyboardRow { - id: bottomRow - Layout.preferredHeight: 1 - keyWeight: 154 - InputModeKey { - weight: 217 - } - ChangeLanguageKey { - weight: 154 - customLayoutsOnly: true - } - HandwritingModeKey { - weight: 154 - } - SpaceKey { - weight: 864 - } - Key { - key: Qt.Key_Apostrophe - text: "'" - alternativeKeys: "<>()#%&*/\\\"'=+-_" - } - Key { - key: Qt.Key_Period - text: "." - alternativeKeys: ":;,.?!" - } - HideKeyboardKey { - id: hideKeyboardKey - weight: 204 - } - } -} diff --git a/src/virtualkeyboard/content/layouts/it_IT/numbers.fallback b/src/virtualkeyboard/content/layouts/it_IT/numbers.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/it_IT/numbers.fallback diff --git a/src/virtualkeyboard/content/layouts/it_IT/symbols.fallback b/src/virtualkeyboard/content/layouts/it_IT/symbols.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/it_IT/symbols.fallback diff --git a/src/virtualkeyboard/content/layouts/it_IT/symbols.qml b/src/virtualkeyboard/content/layouts/it_IT/symbols.qml deleted file mode 100644 index 06d815d8..00000000 --- a/src/virtualkeyboard/content/layouts/it_IT/symbols.qml +++ /dev/null @@ -1,376 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Virtual Keyboard module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 -import QtQuick.Layouts 1.0 -import QtQuick.VirtualKeyboard 2.1 - -KeyboardLayoutLoader { - property bool secondPage - onVisibleChanged: if (!visible) secondPage = false - sourceComponent: secondPage ? page2 : page1 - Component { - id: page1 - KeyboardLayout { - keyWeight: 160 - KeyboardRow { - Key { - key: Qt.Key_1 - text: "1" - } - Key { - key: Qt.Key_2 - text: "2" - } - Key { - key: Qt.Key_3 - text: "3" - } - Key { - key: Qt.Key_4 - text: "4" - } - Key { - key: Qt.Key_5 - text: "5" - } - Key { - key: Qt.Key_6 - text: "6" - } - Key { - key: Qt.Key_7 - text: "7" - } - Key { - key: Qt.Key_8 - text: "8" - } - Key { - key: Qt.Key_9 - text: "9" - } - Key { - key: Qt.Key_0 - text: "0" - } - BackspaceKey {} - } - KeyboardRow { - FillerKey { - weight: 56 - } - Key { - key: Qt.Key_At - text: "@" - } - Key { - key: Qt.Key_NumberSign - text: "#" - } - Key { - key: Qt.Key_Percent - text: "%" - } - Key { - key: Qt.Key_Ampersand - text: "&" - } - Key { - key: Qt.Key_Asterisk - text: "*" - } - Key { - key: Qt.Key_Minus - text: "-" - } - Key { - key: Qt.Key_Plus - text: "+" - } - Key { - key: Qt.Key_ParenLeft - text: "(" - } - Key { - key: Qt.Key_ParenRight - text: ")" - } - EnterKey { - weight: 283 - } - } - KeyboardRow { - keyWeight: 156 - Key { - displayText: "1/2" - functionKey: true - onClicked: secondPage = !secondPage - } - Key { - key: Qt.Key_Exclam - text: "!" - } - Key { - key: Qt.Key_QuoteDbl - text: '"' - } - Key { - key: Qt.Key_Less - text: "<" - } - Key { - key: Qt.Key_Greater - text: ">" - } - Key { - key: Qt.Key_Apostrophe - text: "'" - } - Key { - key: Qt.Key_Colon - text: ":" - } - Key { - key: Qt.Key_Semicolon - text: ";" - } - Key { - key: Qt.Key_Slash - text: "/" - } - Key { - key: Qt.Key_Question - text: "?" - } - Key { - weight: 204 - displayText: "1/2" - functionKey: true - onClicked: secondPage = !secondPage - } - } - KeyboardRow { - keyWeight: 154 - SymbolModeKey { - weight: 217 - displayText: "ABC" - } - ChangeLanguageKey { - weight: 154 - } - SpaceKey { - weight: 864 - } - Key { - key: Qt.Key_Period - text: "." - alternativeKeys: ".," - } - Key { - key: 0xE000 - text: ":-)" - alternativeKeys: [ ";-)", ":-)", ":-D", ":-(", "<3" ] - } - HideKeyboardKey { - weight: 204 - } - } - } - } - Component { - id: page2 - KeyboardLayout { - keyWeight: 160 - KeyboardRow { - Key { - key: Qt.Key_AsciiTilde - text: "~" - } - Key { - key: Qt.Key_Agrave - text: "`" - } - Key { - key: Qt.Key_Bar - text: "|" - } - Key { - key: 0x7B - text: "·" - } - Key { - key: 0x221A - text: "√" - } - Key { - key: Qt.Key_division - text: "÷" - } - Key { - key: Qt.Key_multiply - text: "×" - } - Key { - key: Qt.Key_onehalf - text: "½" - alternativeKeys: "¼⅓½¾⅞" - } - Key { - key: Qt.Key_BraceLeft - text: "{" - } - Key { - key: Qt.Key_BraceRight - text: "}" - } - BackspaceKey {} - } - KeyboardRow { - FillerKey { - weight: 56 - } - Key { - key: Qt.Key_Dollar - text: "$" - } - Key { - key: 0x20AC - text: "€" - } - Key { - key: 0xC2 - text: "£" - } - Key { - key: 0xA2 - text: "¢" - } - Key { - key: 0xA5 - text: "¥" - } - Key { - key: Qt.Key_Equal - text: "=" - } - Key { - key: Qt.Key_section - text: "§" - } - Key { - key: Qt.Key_BracketLeft - text: "[" - } - Key { - key: Qt.Key_BracketRight - text: "]" - } - EnterKey { - weight: 283 - } - } - KeyboardRow { - keyWeight: 156 - Key { - displayText: "2/2" - functionKey: true - onClicked: secondPage = !secondPage - } - Key { - key: Qt.Key_Underscore - text: "_" - } - Key { - key: 0x2122 - text: '™' - } - Key { - key: 0x00AE - text: '®' - } - Key { - key: Qt.Key_guillemotleft - text: '«' - } - Key { - key: Qt.Key_guillemotright - text: '»' - } - Key { - key: 0x201C - text: '“' - } - Key { - key: 0x201D - text: '”' - } - Key { - key: Qt.Key_Backslash - text: "\\" - } - Key { - key: Qt.Key_AsciiCircum - text: "^" - } - Key { - weight: 204 - displayText: "2/2" - functionKey: true - onClicked: secondPage = !secondPage - } - } - KeyboardRow { - keyWeight: 154 - SymbolModeKey { - weight: 217 - displayText: "ABC" - } - ChangeLanguageKey { - weight: 154 - } - SpaceKey { - weight: 864 - } - Key { - key: 0x2026 - text: "\u2026" - } - Key { - key: 0xE000 - text: ":-)" - alternativeKeys: [ ";-)", ":-)", ":-D", ":-(", "<3" ] - } - HideKeyboardKey { - weight: 204 - } - } - } - } -} diff --git a/src/virtualkeyboard/content/layouts/ja_JP/dialpad.fallback b/src/virtualkeyboard/content/layouts/ja_JP/dialpad.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/ja_JP/dialpad.fallback diff --git a/src/virtualkeyboard/content/layouts/ja_JP/digits.fallback b/src/virtualkeyboard/content/layouts/ja_JP/digits.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/ja_JP/digits.fallback diff --git a/src/virtualkeyboard/content/layouts/ja_JP/numbers.fallback b/src/virtualkeyboard/content/layouts/ja_JP/numbers.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/ja_JP/numbers.fallback diff --git a/src/virtualkeyboard/content/layouts/ko_KR/dialpad.fallback b/src/virtualkeyboard/content/layouts/ko_KR/dialpad.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/ko_KR/dialpad.fallback diff --git a/src/virtualkeyboard/content/layouts/ko_KR/digits.fallback b/src/virtualkeyboard/content/layouts/ko_KR/digits.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/ko_KR/digits.fallback diff --git a/src/virtualkeyboard/content/layouts/ko_KR/numbers.fallback b/src/virtualkeyboard/content/layouts/ko_KR/numbers.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/ko_KR/numbers.fallback diff --git a/src/virtualkeyboard/content/layouts/ms_MY/dialpad.fallback b/src/virtualkeyboard/content/layouts/ms_MY/dialpad.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/ms_MY/dialpad.fallback diff --git a/src/virtualkeyboard/content/layouts/ms_MY/digits.fallback b/src/virtualkeyboard/content/layouts/ms_MY/digits.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/ms_MY/digits.fallback diff --git a/src/virtualkeyboard/content/layouts/ms_MY/handwriting.fallback b/src/virtualkeyboard/content/layouts/ms_MY/handwriting.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/ms_MY/handwriting.fallback diff --git a/src/virtualkeyboard/content/layouts/ms_MY/main.fallback b/src/virtualkeyboard/content/layouts/ms_MY/main.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/ms_MY/main.fallback diff --git a/src/virtualkeyboard/content/layouts/ms_MY/numbers.fallback b/src/virtualkeyboard/content/layouts/ms_MY/numbers.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/ms_MY/numbers.fallback diff --git a/src/virtualkeyboard/content/layouts/ms_MY/symbols.fallback b/src/virtualkeyboard/content/layouts/ms_MY/symbols.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/ms_MY/symbols.fallback diff --git a/src/virtualkeyboard/content/layouts/nb_NO/dialpad.fallback b/src/virtualkeyboard/content/layouts/nb_NO/dialpad.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/nb_NO/dialpad.fallback diff --git a/src/virtualkeyboard/content/layouts/nb_NO/digits.fallback b/src/virtualkeyboard/content/layouts/nb_NO/digits.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/nb_NO/digits.fallback diff --git a/src/virtualkeyboard/content/layouts/nb_NO/handwriting.fallback b/src/virtualkeyboard/content/layouts/nb_NO/handwriting.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/nb_NO/handwriting.fallback diff --git a/src/virtualkeyboard/content/layouts/nb_NO/handwriting.qml b/src/virtualkeyboard/content/layouts/nb_NO/handwriting.qml deleted file mode 100644 index d42de535..00000000 --- a/src/virtualkeyboard/content/layouts/nb_NO/handwriting.qml +++ /dev/null @@ -1,97 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Virtual Keyboard module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 -import QtQuick.Layouts 1.0 -import QtQuick.VirtualKeyboard 2.3 - -KeyboardLayout { - function createInputMethod() { - return Qt.createQmlObject('import QtQuick 2.0; import QtQuick.VirtualKeyboard 2.3; HandwritingInputMethod {}', parent) - } - sharedLayouts: ['symbols'] - inputMode: InputEngine.Latin - - KeyboardRow { - Layout.preferredHeight: 3 - KeyboardColumn { - Layout.preferredWidth: bottomRow.width - hideKeyboardKey.width - KeyboardRow { - TraceInputKey { - objectName: "hwrInputArea" - patternRecognitionMode: InputEngine.HandwritingRecoginition - } - } - } - KeyboardColumn { - Layout.preferredWidth: hideKeyboardKey.width - KeyboardRow { - BackspaceKey {} - } - KeyboardRow { - EnterKey {} - } - KeyboardRow { - ShiftKey { } - } - } - } - KeyboardRow { - id: bottomRow - Layout.preferredHeight: 1 - keyWeight: 154 - InputModeKey { - weight: 217 - } - ChangeLanguageKey { - weight: 154 - customLayoutsOnly: true - } - HandwritingModeKey { - weight: 154 - } - SpaceKey { - weight: 864 - } - Key { - key: Qt.Key_Apostrophe - text: "'" - alternativeKeys: "<>()#%&*/\\\"'=+-_" - } - Key { - key: Qt.Key_Period - text: "." - alternativeKeys: ":;,.?!" - } - HideKeyboardKey { - id: hideKeyboardKey - weight: 204 - } - } -} diff --git a/src/virtualkeyboard/content/layouts/nb_NO/numbers.fallback b/src/virtualkeyboard/content/layouts/nb_NO/numbers.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/nb_NO/numbers.fallback diff --git a/src/virtualkeyboard/content/layouts/nb_NO/symbols.fallback b/src/virtualkeyboard/content/layouts/nb_NO/symbols.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/nb_NO/symbols.fallback diff --git a/src/virtualkeyboard/content/layouts/nb_NO/symbols.qml b/src/virtualkeyboard/content/layouts/nb_NO/symbols.qml deleted file mode 100644 index 06d815d8..00000000 --- a/src/virtualkeyboard/content/layouts/nb_NO/symbols.qml +++ /dev/null @@ -1,376 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Virtual Keyboard module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 -import QtQuick.Layouts 1.0 -import QtQuick.VirtualKeyboard 2.1 - -KeyboardLayoutLoader { - property bool secondPage - onVisibleChanged: if (!visible) secondPage = false - sourceComponent: secondPage ? page2 : page1 - Component { - id: page1 - KeyboardLayout { - keyWeight: 160 - KeyboardRow { - Key { - key: Qt.Key_1 - text: "1" - } - Key { - key: Qt.Key_2 - text: "2" - } - Key { - key: Qt.Key_3 - text: "3" - } - Key { - key: Qt.Key_4 - text: "4" - } - Key { - key: Qt.Key_5 - text: "5" - } - Key { - key: Qt.Key_6 - text: "6" - } - Key { - key: Qt.Key_7 - text: "7" - } - Key { - key: Qt.Key_8 - text: "8" - } - Key { - key: Qt.Key_9 - text: "9" - } - Key { - key: Qt.Key_0 - text: "0" - } - BackspaceKey {} - } - KeyboardRow { - FillerKey { - weight: 56 - } - Key { - key: Qt.Key_At - text: "@" - } - Key { - key: Qt.Key_NumberSign - text: "#" - } - Key { - key: Qt.Key_Percent - text: "%" - } - Key { - key: Qt.Key_Ampersand - text: "&" - } - Key { - key: Qt.Key_Asterisk - text: "*" - } - Key { - key: Qt.Key_Minus - text: "-" - } - Key { - key: Qt.Key_Plus - text: "+" - } - Key { - key: Qt.Key_ParenLeft - text: "(" - } - Key { - key: Qt.Key_ParenRight - text: ")" - } - EnterKey { - weight: 283 - } - } - KeyboardRow { - keyWeight: 156 - Key { - displayText: "1/2" - functionKey: true - onClicked: secondPage = !secondPage - } - Key { - key: Qt.Key_Exclam - text: "!" - } - Key { - key: Qt.Key_QuoteDbl - text: '"' - } - Key { - key: Qt.Key_Less - text: "<" - } - Key { - key: Qt.Key_Greater - text: ">" - } - Key { - key: Qt.Key_Apostrophe - text: "'" - } - Key { - key: Qt.Key_Colon - text: ":" - } - Key { - key: Qt.Key_Semicolon - text: ";" - } - Key { - key: Qt.Key_Slash - text: "/" - } - Key { - key: Qt.Key_Question - text: "?" - } - Key { - weight: 204 - displayText: "1/2" - functionKey: true - onClicked: secondPage = !secondPage - } - } - KeyboardRow { - keyWeight: 154 - SymbolModeKey { - weight: 217 - displayText: "ABC" - } - ChangeLanguageKey { - weight: 154 - } - SpaceKey { - weight: 864 - } - Key { - key: Qt.Key_Period - text: "." - alternativeKeys: ".," - } - Key { - key: 0xE000 - text: ":-)" - alternativeKeys: [ ";-)", ":-)", ":-D", ":-(", "<3" ] - } - HideKeyboardKey { - weight: 204 - } - } - } - } - Component { - id: page2 - KeyboardLayout { - keyWeight: 160 - KeyboardRow { - Key { - key: Qt.Key_AsciiTilde - text: "~" - } - Key { - key: Qt.Key_Agrave - text: "`" - } - Key { - key: Qt.Key_Bar - text: "|" - } - Key { - key: 0x7B - text: "·" - } - Key { - key: 0x221A - text: "√" - } - Key { - key: Qt.Key_division - text: "÷" - } - Key { - key: Qt.Key_multiply - text: "×" - } - Key { - key: Qt.Key_onehalf - text: "½" - alternativeKeys: "¼⅓½¾⅞" - } - Key { - key: Qt.Key_BraceLeft - text: "{" - } - Key { - key: Qt.Key_BraceRight - text: "}" - } - BackspaceKey {} - } - KeyboardRow { - FillerKey { - weight: 56 - } - Key { - key: Qt.Key_Dollar - text: "$" - } - Key { - key: 0x20AC - text: "€" - } - Key { - key: 0xC2 - text: "£" - } - Key { - key: 0xA2 - text: "¢" - } - Key { - key: 0xA5 - text: "¥" - } - Key { - key: Qt.Key_Equal - text: "=" - } - Key { - key: Qt.Key_section - text: "§" - } - Key { - key: Qt.Key_BracketLeft - text: "[" - } - Key { - key: Qt.Key_BracketRight - text: "]" - } - EnterKey { - weight: 283 - } - } - KeyboardRow { - keyWeight: 156 - Key { - displayText: "2/2" - functionKey: true - onClicked: secondPage = !secondPage - } - Key { - key: Qt.Key_Underscore - text: "_" - } - Key { - key: 0x2122 - text: '™' - } - Key { - key: 0x00AE - text: '®' - } - Key { - key: Qt.Key_guillemotleft - text: '«' - } - Key { - key: Qt.Key_guillemotright - text: '»' - } - Key { - key: 0x201C - text: '“' - } - Key { - key: 0x201D - text: '”' - } - Key { - key: Qt.Key_Backslash - text: "\\" - } - Key { - key: Qt.Key_AsciiCircum - text: "^" - } - Key { - weight: 204 - displayText: "2/2" - functionKey: true - onClicked: secondPage = !secondPage - } - } - KeyboardRow { - keyWeight: 154 - SymbolModeKey { - weight: 217 - displayText: "ABC" - } - ChangeLanguageKey { - weight: 154 - } - SpaceKey { - weight: 864 - } - Key { - key: 0x2026 - text: "\u2026" - } - Key { - key: 0xE000 - text: ":-)" - alternativeKeys: [ ";-)", ":-)", ":-D", ":-(", "<3" ] - } - HideKeyboardKey { - weight: 204 - } - } - } - } -} diff --git a/src/virtualkeyboard/content/layouts/nl_NL/dialpad.fallback b/src/virtualkeyboard/content/layouts/nl_NL/dialpad.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/nl_NL/dialpad.fallback diff --git a/src/virtualkeyboard/content/layouts/nl_NL/digits.fallback b/src/virtualkeyboard/content/layouts/nl_NL/digits.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/nl_NL/digits.fallback diff --git a/src/virtualkeyboard/content/layouts/nl_NL/handwriting.fallback b/src/virtualkeyboard/content/layouts/nl_NL/handwriting.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/nl_NL/handwriting.fallback diff --git a/src/virtualkeyboard/content/layouts/nl_NL/handwriting.qml b/src/virtualkeyboard/content/layouts/nl_NL/handwriting.qml deleted file mode 100644 index d42de535..00000000 --- a/src/virtualkeyboard/content/layouts/nl_NL/handwriting.qml +++ /dev/null @@ -1,97 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Virtual Keyboard module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 -import QtQuick.Layouts 1.0 -import QtQuick.VirtualKeyboard 2.3 - -KeyboardLayout { - function createInputMethod() { - return Qt.createQmlObject('import QtQuick 2.0; import QtQuick.VirtualKeyboard 2.3; HandwritingInputMethod {}', parent) - } - sharedLayouts: ['symbols'] - inputMode: InputEngine.Latin - - KeyboardRow { - Layout.preferredHeight: 3 - KeyboardColumn { - Layout.preferredWidth: bottomRow.width - hideKeyboardKey.width - KeyboardRow { - TraceInputKey { - objectName: "hwrInputArea" - patternRecognitionMode: InputEngine.HandwritingRecoginition - } - } - } - KeyboardColumn { - Layout.preferredWidth: hideKeyboardKey.width - KeyboardRow { - BackspaceKey {} - } - KeyboardRow { - EnterKey {} - } - KeyboardRow { - ShiftKey { } - } - } - } - KeyboardRow { - id: bottomRow - Layout.preferredHeight: 1 - keyWeight: 154 - InputModeKey { - weight: 217 - } - ChangeLanguageKey { - weight: 154 - customLayoutsOnly: true - } - HandwritingModeKey { - weight: 154 - } - SpaceKey { - weight: 864 - } - Key { - key: Qt.Key_Apostrophe - text: "'" - alternativeKeys: "<>()#%&*/\\\"'=+-_" - } - Key { - key: Qt.Key_Period - text: "." - alternativeKeys: ":;,.?!" - } - HideKeyboardKey { - id: hideKeyboardKey - weight: 204 - } - } -} diff --git a/src/virtualkeyboard/content/layouts/nl_NL/main.fallback b/src/virtualkeyboard/content/layouts/nl_NL/main.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/nl_NL/main.fallback diff --git a/src/virtualkeyboard/content/layouts/nl_NL/numbers.fallback b/src/virtualkeyboard/content/layouts/nl_NL/numbers.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/nl_NL/numbers.fallback diff --git a/src/virtualkeyboard/content/layouts/nl_NL/symbols.fallback b/src/virtualkeyboard/content/layouts/nl_NL/symbols.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/nl_NL/symbols.fallback diff --git a/src/virtualkeyboard/content/layouts/nl_NL/symbols.qml b/src/virtualkeyboard/content/layouts/nl_NL/symbols.qml deleted file mode 100644 index 49f6e709..00000000 --- a/src/virtualkeyboard/content/layouts/nl_NL/symbols.qml +++ /dev/null @@ -1,376 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Virtual Keyboard module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 -import QtQuick.Layouts 1.0 -import QtQuick.VirtualKeyboard 2.1 - -KeyboardLayoutLoader { - property bool secondPage - onVisibleChanged: if (!visible) secondPage = false - sourceComponent: secondPage ? page2 : page1 - Component { - id: page1 - KeyboardLayout { - keyWeight: 160 - KeyboardRow { - Key { - key: Qt.Key_1 - text: "1" - } - Key { - key: Qt.Key_2 - text: "2" - } - Key { - key: Qt.Key_3 - text: "3" - } - Key { - key: Qt.Key_4 - text: "4" - } - Key { - key: Qt.Key_5 - text: "5" - } - Key { - key: Qt.Key_6 - text: "6" - } - Key { - key: Qt.Key_7 - text: "7" - } - Key { - key: Qt.Key_8 - text: "8" - } - Key { - key: Qt.Key_9 - text: "9" - } - Key { - key: Qt.Key_0 - text: "0" - } - BackspaceKey {} - } - KeyboardRow { - FillerKey { - weight: 56 - } - Key { - key: Qt.Key_At - text: "@" - } - Key { - key: Qt.Key_NumberSign - text: "#" - } - Key { - key: Qt.Key_Percent - text: "%" - } - Key { - key: Qt.Key_Ampersand - text: "&" - } - Key { - key: Qt.Key_Asterisk - text: "*" - } - Key { - key: Qt.Key_Minus - text: "-" - } - Key { - key: Qt.Key_Plus - text: "+" - } - Key { - key: Qt.Key_ParenLeft - text: "(" - } - Key { - key: Qt.Key_ParenRight - text: ")" - } - EnterKey { - weight: 283 - } - } - KeyboardRow { - keyWeight: 156 - Key { - displayText: "1/2" - functionKey: true - onClicked: secondPage = !secondPage - } - Key { - key: Qt.Key_Exclam - text: "!" - } - Key { - key: Qt.Key_QuoteDbl - text: '"' - } - Key { - key: Qt.Key_Less - text: "<" - } - Key { - key: Qt.Key_Greater - text: ">" - } - Key { - key: Qt.Key_Apostrophe - text: "'" - } - Key { - key: Qt.Key_Colon - text: ":" - } - Key { - key: Qt.Key_Semicolon - text: ";" - } - Key { - key: Qt.Key_Slash - text: "/" - } - Key { - key: Qt.Key_Question - text: "?" - } - Key { - weight: 204 - displayText: "1/2" - functionKey: true - onClicked: secondPage = !secondPage - } - } - KeyboardRow { - keyWeight: 154 - SymbolModeKey { - weight: 217 - displayText: "ABC" - } - ChangeLanguageKey { - weight: 154 - } - SpaceKey { - weight: 864 - } - Key { - key: Qt.Key_Period - text: "." - alternativeKeys: ".," - } - Key { - key: 0xE000 - text: ":-)" - alternativeKeys: [ ";-)", ":-)", ":-D", ":-(", "<3" ] - } - HideKeyboardKey { - weight: 204 - } - } - } - } - Component { - id: page2 - KeyboardLayout { - keyWeight: 160 - KeyboardRow { - Key { - key: Qt.Key_AsciiTilde - text: "~" - } - Key { - key: Qt.Key_Agrave - text: "`" - } - Key { - key: Qt.Key_Bar - text: "|" - } - Key { - key: 0x7B - text: "·" - } - Key { - key: 0x221A - text: "√" - } - Key { - key: Qt.Key_division - text: "÷" - } - Key { - key: Qt.Key_multiply - text: "×" - } - Key { - key: Qt.Key_onehalf - text: "½" - alternativeKeys: "¼⅓½¾⅞" - } - Key { - key: Qt.Key_BraceLeft - text: "{" - } - Key { - key: Qt.Key_BraceRight - text: "}" - } - BackspaceKey {} - } - KeyboardRow { - FillerKey { - weight: 56 - } - Key { - key: Qt.Key_Dollar - text: "$" - } - Key { - key: 0x20AC - text: "€" - } - Key { - key: 0xC2 - text: "£" - } - Key { - key: 0xA2 - text: "¢" - } - Key { - key: 0xA5 - text: "¥" - } - Key { - key: Qt.Key_Equal - text: "=" - } - Key { - key: Qt.Key_section - text: "§" - } - Key { - key: Qt.Key_BracketLeft - text: "[" - } - Key { - key: Qt.Key_BracketRight - text: "]" - } - EnterKey { - weight: 283 - } - } - KeyboardRow { - keyWeight: 156 - Key { - displayText: "2/2" - functionKey: true - onClicked: secondPage = !secondPage - } - Key { - key: Qt.Key_Underscore - text: "_" - } - Key { - key: 0x2122 - text: '™' - } - Key { - key: 0x00AE - text: '®' - } - Key { - key: Qt.Key_guillemotleft - text: '«' - } - Key { - key: Qt.Key_guillemotright - text: '»' - } - Key { - key: 0x201C - text: '“' - } - Key { - key: 0x201D - text: '”' - } - Key { - key: Qt.Key_Backslash - text: "\\" - } - Key { - key: Qt.Key_AsciiCircum - text: "^" - } - Key { - weight: 204 - displayText: "2/2" - functionKey: true - onClicked: secondPage = !secondPage - } - } - KeyboardRow { - keyWeight: 154 - SymbolModeKey { - weight: 217 - displayText: "ABC" - } - ChangeLanguageKey { - weight: 154 - } - SpaceKey { - weight: 864 - } - Key { - key: 0x2026 - text: "\u2026" - } - Key { - key: 0xE000 - text: ":-)" - alternativeKeys: [ ";-)", ":-)", ":-D", ":-(", "<3" ] - } - HideKeyboardKey { - weight: 204 - } - } - } - } -} diff --git a/src/virtualkeyboard/content/layouts/pl_PL/dialpad.fallback b/src/virtualkeyboard/content/layouts/pl_PL/dialpad.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/pl_PL/dialpad.fallback diff --git a/src/virtualkeyboard/content/layouts/pl_PL/digits.fallback b/src/virtualkeyboard/content/layouts/pl_PL/digits.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/pl_PL/digits.fallback diff --git a/src/virtualkeyboard/content/layouts/pl_PL/handwriting.fallback b/src/virtualkeyboard/content/layouts/pl_PL/handwriting.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/pl_PL/handwriting.fallback diff --git a/src/virtualkeyboard/content/layouts/pl_PL/handwriting.qml b/src/virtualkeyboard/content/layouts/pl_PL/handwriting.qml deleted file mode 100644 index d42de535..00000000 --- a/src/virtualkeyboard/content/layouts/pl_PL/handwriting.qml +++ /dev/null @@ -1,97 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Virtual Keyboard module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 -import QtQuick.Layouts 1.0 -import QtQuick.VirtualKeyboard 2.3 - -KeyboardLayout { - function createInputMethod() { - return Qt.createQmlObject('import QtQuick 2.0; import QtQuick.VirtualKeyboard 2.3; HandwritingInputMethod {}', parent) - } - sharedLayouts: ['symbols'] - inputMode: InputEngine.Latin - - KeyboardRow { - Layout.preferredHeight: 3 - KeyboardColumn { - Layout.preferredWidth: bottomRow.width - hideKeyboardKey.width - KeyboardRow { - TraceInputKey { - objectName: "hwrInputArea" - patternRecognitionMode: InputEngine.HandwritingRecoginition - } - } - } - KeyboardColumn { - Layout.preferredWidth: hideKeyboardKey.width - KeyboardRow { - BackspaceKey {} - } - KeyboardRow { - EnterKey {} - } - KeyboardRow { - ShiftKey { } - } - } - } - KeyboardRow { - id: bottomRow - Layout.preferredHeight: 1 - keyWeight: 154 - InputModeKey { - weight: 217 - } - ChangeLanguageKey { - weight: 154 - customLayoutsOnly: true - } - HandwritingModeKey { - weight: 154 - } - SpaceKey { - weight: 864 - } - Key { - key: Qt.Key_Apostrophe - text: "'" - alternativeKeys: "<>()#%&*/\\\"'=+-_" - } - Key { - key: Qt.Key_Period - text: "." - alternativeKeys: ":;,.?!" - } - HideKeyboardKey { - id: hideKeyboardKey - weight: 204 - } - } -} diff --git a/src/virtualkeyboard/content/layouts/pl_PL/numbers.fallback b/src/virtualkeyboard/content/layouts/pl_PL/numbers.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/pl_PL/numbers.fallback diff --git a/src/virtualkeyboard/content/layouts/pl_PL/symbols.fallback b/src/virtualkeyboard/content/layouts/pl_PL/symbols.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/pl_PL/symbols.fallback diff --git a/src/virtualkeyboard/content/layouts/pl_PL/symbols.qml b/src/virtualkeyboard/content/layouts/pl_PL/symbols.qml deleted file mode 100644 index 06d815d8..00000000 --- a/src/virtualkeyboard/content/layouts/pl_PL/symbols.qml +++ /dev/null @@ -1,376 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Virtual Keyboard module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 -import QtQuick.Layouts 1.0 -import QtQuick.VirtualKeyboard 2.1 - -KeyboardLayoutLoader { - property bool secondPage - onVisibleChanged: if (!visible) secondPage = false - sourceComponent: secondPage ? page2 : page1 - Component { - id: page1 - KeyboardLayout { - keyWeight: 160 - KeyboardRow { - Key { - key: Qt.Key_1 - text: "1" - } - Key { - key: Qt.Key_2 - text: "2" - } - Key { - key: Qt.Key_3 - text: "3" - } - Key { - key: Qt.Key_4 - text: "4" - } - Key { - key: Qt.Key_5 - text: "5" - } - Key { - key: Qt.Key_6 - text: "6" - } - Key { - key: Qt.Key_7 - text: "7" - } - Key { - key: Qt.Key_8 - text: "8" - } - Key { - key: Qt.Key_9 - text: "9" - } - Key { - key: Qt.Key_0 - text: "0" - } - BackspaceKey {} - } - KeyboardRow { - FillerKey { - weight: 56 - } - Key { - key: Qt.Key_At - text: "@" - } - Key { - key: Qt.Key_NumberSign - text: "#" - } - Key { - key: Qt.Key_Percent - text: "%" - } - Key { - key: Qt.Key_Ampersand - text: "&" - } - Key { - key: Qt.Key_Asterisk - text: "*" - } - Key { - key: Qt.Key_Minus - text: "-" - } - Key { - key: Qt.Key_Plus - text: "+" - } - Key { - key: Qt.Key_ParenLeft - text: "(" - } - Key { - key: Qt.Key_ParenRight - text: ")" - } - EnterKey { - weight: 283 - } - } - KeyboardRow { - keyWeight: 156 - Key { - displayText: "1/2" - functionKey: true - onClicked: secondPage = !secondPage - } - Key { - key: Qt.Key_Exclam - text: "!" - } - Key { - key: Qt.Key_QuoteDbl - text: '"' - } - Key { - key: Qt.Key_Less - text: "<" - } - Key { - key: Qt.Key_Greater - text: ">" - } - Key { - key: Qt.Key_Apostrophe - text: "'" - } - Key { - key: Qt.Key_Colon - text: ":" - } - Key { - key: Qt.Key_Semicolon - text: ";" - } - Key { - key: Qt.Key_Slash - text: "/" - } - Key { - key: Qt.Key_Question - text: "?" - } - Key { - weight: 204 - displayText: "1/2" - functionKey: true - onClicked: secondPage = !secondPage - } - } - KeyboardRow { - keyWeight: 154 - SymbolModeKey { - weight: 217 - displayText: "ABC" - } - ChangeLanguageKey { - weight: 154 - } - SpaceKey { - weight: 864 - } - Key { - key: Qt.Key_Period - text: "." - alternativeKeys: ".," - } - Key { - key: 0xE000 - text: ":-)" - alternativeKeys: [ ";-)", ":-)", ":-D", ":-(", "<3" ] - } - HideKeyboardKey { - weight: 204 - } - } - } - } - Component { - id: page2 - KeyboardLayout { - keyWeight: 160 - KeyboardRow { - Key { - key: Qt.Key_AsciiTilde - text: "~" - } - Key { - key: Qt.Key_Agrave - text: "`" - } - Key { - key: Qt.Key_Bar - text: "|" - } - Key { - key: 0x7B - text: "·" - } - Key { - key: 0x221A - text: "√" - } - Key { - key: Qt.Key_division - text: "÷" - } - Key { - key: Qt.Key_multiply - text: "×" - } - Key { - key: Qt.Key_onehalf - text: "½" - alternativeKeys: "¼⅓½¾⅞" - } - Key { - key: Qt.Key_BraceLeft - text: "{" - } - Key { - key: Qt.Key_BraceRight - text: "}" - } - BackspaceKey {} - } - KeyboardRow { - FillerKey { - weight: 56 - } - Key { - key: Qt.Key_Dollar - text: "$" - } - Key { - key: 0x20AC - text: "€" - } - Key { - key: 0xC2 - text: "£" - } - Key { - key: 0xA2 - text: "¢" - } - Key { - key: 0xA5 - text: "¥" - } - Key { - key: Qt.Key_Equal - text: "=" - } - Key { - key: Qt.Key_section - text: "§" - } - Key { - key: Qt.Key_BracketLeft - text: "[" - } - Key { - key: Qt.Key_BracketRight - text: "]" - } - EnterKey { - weight: 283 - } - } - KeyboardRow { - keyWeight: 156 - Key { - displayText: "2/2" - functionKey: true - onClicked: secondPage = !secondPage - } - Key { - key: Qt.Key_Underscore - text: "_" - } - Key { - key: 0x2122 - text: '™' - } - Key { - key: 0x00AE - text: '®' - } - Key { - key: Qt.Key_guillemotleft - text: '«' - } - Key { - key: Qt.Key_guillemotright - text: '»' - } - Key { - key: 0x201C - text: '“' - } - Key { - key: 0x201D - text: '”' - } - Key { - key: Qt.Key_Backslash - text: "\\" - } - Key { - key: Qt.Key_AsciiCircum - text: "^" - } - Key { - weight: 204 - displayText: "2/2" - functionKey: true - onClicked: secondPage = !secondPage - } - } - KeyboardRow { - keyWeight: 154 - SymbolModeKey { - weight: 217 - displayText: "ABC" - } - ChangeLanguageKey { - weight: 154 - } - SpaceKey { - weight: 864 - } - Key { - key: 0x2026 - text: "\u2026" - } - Key { - key: 0xE000 - text: ":-)" - alternativeKeys: [ ";-)", ":-)", ":-D", ":-(", "<3" ] - } - HideKeyboardKey { - weight: 204 - } - } - } - } -} diff --git a/src/virtualkeyboard/content/layouts/pt_BR/dialpad.fallback b/src/virtualkeyboard/content/layouts/pt_BR/dialpad.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/pt_BR/dialpad.fallback diff --git a/src/virtualkeyboard/content/layouts/pt_BR/digits.fallback b/src/virtualkeyboard/content/layouts/pt_BR/digits.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/pt_BR/digits.fallback diff --git a/src/virtualkeyboard/content/layouts/pt_BR/handwriting.fallback b/src/virtualkeyboard/content/layouts/pt_BR/handwriting.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/pt_BR/handwriting.fallback diff --git a/src/virtualkeyboard/content/layouts/pt_BR/main.qml b/src/virtualkeyboard/content/layouts/pt_BR/main.qml new file mode 100644 index 00000000..21cbf640 --- /dev/null +++ b/src/virtualkeyboard/content/layouts/pt_BR/main.qml @@ -0,0 +1,207 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Qt Virtual Keyboard module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:GPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 or (at your option) any later version +** approved by the KDE Free Qt Foundation. The licenses are as published by +** the Free Software Foundation and appearing in the file LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.0 +import QtQuick.VirtualKeyboard 2.1 + +KeyboardLayout { + inputMode: InputEngine.Latin + keyWeight: 160 + KeyboardRow { + Key { + key: Qt.Key_Q + text: "q" + } + Key { + key: Qt.Key_W + text: "w" + } + Key { + key: Qt.Key_E + text: "e" + alternativeKeys: "ēęėëeêèé" + } + Key { + key: Qt.Key_R + text: "r" + } + Key { + key: Qt.Key_T + text: "t" + } + Key { + key: Qt.Key_Y + text: "y" + } + Key { + key: Qt.Key_U + text: "u" + alternativeKeys: "üûuùú" + } + Key { + key: Qt.Key_I + text: "i" + alternativeKeys: "ïįîiìí" + } + Key { + key: Qt.Key_O + text: "o" + alternativeKeys: "öõôoòó" + } + Key { + key: Qt.Key_P + text: "p" + } + BackspaceKey {} + } + KeyboardRow { + FillerKey { + weight: 56 + } + Key { + key: Qt.Key_A + text: "a" + alternativeKeys: "äãaâàá" + } + Key { + key: Qt.Key_S + text: "s" + } + Key { + key: Qt.Key_D + text: "d" + } + Key { + key: Qt.Key_F + text: "f" + } + Key { + key: Qt.Key_G + text: "g" + } + Key { + key: Qt.Key_H + text: "h" + } + Key { + key: Qt.Key_J + text: "j" + } + Key { + key: Qt.Key_K + text: "k" + } + Key { + key: Qt.Key_L + text: "l" + } + Key { + key: Qt.Key_Ccedilla + text: "ç" + } + EnterKey { + weight: 283 + } + } + KeyboardRow { + keyWeight: 156 + ShiftKey {} + Key { + key: Qt.Key_Z + text: "z" + } + Key { + key: Qt.Key_X + text: "x" + } + Key { + key: Qt.Key_C + text: "c" + alternativeKeys: "čcć" + } + Key { + key: Qt.Key_V + text: "v" + } + Key { + key: Qt.Key_B + text: "b" + } + Key { + key: Qt.Key_N + text: "n" + } + Key { + key: Qt.Key_M + text: "m" + } + Key { + key: Qt.Key_Comma + text: "," + } + Key { + key: Qt.Key_Period + text: "." + } + Key { + key: Qt.Key_Minus + text: "-" + } + ShiftKey { + weight: 244 + } + } + KeyboardRow { + keyWeight: 154 + SymbolModeKey { + weight: 217 + } + ChangeLanguageKey { + weight: 154 + } + HandwritingModeKey { + weight: 154 + } + SpaceKey { + weight: 864 + } + Key { + key: Qt.Key_Apostrophe + text: "'" + } + Key { + key: 0xE000 + text: ":-)" + alternativeKeys: [ ";-)", ":-)", ":-D", ":-(", "<3" ] + } + HideKeyboardKey { + weight: 204 + } + } +} diff --git a/src/virtualkeyboard/content/layouts/pt_BR/numbers.fallback b/src/virtualkeyboard/content/layouts/pt_BR/numbers.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/pt_BR/numbers.fallback diff --git a/src/virtualkeyboard/content/layouts/pt_BR/symbols.fallback b/src/virtualkeyboard/content/layouts/pt_BR/symbols.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/pt_BR/symbols.fallback diff --git a/src/virtualkeyboard/content/layouts/pt_PT/dialpad.fallback b/src/virtualkeyboard/content/layouts/pt_PT/dialpad.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/pt_PT/dialpad.fallback diff --git a/src/virtualkeyboard/content/layouts/pt_PT/digits.fallback b/src/virtualkeyboard/content/layouts/pt_PT/digits.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/pt_PT/digits.fallback diff --git a/src/virtualkeyboard/content/layouts/pt_PT/handwriting.fallback b/src/virtualkeyboard/content/layouts/pt_PT/handwriting.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/pt_PT/handwriting.fallback diff --git a/src/virtualkeyboard/content/layouts/pt_PT/handwriting.qml b/src/virtualkeyboard/content/layouts/pt_PT/handwriting.qml deleted file mode 100644 index d42de535..00000000 --- a/src/virtualkeyboard/content/layouts/pt_PT/handwriting.qml +++ /dev/null @@ -1,97 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Virtual Keyboard module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 -import QtQuick.Layouts 1.0 -import QtQuick.VirtualKeyboard 2.3 - -KeyboardLayout { - function createInputMethod() { - return Qt.createQmlObject('import QtQuick 2.0; import QtQuick.VirtualKeyboard 2.3; HandwritingInputMethod {}', parent) - } - sharedLayouts: ['symbols'] - inputMode: InputEngine.Latin - - KeyboardRow { - Layout.preferredHeight: 3 - KeyboardColumn { - Layout.preferredWidth: bottomRow.width - hideKeyboardKey.width - KeyboardRow { - TraceInputKey { - objectName: "hwrInputArea" - patternRecognitionMode: InputEngine.HandwritingRecoginition - } - } - } - KeyboardColumn { - Layout.preferredWidth: hideKeyboardKey.width - KeyboardRow { - BackspaceKey {} - } - KeyboardRow { - EnterKey {} - } - KeyboardRow { - ShiftKey { } - } - } - } - KeyboardRow { - id: bottomRow - Layout.preferredHeight: 1 - keyWeight: 154 - InputModeKey { - weight: 217 - } - ChangeLanguageKey { - weight: 154 - customLayoutsOnly: true - } - HandwritingModeKey { - weight: 154 - } - SpaceKey { - weight: 864 - } - Key { - key: Qt.Key_Apostrophe - text: "'" - alternativeKeys: "<>()#%&*/\\\"'=+-_" - } - Key { - key: Qt.Key_Period - text: "." - alternativeKeys: ":;,.?!" - } - HideKeyboardKey { - id: hideKeyboardKey - weight: 204 - } - } -} diff --git a/src/virtualkeyboard/content/layouts/pt_PT/numbers.fallback b/src/virtualkeyboard/content/layouts/pt_PT/numbers.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/pt_PT/numbers.fallback diff --git a/src/virtualkeyboard/content/layouts/pt_PT/symbols.fallback b/src/virtualkeyboard/content/layouts/pt_PT/symbols.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/pt_PT/symbols.fallback diff --git a/src/virtualkeyboard/content/layouts/pt_PT/symbols.qml b/src/virtualkeyboard/content/layouts/pt_PT/symbols.qml deleted file mode 100644 index 06d815d8..00000000 --- a/src/virtualkeyboard/content/layouts/pt_PT/symbols.qml +++ /dev/null @@ -1,376 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Virtual Keyboard module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 -import QtQuick.Layouts 1.0 -import QtQuick.VirtualKeyboard 2.1 - -KeyboardLayoutLoader { - property bool secondPage - onVisibleChanged: if (!visible) secondPage = false - sourceComponent: secondPage ? page2 : page1 - Component { - id: page1 - KeyboardLayout { - keyWeight: 160 - KeyboardRow { - Key { - key: Qt.Key_1 - text: "1" - } - Key { - key: Qt.Key_2 - text: "2" - } - Key { - key: Qt.Key_3 - text: "3" - } - Key { - key: Qt.Key_4 - text: "4" - } - Key { - key: Qt.Key_5 - text: "5" - } - Key { - key: Qt.Key_6 - text: "6" - } - Key { - key: Qt.Key_7 - text: "7" - } - Key { - key: Qt.Key_8 - text: "8" - } - Key { - key: Qt.Key_9 - text: "9" - } - Key { - key: Qt.Key_0 - text: "0" - } - BackspaceKey {} - } - KeyboardRow { - FillerKey { - weight: 56 - } - Key { - key: Qt.Key_At - text: "@" - } - Key { - key: Qt.Key_NumberSign - text: "#" - } - Key { - key: Qt.Key_Percent - text: "%" - } - Key { - key: Qt.Key_Ampersand - text: "&" - } - Key { - key: Qt.Key_Asterisk - text: "*" - } - Key { - key: Qt.Key_Minus - text: "-" - } - Key { - key: Qt.Key_Plus - text: "+" - } - Key { - key: Qt.Key_ParenLeft - text: "(" - } - Key { - key: Qt.Key_ParenRight - text: ")" - } - EnterKey { - weight: 283 - } - } - KeyboardRow { - keyWeight: 156 - Key { - displayText: "1/2" - functionKey: true - onClicked: secondPage = !secondPage - } - Key { - key: Qt.Key_Exclam - text: "!" - } - Key { - key: Qt.Key_QuoteDbl - text: '"' - } - Key { - key: Qt.Key_Less - text: "<" - } - Key { - key: Qt.Key_Greater - text: ">" - } - Key { - key: Qt.Key_Apostrophe - text: "'" - } - Key { - key: Qt.Key_Colon - text: ":" - } - Key { - key: Qt.Key_Semicolon - text: ";" - } - Key { - key: Qt.Key_Slash - text: "/" - } - Key { - key: Qt.Key_Question - text: "?" - } - Key { - weight: 204 - displayText: "1/2" - functionKey: true - onClicked: secondPage = !secondPage - } - } - KeyboardRow { - keyWeight: 154 - SymbolModeKey { - weight: 217 - displayText: "ABC" - } - ChangeLanguageKey { - weight: 154 - } - SpaceKey { - weight: 864 - } - Key { - key: Qt.Key_Period - text: "." - alternativeKeys: ".," - } - Key { - key: 0xE000 - text: ":-)" - alternativeKeys: [ ";-)", ":-)", ":-D", ":-(", "<3" ] - } - HideKeyboardKey { - weight: 204 - } - } - } - } - Component { - id: page2 - KeyboardLayout { - keyWeight: 160 - KeyboardRow { - Key { - key: Qt.Key_AsciiTilde - text: "~" - } - Key { - key: Qt.Key_Agrave - text: "`" - } - Key { - key: Qt.Key_Bar - text: "|" - } - Key { - key: 0x7B - text: "·" - } - Key { - key: 0x221A - text: "√" - } - Key { - key: Qt.Key_division - text: "÷" - } - Key { - key: Qt.Key_multiply - text: "×" - } - Key { - key: Qt.Key_onehalf - text: "½" - alternativeKeys: "¼⅓½¾⅞" - } - Key { - key: Qt.Key_BraceLeft - text: "{" - } - Key { - key: Qt.Key_BraceRight - text: "}" - } - BackspaceKey {} - } - KeyboardRow { - FillerKey { - weight: 56 - } - Key { - key: Qt.Key_Dollar - text: "$" - } - Key { - key: 0x20AC - text: "€" - } - Key { - key: 0xC2 - text: "£" - } - Key { - key: 0xA2 - text: "¢" - } - Key { - key: 0xA5 - text: "¥" - } - Key { - key: Qt.Key_Equal - text: "=" - } - Key { - key: Qt.Key_section - text: "§" - } - Key { - key: Qt.Key_BracketLeft - text: "[" - } - Key { - key: Qt.Key_BracketRight - text: "]" - } - EnterKey { - weight: 283 - } - } - KeyboardRow { - keyWeight: 156 - Key { - displayText: "2/2" - functionKey: true - onClicked: secondPage = !secondPage - } - Key { - key: Qt.Key_Underscore - text: "_" - } - Key { - key: 0x2122 - text: '™' - } - Key { - key: 0x00AE - text: '®' - } - Key { - key: Qt.Key_guillemotleft - text: '«' - } - Key { - key: Qt.Key_guillemotright - text: '»' - } - Key { - key: 0x201C - text: '“' - } - Key { - key: 0x201D - text: '”' - } - Key { - key: Qt.Key_Backslash - text: "\\" - } - Key { - key: Qt.Key_AsciiCircum - text: "^" - } - Key { - weight: 204 - displayText: "2/2" - functionKey: true - onClicked: secondPage = !secondPage - } - } - KeyboardRow { - keyWeight: 154 - SymbolModeKey { - weight: 217 - displayText: "ABC" - } - ChangeLanguageKey { - weight: 154 - } - SpaceKey { - weight: 864 - } - Key { - key: 0x2026 - text: "\u2026" - } - Key { - key: 0xE000 - text: ":-)" - alternativeKeys: [ ";-)", ":-)", ":-D", ":-(", "<3" ] - } - HideKeyboardKey { - weight: 204 - } - } - } - } -} diff --git a/src/virtualkeyboard/content/layouts/ro_RO/dialpad.fallback b/src/virtualkeyboard/content/layouts/ro_RO/dialpad.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/ro_RO/dialpad.fallback diff --git a/src/virtualkeyboard/content/layouts/ro_RO/digits.fallback b/src/virtualkeyboard/content/layouts/ro_RO/digits.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/ro_RO/digits.fallback diff --git a/src/virtualkeyboard/content/layouts/ro_RO/numbers.fallback b/src/virtualkeyboard/content/layouts/ro_RO/numbers.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/ro_RO/numbers.fallback diff --git a/src/virtualkeyboard/content/layouts/ro_RO/symbols.fallback b/src/virtualkeyboard/content/layouts/ro_RO/symbols.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/ro_RO/symbols.fallback diff --git a/src/virtualkeyboard/content/layouts/ro_RO/symbols.qml b/src/virtualkeyboard/content/layouts/ro_RO/symbols.qml deleted file mode 100644 index 0196a478..00000000 --- a/src/virtualkeyboard/content/layouts/ro_RO/symbols.qml +++ /dev/null @@ -1,376 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Virtual Keyboard module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 -import QtQuick.Layouts 1.0 -import QtQuick.VirtualKeyboard 2.1 - -KeyboardLayoutLoader { - property bool secondPage - onVisibleChanged: if (!visible) secondPage = false - sourceComponent: secondPage ? page2 : page1 - Component { - id: page1 - KeyboardLayout { - keyWeight: 160 - KeyboardRow { - Key { - key: Qt.Key_1 - text: "1" - } - Key { - key: Qt.Key_2 - text: "2" - } - Key { - key: Qt.Key_3 - text: "3" - } - Key { - key: Qt.Key_4 - text: "4" - } - Key { - key: Qt.Key_5 - text: "5" - } - Key { - key: Qt.Key_6 - text: "6" - } - Key { - key: Qt.Key_7 - text: "7" - } - Key { - key: Qt.Key_8 - text: "8" - } - Key { - key: Qt.Key_9 - text: "9" - } - Key { - key: Qt.Key_0 - text: "0" - } - BackspaceKey {} - } - KeyboardRow { - FillerKey { - weight: 56 - } - Key { - key: Qt.Key_At - text: "@" - } - Key { - key: Qt.Key_NumberSign - text: "#" - } - Key { - key: Qt.Key_Percent - text: "%" - } - Key { - key: Qt.Key_Ampersand - text: "&" - } - Key { - key: Qt.Key_Asterisk - text: "*" - } - Key { - key: Qt.Key_Minus - text: "-" - } - Key { - key: Qt.Key_Plus - text: "+" - } - Key { - key: Qt.Key_ParenLeft - text: "(" - } - Key { - key: Qt.Key_ParenRight - text: ")" - } - EnterKey { - weight: 283 - } - } - KeyboardRow { - keyWeight: 156 - Key { - displayText: "1/2" - functionKey: true - onClicked: secondPage = !secondPage - } - Key { - key: Qt.Key_Exclam - text: "!" - } - Key { - key: Qt.Key_QuoteDbl - text: '"' - } - Key { - key: Qt.Key_Apostrophe - text: "'" - } - Key { - key: Qt.Key_Less - text: "<" - } - Key { - key: Qt.Key_Greater - text: ">" - } - Key { - key: Qt.Key_Colon - text: ":" - } - Key { - key: Qt.Key_Semicolon - text: ";" - } - Key { - key: Qt.Key_Slash - text: "/" - } - Key { - key: Qt.Key_Question - text: "?" - } - Key { - weight: 204 - displayText: "1/2" - functionKey: true - onClicked: secondPage = !secondPage - } - } - KeyboardRow { - keyWeight: 154 - SymbolModeKey { - weight: 217 - displayText: "ABC" - } - ChangeLanguageKey { - weight: 154 - } - SpaceKey { - weight: 864 - } - Key { - key: Qt.Key_Period - text: "." - alternativeKeys: ".," - } - Key { - key: 0xE000 - text: ":-)" - alternativeKeys: [ ";-)", ":-)", ":-D", ":-(", "<3" ] - } - HideKeyboardKey { - weight: 204 - } - } - } - } - Component { - id: page2 - KeyboardLayout { - keyWeight: 160 - KeyboardRow { - Key { - key: Qt.Key_AsciiTilde - text: "~" - } - Key { - key: Qt.Key_Agrave - text: "`" - } - Key { - key: Qt.Key_Bar - text: "|" - } - Key { - key: 0x7B - text: "·" - } - Key { - key: 0x221A - text: "√" - } - Key { - key: Qt.Key_division - text: "÷" - } - Key { - key: Qt.Key_multiply - text: "×" - } - Key { - key: Qt.Key_onehalf - text: "½" - alternativeKeys: "¼⅓½¾⅞" - } - Key { - key: Qt.Key_BraceLeft - text: "{" - } - Key { - key: Qt.Key_BraceRight - text: "}" - } - BackspaceKey {} - } - KeyboardRow { - FillerKey { - weight: 56 - } - Key { - key: Qt.Key_Dollar - text: "$" - } - Key { - key: 0x20AC - text: "€" - } - Key { - key: 0xC2 - text: "£" - } - Key { - key: 0xA2 - text: "¢" - } - Key { - key: 0xA5 - text: "¥" - } - Key { - key: Qt.Key_Equal - text: "=" - } - Key { - key: Qt.Key_section - text: "§" - } - Key { - key: Qt.Key_BracketLeft - text: "[" - } - Key { - key: Qt.Key_BracketRight - text: "]" - } - EnterKey { - weight: 283 - } - } - KeyboardRow { - keyWeight: 156 - Key { - displayText: "2/2" - functionKey: true - onClicked: secondPage = !secondPage - } - Key { - key: Qt.Key_Underscore - text: "_" - } - Key { - key: 0x2122 - text: '™' - } - Key { - key: 0x00AE - text: '®' - } - Key { - key: Qt.Key_guillemotleft - text: '«' - } - Key { - key: Qt.Key_guillemotright - text: '»' - } - Key { - key: 0x201C - text: '“' - } - Key { - key: 0x201D - text: '”' - } - Key { - key: Qt.Key_Backslash - text: "\\" - } - Key { - key: Qt.Key_AsciiCircum - text: "^" - } - Key { - weight: 204 - displayText: "2/2" - functionKey: true - onClicked: secondPage = !secondPage - } - } - KeyboardRow { - keyWeight: 154 - SymbolModeKey { - weight: 217 - displayText: "ABC" - } - ChangeLanguageKey { - weight: 154 - } - SpaceKey { - weight: 864 - } - Key { - key: 0x2026 - text: "\u2026" - } - Key { - key: 0xE000 - text: ":-)" - alternativeKeys: [ ";-)", ":-)", ":-D", ":-(", "<3" ] - } - HideKeyboardKey { - weight: 204 - } - } - } - } -} diff --git a/src/virtualkeyboard/content/layouts/ru_RU/dialpad.fallback b/src/virtualkeyboard/content/layouts/ru_RU/dialpad.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/ru_RU/dialpad.fallback diff --git a/src/virtualkeyboard/content/layouts/ru_RU/digits.fallback b/src/virtualkeyboard/content/layouts/ru_RU/digits.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/ru_RU/digits.fallback diff --git a/src/virtualkeyboard/content/layouts/ru_RU/handwriting.fallback b/src/virtualkeyboard/content/layouts/ru_RU/handwriting.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/ru_RU/handwriting.fallback diff --git a/src/virtualkeyboard/content/layouts/ru_RU/handwriting.qml b/src/virtualkeyboard/content/layouts/ru_RU/handwriting.qml deleted file mode 100644 index d42de535..00000000 --- a/src/virtualkeyboard/content/layouts/ru_RU/handwriting.qml +++ /dev/null @@ -1,97 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Virtual Keyboard module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 -import QtQuick.Layouts 1.0 -import QtQuick.VirtualKeyboard 2.3 - -KeyboardLayout { - function createInputMethod() { - return Qt.createQmlObject('import QtQuick 2.0; import QtQuick.VirtualKeyboard 2.3; HandwritingInputMethod {}', parent) - } - sharedLayouts: ['symbols'] - inputMode: InputEngine.Latin - - KeyboardRow { - Layout.preferredHeight: 3 - KeyboardColumn { - Layout.preferredWidth: bottomRow.width - hideKeyboardKey.width - KeyboardRow { - TraceInputKey { - objectName: "hwrInputArea" - patternRecognitionMode: InputEngine.HandwritingRecoginition - } - } - } - KeyboardColumn { - Layout.preferredWidth: hideKeyboardKey.width - KeyboardRow { - BackspaceKey {} - } - KeyboardRow { - EnterKey {} - } - KeyboardRow { - ShiftKey { } - } - } - } - KeyboardRow { - id: bottomRow - Layout.preferredHeight: 1 - keyWeight: 154 - InputModeKey { - weight: 217 - } - ChangeLanguageKey { - weight: 154 - customLayoutsOnly: true - } - HandwritingModeKey { - weight: 154 - } - SpaceKey { - weight: 864 - } - Key { - key: Qt.Key_Apostrophe - text: "'" - alternativeKeys: "<>()#%&*/\\\"'=+-_" - } - Key { - key: Qt.Key_Period - text: "." - alternativeKeys: ":;,.?!" - } - HideKeyboardKey { - id: hideKeyboardKey - weight: 204 - } - } -} diff --git a/src/virtualkeyboard/content/layouts/ru_RU/numbers.fallback b/src/virtualkeyboard/content/layouts/ru_RU/numbers.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/ru_RU/numbers.fallback diff --git a/src/virtualkeyboard/content/layouts/ru_RU/symbols.fallback b/src/virtualkeyboard/content/layouts/ru_RU/symbols.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/ru_RU/symbols.fallback diff --git a/src/virtualkeyboard/content/layouts/ru_RU/symbols.qml b/src/virtualkeyboard/content/layouts/ru_RU/symbols.qml deleted file mode 100644 index 43b4d088..00000000 --- a/src/virtualkeyboard/content/layouts/ru_RU/symbols.qml +++ /dev/null @@ -1,376 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Virtual Keyboard module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 -import QtQuick.Layouts 1.0 -import QtQuick.VirtualKeyboard 2.1 - -KeyboardLayoutLoader { - property bool secondPage - onVisibleChanged: if (!visible) secondPage = false - sourceComponent: secondPage ? page2 : page1 - Component { - id: page1 - KeyboardLayout { - keyWeight: 160 - KeyboardRow { - Key { - key: Qt.Key_1 - text: "1" - } - Key { - key: Qt.Key_2 - text: "2" - } - Key { - key: Qt.Key_3 - text: "3" - } - Key { - key: Qt.Key_4 - text: "4" - } - Key { - key: Qt.Key_5 - text: "5" - } - Key { - key: Qt.Key_6 - text: "6" - } - Key { - key: Qt.Key_7 - text: "7" - } - Key { - key: Qt.Key_8 - text: "8" - } - Key { - key: Qt.Key_9 - text: "9" - } - Key { - key: Qt.Key_0 - text: "0" - } - BackspaceKey {} - } - KeyboardRow { - FillerKey { - weight: 56 - } - Key { - key: Qt.Key_At - text: "@" - } - Key { - key: Qt.Key_NumberSign - text: "#" - } - Key { - key: Qt.Key_Percent - text: "%" - } - Key { - key: Qt.Key_Ampersand - text: "&" - } - Key { - key: Qt.Key_Asterisk - text: "*" - } - Key { - key: Qt.Key_Minus - text: "-" - } - Key { - key: Qt.Key_Plus - text: "+" - } - Key { - key: Qt.Key_ParenLeft - text: "(" - } - Key { - key: Qt.Key_ParenRight - text: ")" - } - EnterKey { - weight: 283 - } - } - KeyboardRow { - keyWeight: 156 - Key { - displayText: "1/2" - functionKey: true - onClicked: secondPage = !secondPage - } - Key { - key: Qt.Key_Exclam - text: "!" - } - Key { - key: Qt.Key_QuoteDbl - text: '"' - } - Key { - key: Qt.Key_Less - text: "<" - } - Key { - key: Qt.Key_Greater - text: ">" - } - Key { - key: Qt.Key_Apostrophe - text: "'" - } - Key { - key: Qt.Key_Colon - text: ":" - } - Key { - key: Qt.Key_Semicolon - text: ";" - } - Key { - key: Qt.Key_Slash - text: "/" - } - Key { - key: Qt.Key_Question - text: "?" - } - Key { - weight: 204 - displayText: "1/2" - functionKey: true - onClicked: secondPage = !secondPage - } - } - KeyboardRow { - keyWeight: 154 - SymbolModeKey { - weight: 217 - displayText: "АБВ" - } - ChangeLanguageKey { - weight: 154 - } - SpaceKey { - weight: 864 - } - Key { - key: Qt.Key_Period - text: "." - alternativeKeys: ".," - } - Key { - key: 0xE000 - text: ":-)" - alternativeKeys: [ ";-)", ":-)", ":-D", ":-(", "<3" ] - } - HideKeyboardKey { - weight: 204 - } - } - } - } - Component { - id: page2 - KeyboardLayout { - keyWeight: 160 - KeyboardRow { - Key { - key: Qt.Key_AsciiTilde - text: "~" - } - Key { - key: Qt.Key_Agrave - text: "`" - } - Key { - key: Qt.Key_Bar - text: "|" - } - Key { - key: 0x7B - text: "·" - } - Key { - key: 0x221A - text: "√" - } - Key { - key: Qt.Key_division - text: "÷" - } - Key { - key: Qt.Key_multiply - text: "×" - } - Key { - key: Qt.Key_onehalf - text: "½" - alternativeKeys: "¼⅓½¾⅞" - } - Key { - key: Qt.Key_BraceLeft - text: "{" - } - Key { - key: Qt.Key_BraceRight - text: "}" - } - BackspaceKey {} - } - KeyboardRow { - FillerKey { - weight: 56 - } - Key { - key: Qt.Key_Dollar - text: "$" - } - Key { - key: 0x20AC - text: "€" - } - Key { - key: 0xC2 - text: "£" - } - Key { - key: 0xA2 - text: "¢" - } - Key { - key: 0xA5 - text: "¥" - } - Key { - key: Qt.Key_Equal - text: "=" - } - Key { - key: Qt.Key_section - text: "§" - } - Key { - key: Qt.Key_BracketLeft - text: "[" - } - Key { - key: Qt.Key_BracketRight - text: "]" - } - EnterKey { - weight: 283 - } - } - KeyboardRow { - keyWeight: 156 - Key { - displayText: "2/2" - functionKey: true - onClicked: secondPage = !secondPage - } - Key { - key: Qt.Key_Underscore - text: "_" - } - Key { - key: 0x2122 - text: '™' - } - Key { - key: 0x00AE - text: '®' - } - Key { - key: Qt.Key_guillemotleft - text: '«' - } - Key { - key: Qt.Key_guillemotright - text: '»' - } - Key { - key: 0x201C - text: '“' - } - Key { - key: 0x201D - text: '”' - } - Key { - key: Qt.Key_Backslash - text: "\\" - } - Key { - key: Qt.Key_AsciiCircum - text: "^" - } - Key { - weight: 204 - displayText: "2/2" - functionKey: true - onClicked: secondPage = !secondPage - } - } - KeyboardRow { - keyWeight: 154 - SymbolModeKey { - weight: 217 - displayText: "АБВ" - } - ChangeLanguageKey { - weight: 154 - } - SpaceKey { - weight: 864 - } - Key { - key: 0x2026 - text: "\u2026" - } - Key { - key: 0xE000 - text: ":-)" - alternativeKeys: [ ";-)", ":-)", ":-D", ":-(", "<3" ] - } - HideKeyboardKey { - weight: 204 - } - } - } - } -} diff --git a/src/virtualkeyboard/content/layouts/sk_SK/dialpad.fallback b/src/virtualkeyboard/content/layouts/sk_SK/dialpad.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/sk_SK/dialpad.fallback diff --git a/src/virtualkeyboard/content/layouts/sk_SK/digits.fallback b/src/virtualkeyboard/content/layouts/sk_SK/digits.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/sk_SK/digits.fallback diff --git a/src/virtualkeyboard/content/layouts/sk_SK/handwriting.fallback b/src/virtualkeyboard/content/layouts/sk_SK/handwriting.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/sk_SK/handwriting.fallback diff --git a/src/virtualkeyboard/content/layouts/sk_SK/main.qml b/src/virtualkeyboard/content/layouts/sk_SK/main.qml new file mode 100644 index 00000000..53a908a2 --- /dev/null +++ b/src/virtualkeyboard/content/layouts/sk_SK/main.qml @@ -0,0 +1,208 @@ +/**************************************************************************** +** +** Copyright (C) 2018 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Qt Virtual Keyboard module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:GPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 or (at your option) any later version +** approved by the KDE Free Qt Foundation. The licenses are as published by +** the Free Software Foundation and appearing in the file LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.0 +import QtQuick.VirtualKeyboard 2.3 + +KeyboardLayout { + inputMode: InputEngine.Latin + keyWeight: 160 + KeyboardRow { + Key { + key: Qt.Key_Q + text: "q" + } + Key { + key: Qt.Key_W + text: "w" + } + Key { + key: Qt.Key_E + text: "e" + alternativeKeys: "eé" + } + Key { + key: Qt.Key_R + text: "r" + alternativeKeys: "rŕ" + } + Key { + key: Qt.Key_T + text: "t" + alternativeKeys: "tť" + } + Key { + key: Qt.Key_Z + text: "z" + alternativeKeys: "zž" + } + Key { + key: Qt.Key_U + text: "u" + alternativeKeys: "uú" + } + Key { + key: Qt.Key_I + text: "i" + alternativeKeys: "ií" + } + Key { + key: Qt.Key_O + text: "o" + alternativeKeys: "oóöô" + } + Key { + key: Qt.Key_P + text: "p" + } + BackspaceKey {} + } + KeyboardRow { + FillerKey { + weight: 56 + } + Key { + key: Qt.Key_A + text: "a" + alternativeKeys: "aåäá" + } + Key { + key: Qt.Key_S + text: "s" + alternativeKeys: "sš" + } + Key { + key: Qt.Key_D + text: "d" + alternativeKeys: "dď" + } + Key { + key: Qt.Key_F + text: "f" + } + Key { + key: Qt.Key_G + text: "g" + } + Key { + key: Qt.Key_H + text: "h" + } + Key { + key: Qt.Key_J + text: "j" + } + Key { + key: Qt.Key_K + text: "k" + } + Key { + key: Qt.Key_L + text: "l" + alternativeKeys: "lĺľ" + } + EnterKey { + weight: 283 + } + } + KeyboardRow { + keyWeight: 156 + ShiftKey {} + Key { + key: Qt.Key_Y + text: "y" + alternativeKeys: "yý" + } + Key { + key: Qt.Key_X + text: "x" + } + Key { + key: Qt.Key_C + text: "c" + alternativeKeys: "cč" + } + Key { + key: Qt.Key_V + text: "v" + } + Key { + key: Qt.Key_B + text: "b" + } + Key { + key: Qt.Key_N + text: "n" + alternativeKeys: "nň" + } + Key { + key: Qt.Key_M + text: "m" + } + Key { + key: Qt.Key_Comma + text: "," + } + Key { + key: Qt.Key_Period + text: "." + } + ShiftKey { + weight: 204 + } + } + KeyboardRow { + keyWeight: 154 + SymbolModeKey { + weight: 217 + } + ChangeLanguageKey { + weight: 154 + } + HandwritingModeKey { + weight: 154 + } + SpaceKey { + weight: 864 + } + Key { + key: Qt.Key_Minus + text: "-" + alternativeKeys: "-\"'" + } + Key { + key: 0xE000 + text: ":-)" + alternativeKeys: [ ";-)", ":-)", ":-D", ":-(", "<3" ] + } + HideKeyboardKey { + weight: 204 + } + } +} diff --git a/src/virtualkeyboard/content/layouts/sk_SK/numbers.fallback b/src/virtualkeyboard/content/layouts/sk_SK/numbers.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/sk_SK/numbers.fallback diff --git a/src/virtualkeyboard/content/layouts/sk_SK/symbols.fallback b/src/virtualkeyboard/content/layouts/sk_SK/symbols.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/sk_SK/symbols.fallback diff --git a/src/virtualkeyboard/content/layouts/sl_SI/dialpad.fallback b/src/virtualkeyboard/content/layouts/sl_SI/dialpad.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/sl_SI/dialpad.fallback diff --git a/src/virtualkeyboard/content/layouts/sl_SI/digits.fallback b/src/virtualkeyboard/content/layouts/sl_SI/digits.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/sl_SI/digits.fallback diff --git a/src/virtualkeyboard/content/layouts/sl_SI/handwriting.fallback b/src/virtualkeyboard/content/layouts/sl_SI/handwriting.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/sl_SI/handwriting.fallback diff --git a/src/virtualkeyboard/content/layouts/sl_SI/main.qml b/src/virtualkeyboard/content/layouts/sl_SI/main.qml new file mode 100644 index 00000000..c6abf6d1 --- /dev/null +++ b/src/virtualkeyboard/content/layouts/sl_SI/main.qml @@ -0,0 +1,203 @@ +/**************************************************************************** +** +** Copyright (C) 2018 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Qt Virtual Keyboard module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:GPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 or (at your option) any later version +** approved by the KDE Free Qt Foundation. The licenses are as published by +** the Free Software Foundation and appearing in the file LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.0 +import QtQuick.VirtualKeyboard 2.3 + +KeyboardLayout { + inputMode: InputEngine.Latin + keyWeight: 160 + KeyboardRow { + Key { + key: Qt.Key_Q + text: "q" + } + Key { + key: Qt.Key_W + text: "w" + } + Key { + key: Qt.Key_E + text: "e" + alternativeKeys: "eèêëé" + } + Key { + key: Qt.Key_R + text: "r" + } + Key { + key: Qt.Key_T + text: "t" + } + Key { + key: Qt.Key_Z + text: "z" + alternativeKeys: "zž" + } + Key { + key: Qt.Key_U + text: "u" + alternativeKeys: "uúü" + } + Key { + key: Qt.Key_I + text: "i" + alternativeKeys: "ií" + } + Key { + key: Qt.Key_O + text: "o" + alternativeKeys: "òôöoó" + } + Key { + key: Qt.Key_P + text: "p" + } + BackspaceKey {} + } + KeyboardRow { + FillerKey { + weight: 56 + } + Key { + key: Qt.Key_A + text: "a" + alternativeKeys: "aåäáà" + } + Key { + key: Qt.Key_S + text: "s" + alternativeKeys: "sš" + } + Key { + key: Qt.Key_D + text: "d" + alternativeKeys: "dđ" + } + Key { + key: Qt.Key_F + text: "f" + } + Key { + key: Qt.Key_G + text: "g" + } + Key { + key: Qt.Key_H + text: "h" + } + Key { + key: Qt.Key_J + text: "j" + } + Key { + key: Qt.Key_K + text: "k" + } + Key { + key: Qt.Key_L + text: "l" + } + EnterKey { + weight: 283 + } + } + KeyboardRow { + keyWeight: 156 + ShiftKey {} + Key { + key: Qt.Key_Y + text: "y" + } + Key { + key: Qt.Key_X + text: "x" + } + Key { + key: Qt.Key_C + text: "c" + alternativeKeys: "cćč" + } + Key { + key: Qt.Key_V + text: "v" + } + Key { + key: Qt.Key_B + text: "b" + } + Key { + key: Qt.Key_N + text: "n" + } + Key { + key: Qt.Key_M + text: "m" + } + Key { + key: Qt.Key_Comma + text: "," + } + Key { + key: Qt.Key_Period + text: "." + } + ShiftKey { + weight: 204 + } + } + KeyboardRow { + keyWeight: 154 + SymbolModeKey { + weight: 217 + } + ChangeLanguageKey { + weight: 154 + } + HandwritingModeKey { + weight: 154 + } + SpaceKey { + weight: 864 + } + Key { + key: Qt.Key_Minus + text: "-" + alternativeKeys: "-\"'" + } + Key { + key: 0xE000 + text: ":-)" + alternativeKeys: [ ";-)", ":-)", ":-D", ":-(", "<3" ] + } + HideKeyboardKey { + weight: 204 + } + } +} diff --git a/src/virtualkeyboard/content/layouts/sl_SI/numbers.fallback b/src/virtualkeyboard/content/layouts/sl_SI/numbers.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/sl_SI/numbers.fallback diff --git a/src/virtualkeyboard/content/layouts/sl_SI/symbols.fallback b/src/virtualkeyboard/content/layouts/sl_SI/symbols.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/sl_SI/symbols.fallback diff --git a/src/virtualkeyboard/content/layouts/sq_AL/dialpad.fallback b/src/virtualkeyboard/content/layouts/sq_AL/dialpad.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/sq_AL/dialpad.fallback diff --git a/src/virtualkeyboard/content/layouts/sq_AL/digits.fallback b/src/virtualkeyboard/content/layouts/sq_AL/digits.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/sq_AL/digits.fallback diff --git a/src/virtualkeyboard/content/layouts/sq_AL/handwriting.fallback b/src/virtualkeyboard/content/layouts/sq_AL/handwriting.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/sq_AL/handwriting.fallback diff --git a/src/virtualkeyboard/content/layouts/sq_AL/main.qml b/src/virtualkeyboard/content/layouts/sq_AL/main.qml new file mode 100644 index 00000000..b1474285 --- /dev/null +++ b/src/virtualkeyboard/content/layouts/sq_AL/main.qml @@ -0,0 +1,205 @@ +/**************************************************************************** +** +** Copyright (C) 2018 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Qt Virtual Keyboard module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:GPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 or (at your option) any later version +** approved by the KDE Free Qt Foundation. The licenses are as published by +** the Free Software Foundation and appearing in the file LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.0 +import QtQuick.VirtualKeyboard 2.3 + +KeyboardLayout { + inputMode: InputEngine.Latin + keyWeight: 160 + KeyboardRow { + Key { + key: Qt.Key_Q + text: "q" + } + Key { + key: Qt.Key_W + text: "w" + } + Key { + key: Qt.Key_E + text: "e" + } + Key { + key: Qt.Key_R + text: "r" + } + Key { + key: Qt.Key_T + text: "t" + } + Key { + key: Qt.Key_Z + text: "z" + } + Key { + key: Qt.Key_U + text: "u" + } + Key { + key: Qt.Key_I + text: "i" + } + Key { + key: Qt.Key_O + text: "o" + } + Key { + key: Qt.Key_P + text: "p" + } + Key { + key: Qt.Key_Ccedilla + text: "ç" + } + BackspaceKey {} + } + KeyboardRow { + FillerKey { + weight: 56 + } + Key { + key: Qt.Key_A + text: "a" + } + Key { + key: Qt.Key_S + text: "s" + } + Key { + key: Qt.Key_D + text: "d" + } + Key { + key: Qt.Key_F + text: "f" + } + Key { + key: Qt.Key_G + text: "g" + } + Key { + key: Qt.Key_H + text: "h" + } + Key { + key: Qt.Key_J + text: "j" + } + Key { + key: Qt.Key_K + text: "k" + } + Key { + key: Qt.Key_L + text: "l" + } + Key { + key: Qt.Key_Ediaeresis + text: "ë" + } + EnterKey { + weight: 283 + } + } + KeyboardRow { + keyWeight: 156 + ShiftKey {} + Key { + key: Qt.Key_Y + text: "y" + } + Key { + key: Qt.Key_X + text: "x" + } + Key { + key: Qt.Key_C + text: "c" + } + Key { + key: Qt.Key_V + text: "v" + } + Key { + key: Qt.Key_B + text: "b" + } + Key { + key: Qt.Key_N + text: "n" + } + Key { + key: Qt.Key_M + text: "m" + } + Key { + key: Qt.Key_Comma + text: "," + } + Key { + key: Qt.Key_Period + text: "." + } + Key { + key: Qt.Key_Minus + text: "-" + } + ShiftKey { + weight: 244 + } + } + KeyboardRow { + keyWeight: 154 + SymbolModeKey { + weight: 217 + } + ChangeLanguageKey { + weight: 154 + } + HandwritingModeKey { + weight: 154 + } + SpaceKey { + weight: 864 + } + Key { + key: Qt.Key_Apostrophe + text: "'" + } + Key { + key: 0xE000 + text: ":-)" + alternativeKeys: [ ";-)", ":-)", ":-D", ":-(", "<3" ] + } + HideKeyboardKey { + weight: 204 + } + } +} diff --git a/src/virtualkeyboard/content/layouts/sq_AL/numbers.fallback b/src/virtualkeyboard/content/layouts/sq_AL/numbers.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/sq_AL/numbers.fallback diff --git a/src/virtualkeyboard/content/layouts/sq_AL/symbols.fallback b/src/virtualkeyboard/content/layouts/sq_AL/symbols.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/sq_AL/symbols.fallback diff --git a/src/virtualkeyboard/content/layouts/sr_SP/dialpad.fallback b/src/virtualkeyboard/content/layouts/sr_SP/dialpad.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/sr_SP/dialpad.fallback diff --git a/src/virtualkeyboard/content/layouts/sr_SP/digits.fallback b/src/virtualkeyboard/content/layouts/sr_SP/digits.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/sr_SP/digits.fallback diff --git a/src/virtualkeyboard/content/layouts/sr_SP/numbers.fallback b/src/virtualkeyboard/content/layouts/sr_SP/numbers.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/sr_SP/numbers.fallback diff --git a/src/virtualkeyboard/content/layouts/sr_SP/symbols.fallback b/src/virtualkeyboard/content/layouts/sr_SP/symbols.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/sr_SP/symbols.fallback diff --git a/src/virtualkeyboard/content/layouts/sv_SE/dialpad.fallback b/src/virtualkeyboard/content/layouts/sv_SE/dialpad.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/sv_SE/dialpad.fallback diff --git a/src/virtualkeyboard/content/layouts/sv_SE/digits.fallback b/src/virtualkeyboard/content/layouts/sv_SE/digits.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/sv_SE/digits.fallback diff --git a/src/virtualkeyboard/content/layouts/sv_SE/handwriting.fallback b/src/virtualkeyboard/content/layouts/sv_SE/handwriting.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/sv_SE/handwriting.fallback diff --git a/src/virtualkeyboard/content/layouts/sv_SE/handwriting.qml b/src/virtualkeyboard/content/layouts/sv_SE/handwriting.qml deleted file mode 100644 index d42de535..00000000 --- a/src/virtualkeyboard/content/layouts/sv_SE/handwriting.qml +++ /dev/null @@ -1,97 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Virtual Keyboard module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 -import QtQuick.Layouts 1.0 -import QtQuick.VirtualKeyboard 2.3 - -KeyboardLayout { - function createInputMethod() { - return Qt.createQmlObject('import QtQuick 2.0; import QtQuick.VirtualKeyboard 2.3; HandwritingInputMethod {}', parent) - } - sharedLayouts: ['symbols'] - inputMode: InputEngine.Latin - - KeyboardRow { - Layout.preferredHeight: 3 - KeyboardColumn { - Layout.preferredWidth: bottomRow.width - hideKeyboardKey.width - KeyboardRow { - TraceInputKey { - objectName: "hwrInputArea" - patternRecognitionMode: InputEngine.HandwritingRecoginition - } - } - } - KeyboardColumn { - Layout.preferredWidth: hideKeyboardKey.width - KeyboardRow { - BackspaceKey {} - } - KeyboardRow { - EnterKey {} - } - KeyboardRow { - ShiftKey { } - } - } - } - KeyboardRow { - id: bottomRow - Layout.preferredHeight: 1 - keyWeight: 154 - InputModeKey { - weight: 217 - } - ChangeLanguageKey { - weight: 154 - customLayoutsOnly: true - } - HandwritingModeKey { - weight: 154 - } - SpaceKey { - weight: 864 - } - Key { - key: Qt.Key_Apostrophe - text: "'" - alternativeKeys: "<>()#%&*/\\\"'=+-_" - } - Key { - key: Qt.Key_Period - text: "." - alternativeKeys: ":;,.?!" - } - HideKeyboardKey { - id: hideKeyboardKey - weight: 204 - } - } -} diff --git a/src/virtualkeyboard/content/layouts/sv_SE/numbers.fallback b/src/virtualkeyboard/content/layouts/sv_SE/numbers.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/sv_SE/numbers.fallback diff --git a/src/virtualkeyboard/content/layouts/sv_SE/symbols.fallback b/src/virtualkeyboard/content/layouts/sv_SE/symbols.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/sv_SE/symbols.fallback diff --git a/src/virtualkeyboard/content/layouts/sv_SE/symbols.qml b/src/virtualkeyboard/content/layouts/sv_SE/symbols.qml deleted file mode 100644 index 06d815d8..00000000 --- a/src/virtualkeyboard/content/layouts/sv_SE/symbols.qml +++ /dev/null @@ -1,376 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Virtual Keyboard module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 -import QtQuick.Layouts 1.0 -import QtQuick.VirtualKeyboard 2.1 - -KeyboardLayoutLoader { - property bool secondPage - onVisibleChanged: if (!visible) secondPage = false - sourceComponent: secondPage ? page2 : page1 - Component { - id: page1 - KeyboardLayout { - keyWeight: 160 - KeyboardRow { - Key { - key: Qt.Key_1 - text: "1" - } - Key { - key: Qt.Key_2 - text: "2" - } - Key { - key: Qt.Key_3 - text: "3" - } - Key { - key: Qt.Key_4 - text: "4" - } - Key { - key: Qt.Key_5 - text: "5" - } - Key { - key: Qt.Key_6 - text: "6" - } - Key { - key: Qt.Key_7 - text: "7" - } - Key { - key: Qt.Key_8 - text: "8" - } - Key { - key: Qt.Key_9 - text: "9" - } - Key { - key: Qt.Key_0 - text: "0" - } - BackspaceKey {} - } - KeyboardRow { - FillerKey { - weight: 56 - } - Key { - key: Qt.Key_At - text: "@" - } - Key { - key: Qt.Key_NumberSign - text: "#" - } - Key { - key: Qt.Key_Percent - text: "%" - } - Key { - key: Qt.Key_Ampersand - text: "&" - } - Key { - key: Qt.Key_Asterisk - text: "*" - } - Key { - key: Qt.Key_Minus - text: "-" - } - Key { - key: Qt.Key_Plus - text: "+" - } - Key { - key: Qt.Key_ParenLeft - text: "(" - } - Key { - key: Qt.Key_ParenRight - text: ")" - } - EnterKey { - weight: 283 - } - } - KeyboardRow { - keyWeight: 156 - Key { - displayText: "1/2" - functionKey: true - onClicked: secondPage = !secondPage - } - Key { - key: Qt.Key_Exclam - text: "!" - } - Key { - key: Qt.Key_QuoteDbl - text: '"' - } - Key { - key: Qt.Key_Less - text: "<" - } - Key { - key: Qt.Key_Greater - text: ">" - } - Key { - key: Qt.Key_Apostrophe - text: "'" - } - Key { - key: Qt.Key_Colon - text: ":" - } - Key { - key: Qt.Key_Semicolon - text: ";" - } - Key { - key: Qt.Key_Slash - text: "/" - } - Key { - key: Qt.Key_Question - text: "?" - } - Key { - weight: 204 - displayText: "1/2" - functionKey: true - onClicked: secondPage = !secondPage - } - } - KeyboardRow { - keyWeight: 154 - SymbolModeKey { - weight: 217 - displayText: "ABC" - } - ChangeLanguageKey { - weight: 154 - } - SpaceKey { - weight: 864 - } - Key { - key: Qt.Key_Period - text: "." - alternativeKeys: ".," - } - Key { - key: 0xE000 - text: ":-)" - alternativeKeys: [ ";-)", ":-)", ":-D", ":-(", "<3" ] - } - HideKeyboardKey { - weight: 204 - } - } - } - } - Component { - id: page2 - KeyboardLayout { - keyWeight: 160 - KeyboardRow { - Key { - key: Qt.Key_AsciiTilde - text: "~" - } - Key { - key: Qt.Key_Agrave - text: "`" - } - Key { - key: Qt.Key_Bar - text: "|" - } - Key { - key: 0x7B - text: "·" - } - Key { - key: 0x221A - text: "√" - } - Key { - key: Qt.Key_division - text: "÷" - } - Key { - key: Qt.Key_multiply - text: "×" - } - Key { - key: Qt.Key_onehalf - text: "½" - alternativeKeys: "¼⅓½¾⅞" - } - Key { - key: Qt.Key_BraceLeft - text: "{" - } - Key { - key: Qt.Key_BraceRight - text: "}" - } - BackspaceKey {} - } - KeyboardRow { - FillerKey { - weight: 56 - } - Key { - key: Qt.Key_Dollar - text: "$" - } - Key { - key: 0x20AC - text: "€" - } - Key { - key: 0xC2 - text: "£" - } - Key { - key: 0xA2 - text: "¢" - } - Key { - key: 0xA5 - text: "¥" - } - Key { - key: Qt.Key_Equal - text: "=" - } - Key { - key: Qt.Key_section - text: "§" - } - Key { - key: Qt.Key_BracketLeft - text: "[" - } - Key { - key: Qt.Key_BracketRight - text: "]" - } - EnterKey { - weight: 283 - } - } - KeyboardRow { - keyWeight: 156 - Key { - displayText: "2/2" - functionKey: true - onClicked: secondPage = !secondPage - } - Key { - key: Qt.Key_Underscore - text: "_" - } - Key { - key: 0x2122 - text: '™' - } - Key { - key: 0x00AE - text: '®' - } - Key { - key: Qt.Key_guillemotleft - text: '«' - } - Key { - key: Qt.Key_guillemotright - text: '»' - } - Key { - key: 0x201C - text: '“' - } - Key { - key: 0x201D - text: '”' - } - Key { - key: Qt.Key_Backslash - text: "\\" - } - Key { - key: Qt.Key_AsciiCircum - text: "^" - } - Key { - weight: 204 - displayText: "2/2" - functionKey: true - onClicked: secondPage = !secondPage - } - } - KeyboardRow { - keyWeight: 154 - SymbolModeKey { - weight: 217 - displayText: "ABC" - } - ChangeLanguageKey { - weight: 154 - } - SpaceKey { - weight: 864 - } - Key { - key: 0x2026 - text: "\u2026" - } - Key { - key: 0xE000 - text: ":-)" - alternativeKeys: [ ";-)", ":-)", ":-D", ":-(", "<3" ] - } - HideKeyboardKey { - weight: 204 - } - } - } - } -} diff --git a/src/virtualkeyboard/content/layouts/th_TH/dialpad.fallback b/src/virtualkeyboard/content/layouts/th_TH/dialpad.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/th_TH/dialpad.fallback diff --git a/src/virtualkeyboard/content/layouts/th_TH/digits.fallback b/src/virtualkeyboard/content/layouts/th_TH/digits.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/th_TH/digits.fallback diff --git a/src/virtualkeyboard/content/layouts/th_TH/main.qml b/src/virtualkeyboard/content/layouts/th_TH/main.qml new file mode 100644 index 00000000..baf18781 --- /dev/null +++ b/src/virtualkeyboard/content/layouts/th_TH/main.qml @@ -0,0 +1,489 @@ +/**************************************************************************** +** +** Copyright (C) 2018 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Qt Virtual Keyboard module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:GPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 or (at your option) any later version +** approved by the KDE Free Qt Foundation. The licenses are as published by +** the Free Software Foundation and appearing in the file LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.0 +import QtQuick.Layouts 1.0 +import QtQuick.VirtualKeyboard 2.3 + +KeyboardLayoutLoader { + inputMode: InputEngine.Latin + function createInputMethod() { + return Qt.createQmlObject('import QtQuick 2.0; import QtQuick.VirtualKeyboard 2.3; ThaiInputMethod {}', parent, "thaiInputMethod") + } + sharedLayouts: [ "symbols" ] + sourceComponent: InputContext.shift ? page2 : page1 + Component { + id: page1 + KeyboardLayout { + keyWeight: 160 + KeyboardRow { + Layout.preferredHeight: 3 + smallTextVisible: true + KeyboardColumn { + Layout.preferredWidth: bottomRow.width - hideKeyboardKey.width + KeyboardRow { + Key { + text: "ๆ" + alternativeKeys: "ๆ๑" + } + Key { + text: "ๅ" + alternativeKeys: "ๅ๒" + } + Key { + text: "ภ" + alternativeKeys: "ภ๓" + } + Key { + text: "ถ" + alternativeKeys: "ถ๔" + } + Key { + text: "\u0E38" + displayText: " \u0E38" + alternativeKeys: [ "\u0E38", " \u0E39" ] + } + Key { + text: "\u0E36" + displayText: " \u0E36" + } + Key { + text: "ค" + alternativeKeys: "ค๕" + } + Key { + text: "ต" + alternativeKeys: "ต๖" + } + Key { + text: "จ" + alternativeKeys: "จ๗" + } + Key { + text: "ข" + alternativeKeys: "ข๘" + } + Key { + text: "ช" + alternativeKeys: "ช๙" + } + } + KeyboardRow { + Key { + text: "ไ" + alternativeKeys: "ไ฿" + } + Key { + text: " ำ" + alternativeKeys: " ำฎ" + } + Key { + text: "พ" + alternativeKeys: "พฑ" + } + Key { + text: "ะ" + alternativeKeys: "ะธ" + } + Key { + text: "\u0E31" + displayText: " \u0E31" + alternativeKeys: "\u0E31。" + } + Key { + text: "\u0E35" + displayText: " \u0E35" + alternativeKeys: [ "\u0E35", " \u0E4A" ] + } + Key { + text: "ร" + alternativeKeys: "รณ" + } + Key { + text: "น" + alternativeKeys: "นฯ" + } + Key { + text: "ย" + alternativeKeys: "ยญ" + } + Key { + text: "บ" + alternativeKeys: "บฐ" + } + Key { + text: "ล" + } + } + KeyboardRow { + Key { + text: "ฟ" + alternativeKeys: "ฟฤ" + } + Key { + text: "ห" + alternativeKeys: "หฆ" + } + Key { + text: "ก" + alternativeKeys: "กฏ" + } + Key { + text: "ด" + alternativeKeys: "ดโ" + } + Key { + text: "เ" + alternativeKeys: "เฌ" + } + Key { + text: "\u0E49" + displayText: " \u0E49" + alternativeKeys: [ "\u0E49", " \u0E47" ] + } + Key { + text: "\u0E48" + displayText: " \u0E48" + alternativeKeys: [ "\u0E48", " \u0E4B" ] + } + Key { + text: "า" + alternativeKeys: "าษ" + } + Key { + text: "ส" + alternativeKeys: "สศ" + } + Key { + text: "ว" + alternativeKeys: "วซ" + } + Key { + text: "ง" + } + } + KeyboardRow { + FillerKey { + weight: 80 + } + Key { + text: "ผ" + } + Key { + text: "ป" + } + Key { + text: "แ" + alternativeKeys: "แฉ" + } + Key { + text: "อ" + alternativeKeys: "อฮ" + } + Key { + text: "\u0E34" + displayText: " \u0E34" + alternativeKeys: [ "\u0E34", " \u0E3A" ] + } + Key { + text: "\u0E37" + displayText: " \u0E37" + alternativeKeys: [ "\u0E37", " \u0E4C" ] + } + Key { + text: "ท" + } + Key { + text: "ม" + alternativeKeys: "มฒ" + } + Key { + text: "ใ" + alternativeKeys: "ใฬ" + } + Key { + text: "ฝ" + alternativeKeys: "ฝฦ" + } + FillerKey { + weight: 80 + } + } + } + KeyboardColumn { + Layout.preferredWidth: hideKeyboardKey.width + KeyboardRow { + BackspaceKey {} + } + KeyboardRow { + EnterKey {} + } + KeyboardRow { + ShiftKey { } + } + } + } + KeyboardRow { + id: bottomRow + keyWeight: 154 + SymbolModeKey { + weight: 217 + } + ChangeLanguageKey { + weight: 154 + } + HandwritingModeKey { + weight: 154 + } + SpaceKey { + weight: 864 + } + Key { + key: Qt.Key_Period + text: "." + alternativeKeys: "!?.," + smallTextVisible: true + } + Key { + key: 0xE000 + text: ":-)" + alternativeKeys: [ ";-)", ":-)", ":-D", ":-(", "<3" ] + } + HideKeyboardKey { + id: hideKeyboardKey + weight: 204 + } + } + } + } + Component { + id: page2 + KeyboardLayout { + keyWeight: 160 + KeyboardRow { + Layout.preferredHeight: 3 + smallTextVisible: true + KeyboardColumn { + Layout.preferredWidth: bottomRow.width - hideKeyboardKey.width + KeyboardRow { + Key { + text: "๑" + } + Key { + text: "๒" + } + Key { + text: "๓" + } + Key { + text: "๔" + } + Key { + text: "\u0E39" + displayText: " \u0E39" + } + Key { + enabled: false + } + Key { + text: "๕" + } + Key { + text: "๖" + } + Key { + text: "๗" + } + Key { + text: "๘" + } + Key { + text: "๙" + } + } + KeyboardRow { + Key { + text: "฿" + } + Key { + text: "ฎ" + } + Key { + text: "ฑ" + } + Key { + text: "ธ" + } + Key { + text: "。" + } + Key { + text: "\u0E4A" + displayText: " \u0E4A" + } + Key { + text: "ณ" + } + Key { + text: "ฯ" + } + Key { + text: "ญ" + } + Key { + text: "ฐ" + } + Key { + enabled: false + } + } + KeyboardRow { + Key { + text: "ฤ" + } + Key { + text: "ฆ" + } + Key { + text: "ฏ" + } + Key { + text: "โ" + } + Key { + text: "ฌ" + } + Key { + text: "\u0E47" + displayText: " \u0E47" + } + Key { + text: "\u0E4B" + displayText: " \u0E4B" + } + Key { + text: "ษ" + } + Key { + text: "ศ" + } + Key { + text: "ซ" + } + Key { + enabled: false + } + } + KeyboardRow { + FillerKey { + weight: 80 + } + Key { + enabled: false + } + Key { + enabled: false + } + Key { + text: "ฉ" + } + Key { + text: "ฮ" + } + Key { + text: "\u0E3A" + displayText: " \u0E3A" + } + Key { + text: "\u0E4C" + displayText: " \u0E4C" + } + Key { + enabled: false + } + Key { + text: "ฒ" + } + Key { + text: "ฬ" + } + Key { + text: "ฦ" + } + FillerKey { + weight: 80 + } + } + } + KeyboardColumn { + Layout.preferredWidth: hideKeyboardKey.width + KeyboardRow { + BackspaceKey {} + } + KeyboardRow { + EnterKey {} + } + KeyboardRow { + ShiftKey { } + } + } + } + KeyboardRow { + id: bottomRow + keyWeight: 154 + SymbolModeKey { + weight: 217 + } + ChangeLanguageKey { + weight: 154 + } + HandwritingModeKey { + weight: 154 + } + SpaceKey { + weight: 864 + } + Key { + key: Qt.Key_Comma + text: "," + alternativeKeys: "!?," + } + Key { + key: 0xE000 + text: ":-)" + alternativeKeys: [ ";-)", ":-)", ":-D", ":-(", "<3" ] + } + HideKeyboardKey { + id: hideKeyboardKey + weight: 204 + } + } + } + } +} diff --git a/src/virtualkeyboard/content/layouts/th_TH/numbers.fallback b/src/virtualkeyboard/content/layouts/th_TH/numbers.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/th_TH/numbers.fallback diff --git a/src/virtualkeyboard/content/layouts/da_DK/symbols.qml b/src/virtualkeyboard/content/layouts/th_TH/symbols.qml index 06d815d8..53fdcd6e 100644 --- a/src/virtualkeyboard/content/layouts/da_DK/symbols.qml +++ b/src/virtualkeyboard/content/layouts/th_TH/symbols.qml @@ -180,7 +180,7 @@ KeyboardLayoutLoader { keyWeight: 154 SymbolModeKey { weight: 217 - displayText: "ABC" + displayText: "กขค" } ChangeLanguageKey { weight: 154 @@ -191,7 +191,7 @@ KeyboardLayoutLoader { Key { key: Qt.Key_Period text: "." - alternativeKeys: ".," + alternativeKeys: "!?.," } Key { key: 0xE000 @@ -350,7 +350,7 @@ KeyboardLayoutLoader { keyWeight: 154 SymbolModeKey { weight: 217 - displayText: "ABC" + displayText: "กขค" } ChangeLanguageKey { weight: 154 diff --git a/src/virtualkeyboard/content/layouts/tr_TR/dialpad.fallback b/src/virtualkeyboard/content/layouts/tr_TR/dialpad.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/tr_TR/dialpad.fallback diff --git a/src/virtualkeyboard/content/layouts/tr_TR/digits.fallback b/src/virtualkeyboard/content/layouts/tr_TR/digits.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/tr_TR/digits.fallback diff --git a/src/virtualkeyboard/content/layouts/tr_TR/handwriting.fallback b/src/virtualkeyboard/content/layouts/tr_TR/handwriting.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/tr_TR/handwriting.fallback diff --git a/src/virtualkeyboard/content/layouts/tr_TR/main.qml b/src/virtualkeyboard/content/layouts/tr_TR/main.qml new file mode 100644 index 00000000..2fec7d57 --- /dev/null +++ b/src/virtualkeyboard/content/layouts/tr_TR/main.qml @@ -0,0 +1,221 @@ +/**************************************************************************** +** +** Copyright (C) 2018 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Qt Virtual Keyboard module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:GPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 or (at your option) any later version +** approved by the KDE Free Qt Foundation. The licenses are as published by +** the Free Software Foundation and appearing in the file LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.0 +import QtQuick.VirtualKeyboard 2.3 + +KeyboardLayout { + inputMode: InputEngine.Latin + keyWeight: 160 + KeyboardRow { + Key { + key: Qt.Key_Q + text: "q" + } + Key { + key: Qt.Key_W + text: "w" + } + Key { + key: Qt.Key_E + text: "e" + } + Key { + key: Qt.Key_R + text: "r" + } + Key { + key: Qt.Key_T + text: "t" + } + Key { + key: Qt.Key_Y + text: "y" + } + Key { + key: Qt.Key_U + text: "u" + } + Key { + text: "\u0131" + } + Key { + key: Qt.Key_O + text: "o" + } + Key { + key: Qt.Key_P + text: "p" + } + Key { + text: "\u011F" + } + Key { + key: Qt.Key_Udiaeresis + text: "ü" + } + BackspaceKey {} + } + KeyboardRow { + FillerKey { + weight: 66 + } + Key { + key: Qt.Key_A + text: "a" + alternativeKeys: "aåä" + } + Key { + key: Qt.Key_S + text: "s" + alternativeKeys: "sš" + } + Key { + key: Qt.Key_D + text: "d" + } + Key { + key: Qt.Key_F + text: "f" + } + Key { + key: Qt.Key_G + text: "g" + } + Key { + key: Qt.Key_H + text: "h" + } + Key { + key: Qt.Key_J + text: "j" + } + Key { + key: Qt.Key_K + text: "k" + } + Key { + key: Qt.Key_L + text: "l" + } + Key { + text: "ş" + } + Key { + key: Qt.Key_I + text: "i" + } + EnterKey { + weight: 283 + } + } + KeyboardRow { + keyWeight: 156 + ShiftKey { } + Key { + key: Qt.Key_Z + text: "z" + alternativeKeys: "zž" + } + Key { + key: Qt.Key_X + text: "x" + alternativeKeys: "$¢x₺€¥£" + smallTextVisible: true + } + Key { + key: Qt.Key_C + text: "c" + } + Key { + key: Qt.Key_V + text: "v" + } + Key { + key: Qt.Key_B + text: "b" + } + Key { + key: Qt.Key_N + text: "n" + } + Key { + key: Qt.Key_M + text: "m" + } + Key { + key: Qt.Key_Odiaeresis + text: "ö" + } + Key { + key: Qt.Key_Ccedilla + text: "ç" + } + Key { + key: Qt.Key_Comma + text: "," + } + Key { + key: Qt.Key_Period + text: "." + alternativeKeys: "!?." + smallTextVisible: true + } + ShiftKey { + weight: 264 + } + } + KeyboardRow { + keyWeight: 154 + SymbolModeKey { + weight: 217 + } + ChangeLanguageKey { + weight: 154 + } + HandwritingModeKey { + weight: 154 + } + SpaceKey { + weight: 864 + } + Key { + key: Qt.Key_Apostrophe + text: "'" + } + Key { + key: 0xE000 + text: ":-)" + alternativeKeys: [ ";-)", ":-)", ":-D", ":-(", "<3" ] + } + HideKeyboardKey { + weight: 204 + } + } +} diff --git a/src/virtualkeyboard/content/layouts/tr_TR/numbers.fallback b/src/virtualkeyboard/content/layouts/tr_TR/numbers.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/tr_TR/numbers.fallback diff --git a/src/virtualkeyboard/content/layouts/tr_TR/symbols.fallback b/src/virtualkeyboard/content/layouts/tr_TR/symbols.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/tr_TR/symbols.fallback diff --git a/src/virtualkeyboard/content/layouts/uk_UA/dialpad.fallback b/src/virtualkeyboard/content/layouts/uk_UA/dialpad.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/uk_UA/dialpad.fallback diff --git a/src/virtualkeyboard/content/layouts/uk_UA/digits.fallback b/src/virtualkeyboard/content/layouts/uk_UA/digits.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/uk_UA/digits.fallback diff --git a/src/virtualkeyboard/content/layouts/uk_UA/handwriting.fallback b/src/virtualkeyboard/content/layouts/uk_UA/handwriting.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/uk_UA/handwriting.fallback diff --git a/src/virtualkeyboard/content/layouts/hr_HR/symbols.qml b/src/virtualkeyboard/content/layouts/uk_UA/main.qml index 76c06493..011fc309 100644 --- a/src/virtualkeyboard/content/layouts/hr_HR/symbols.qml +++ b/src/virtualkeyboard/content/layouts/uk_UA/main.qml @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2017 The Qt Company Ltd. +** Copyright (C) 2018 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Virtual Keyboard module of the Qt Toolkit. @@ -27,171 +27,161 @@ ** ****************************************************************************/ -import QtQuick 2.0 -import QtQuick.Layouts 1.0 +import QtQuick 2.10 import QtQuick.VirtualKeyboard 2.3 KeyboardLayoutLoader { - property bool secondPage - onVisibleChanged: if (!visible) secondPage = false - sourceComponent: secondPage ? page2 : page1 + sharedLayouts: ['symbols'] + sourceComponent: InputContext.inputEngine.inputMode === InputEngine.Cyrillic ? cyrillicLayout : latinLayout Component { - id: page1 + id: cyrillicLayout KeyboardLayout { keyWeight: 160 KeyboardRow { Key { - key: Qt.Key_1 - text: "1" + text: "й" } Key { - key: Qt.Key_2 - text: "2" + text: "ц" } Key { - key: Qt.Key_3 - text: "3" + text: "у" } Key { - key: Qt.Key_4 - text: "4" + text: "к" } Key { - key: Qt.Key_5 - text: "5" + text: "е" } Key { - key: Qt.Key_6 - text: "6" + text: "н" } Key { - key: Qt.Key_7 - text: "7" + text: "г" } Key { - key: Qt.Key_8 - text: "8" + text: "ш" } Key { - key: Qt.Key_9 - text: "9" + text: "щ" } Key { - key: Qt.Key_0 - text: "0" + text: "з" + } + Key { + text: "х" + } + Key { + text: "ї" + } + BackspaceKey { + weight: 180 } - BackspaceKey {} } KeyboardRow { FillerKey { - weight: 56 + weight: 40 } Key { - key: Qt.Key_At - text: "@" + text: "ф" } Key { - key: Qt.Key_NumberSign - text: "#" + text: "і" } Key { - key: Qt.Key_Percent - text: "%" + text: "в" } Key { - key: Qt.Key_Ampersand - text: "&" + text: "а" } Key { - key: Qt.Key_Asterisk - text: "*" + text: "п" } Key { - key: Qt.Key_Minus - text: "-" + text: "р" } Key { - key: Qt.Key_Plus - text: "+" + text: "о" } Key { - key: Qt.Key_ParenLeft - text: "(" + text: "л" } Key { - key: Qt.Key_ParenRight - text: ")" + text: "д" + } + Key { + text: "ж" + } + Key { + text: "є" } EnterKey { - weight: 283 + weight: 280 } } KeyboardRow { - keyWeight: 156 + InputModeKey { + inputModes: [InputEngine.Cyrillic, InputEngine.Latin] + } Key { - displayText: "1/2" - functionKey: true - onClicked: secondPage = !secondPage + text: "ґ" } Key { - key: Qt.Key_Exclam - text: "!" + text: "я" + alternativeKeys: "$¢я₴€¥£" + smallTextVisible: true } Key { - key: Qt.Key_QuoteDbl - text: '"' + text: "ч" } Key { - key: Qt.Key_Apostrophe - text: "'" + text: "с" } Key { - key: Qt.Key_Less - text: "<" + text: "м" } Key { - key: Qt.Key_Greater - text: ">" + text: "и" } Key { - key: Qt.Key_Colon - text: ":" + text: "т" } Key { - key: Qt.Key_Semicolon - text: ";" + text: "ь" } Key { - key: Qt.Key_Slash - text: "/" + text: "б" } Key { - key: Qt.Key_Question - text: "?" + text: "ю" } Key { - weight: 204 - displayText: "1/2" - functionKey: true - onClicked: secondPage = !secondPage + key: Qt.Key_Apostrophe + text: "'" + } + ShiftKey { + weight: 272 } } KeyboardRow { keyWeight: 154 SymbolModeKey { weight: 217 - displayText: "ABC" } ChangeLanguageKey { weight: 154 } + HandwritingModeKey { + weight: 154 + } SpaceKey { weight: 864 } Key { key: Qt.Key_Period text: "." - alternativeKeys: ".," + alternativeKeys: ";:!?.," + smallTextVisible: true } Key { key: 0xE000 @@ -205,50 +195,50 @@ KeyboardLayoutLoader { } } Component { - id: page2 + id: latinLayout KeyboardLayout { keyWeight: 160 KeyboardRow { Key { - key: Qt.Key_AsciiTilde - text: "~" + key: Qt.Key_Q + text: "q" } Key { - key: Qt.Key_Agrave - text: "`" + key: Qt.Key_W + text: "w" } Key { - key: Qt.Key_Bar - text: "|" + key: Qt.Key_E + text: "e" } Key { - key: 0x7B - text: "·" + key: Qt.Key_R + text: "r" } Key { - key: 0x221A - text: "√" + key: Qt.Key_T + text: "t" } Key { - key: Qt.Key_division - text: "÷" + key: Qt.Key_Y + text: "y" } Key { - key: Qt.Key_multiply - text: "×" + key: Qt.Key_U + text: "u" } Key { - key: Qt.Key_onehalf - text: "½" - alternativeKeys: "¼⅓½¾⅞" + key: Qt.Key_I + text: "i" } Key { - key: Qt.Key_BraceLeft - text: "{" + key: Qt.Key_O + text: "o" + alternativeKeys: "oö" } Key { - key: Qt.Key_BraceRight - text: "}" + key: Qt.Key_P + text: "p" } BackspaceKey {} } @@ -257,40 +247,43 @@ KeyboardLayoutLoader { weight: 56 } Key { - key: Qt.Key_Dollar - text: "$" + key: Qt.Key_A + text: "a" + alternativeKeys: "aåä" } Key { - key: 0x20AC - text: "€" + key: Qt.Key_S + text: "s" + alternativeKeys: "sš" } Key { - key: 0xC2 - text: "£" + key: Qt.Key_D + text: "d" + alternativeKeys: "dđ" } Key { - key: 0xA2 - text: "¢" + key: Qt.Key_F + text: "f" } Key { - key: 0xA5 - text: "¥" + key: Qt.Key_G + text: "g" } Key { - key: Qt.Key_Equal - text: "=" + key: Qt.Key_H + text: "h" } Key { - key: Qt.Key_section - text: "§" + key: Qt.Key_J + text: "j" } Key { - key: Qt.Key_BracketLeft - text: "[" + key: Qt.Key_K + text: "k" } Key { - key: Qt.Key_BracketRight - text: "]" + key: Qt.Key_L + text: "l" } EnterKey { weight: 283 @@ -298,69 +291,73 @@ KeyboardLayoutLoader { } KeyboardRow { keyWeight: 156 - Key { - displayText: "2/2" - functionKey: true - onClicked: secondPage = !secondPage + InputModeKey { + inputModes: [InputEngine.Cyrillic, InputEngine.Latin] } Key { - key: Qt.Key_Underscore - text: "_" + key: Qt.Key_Z + text: "z" + alternativeKeys: "zž" } Key { - key: 0x2122 - text: '™' + key: Qt.Key_X + text: "x" + alternativeKeys: "$¢x₴€¥£" + smallTextVisible: true } Key { - key: 0x00AE - text: '®' + key: Qt.Key_C + text: "c" + alternativeKeys: "ćcč" } Key { - key: Qt.Key_guillemotleft - text: '«' + key: Qt.Key_V + text: "v" } Key { - key: Qt.Key_guillemotright - text: '»' + key: Qt.Key_B + text: "b" } Key { - key: 0x201C - text: '“' + key: Qt.Key_N + text: "n" } Key { - key: 0x201D - text: '”' + key: Qt.Key_M + text: "m" } Key { - key: Qt.Key_Backslash - text: "\\" + key: Qt.Key_Minus + text: "-" + alternativeKeys: "-\"'" } Key { - key: Qt.Key_AsciiCircum - text: "^" + key: Qt.Key_Apostrophe + text: "'" } - Key { + ShiftKey { weight: 204 - displayText: "2/2" - functionKey: true - onClicked: secondPage = !secondPage } } KeyboardRow { keyWeight: 154 SymbolModeKey { weight: 217 - displayText: "ABC" } ChangeLanguageKey { weight: 154 } + HandwritingModeKey { + weight: 154 + } SpaceKey { weight: 864 } Key { - key: 0x2026 - text: "\u2026" + key: Qt.Key_Period + text: "." + alternativeKeys: ";:!?.," + smallTextVisible: true } Key { key: 0xE000 diff --git a/src/virtualkeyboard/content/layouts/uk_UA/numbers.fallback b/src/virtualkeyboard/content/layouts/uk_UA/numbers.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/uk_UA/numbers.fallback diff --git a/src/virtualkeyboard/content/layouts/uk_UA/symbols.fallback b/src/virtualkeyboard/content/layouts/uk_UA/symbols.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/uk_UA/symbols.fallback diff --git a/src/virtualkeyboard/content/layouts/vi_VN/dialpad.fallback b/src/virtualkeyboard/content/layouts/vi_VN/dialpad.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/vi_VN/dialpad.fallback diff --git a/src/virtualkeyboard/content/layouts/vi_VN/digits.fallback b/src/virtualkeyboard/content/layouts/vi_VN/digits.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/vi_VN/digits.fallback diff --git a/src/virtualkeyboard/content/layouts/vi_VN/handwriting.fallback b/src/virtualkeyboard/content/layouts/vi_VN/handwriting.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/vi_VN/handwriting.fallback diff --git a/src/virtualkeyboard/content/layouts/vi_VN/handwriting.qml b/src/virtualkeyboard/content/layouts/vi_VN/handwriting.qml deleted file mode 100644 index 8dce4e76..00000000 --- a/src/virtualkeyboard/content/layouts/vi_VN/handwriting.qml +++ /dev/null @@ -1,97 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2018 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Virtual Keyboard module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.10 -import QtQuick.Layouts 1.3 -import QtQuick.VirtualKeyboard 2.3 - -KeyboardLayout { - function createInputMethod() { - return Qt.createQmlObject('import QtQuick 2.10; import QtQuick.VirtualKeyboard 2.3; HandwritingInputMethod {}', parent) - } - sharedLayouts: ['symbols'] - inputMode: InputEngine.Latin - - KeyboardRow { - Layout.preferredHeight: 3 - KeyboardColumn { - Layout.preferredWidth: bottomRow.width - hideKeyboardKey.width - KeyboardRow { - TraceInputKey { - objectName: "hwrInputArea" - patternRecognitionMode: InputEngine.HandwritingRecoginition - } - } - } - KeyboardColumn { - Layout.preferredWidth: hideKeyboardKey.width - KeyboardRow { - BackspaceKey {} - } - KeyboardRow { - EnterKey {} - } - KeyboardRow { - ShiftKey { } - } - } - } - KeyboardRow { - id: bottomRow - Layout.preferredHeight: 1 - keyWeight: 154 - InputModeKey { - weight: 217 - } - ChangeLanguageKey { - weight: 154 - customLayoutsOnly: true - } - HandwritingModeKey { - weight: 154 - } - SpaceKey { - weight: 864 - } - Key { - key: Qt.Key_Apostrophe - text: "'" - alternativeKeys: "<>()#%&*/\\\"'=+-_" - } - Key { - key: Qt.Key_Period - text: "." - alternativeKeys: ":;,.?!" - } - HideKeyboardKey { - id: hideKeyboardKey - weight: 204 - } - } -} diff --git a/src/virtualkeyboard/content/layouts/vi_VN/numbers.fallback b/src/virtualkeyboard/content/layouts/vi_VN/numbers.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/vi_VN/numbers.fallback diff --git a/src/virtualkeyboard/content/layouts/zh_CN/dialpad.fallback b/src/virtualkeyboard/content/layouts/zh_CN/dialpad.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/zh_CN/dialpad.fallback diff --git a/src/virtualkeyboard/content/layouts/zh_CN/digits.fallback b/src/virtualkeyboard/content/layouts/zh_CN/digits.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/zh_CN/digits.fallback diff --git a/src/virtualkeyboard/content/layouts/zh_CN/numbers.fallback b/src/virtualkeyboard/content/layouts/zh_CN/numbers.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/zh_CN/numbers.fallback diff --git a/src/virtualkeyboard/content/layouts/zh_TW/dialpad.fallback b/src/virtualkeyboard/content/layouts/zh_TW/dialpad.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/zh_TW/dialpad.fallback diff --git a/src/virtualkeyboard/content/layouts/zh_TW/digits.fallback b/src/virtualkeyboard/content/layouts/zh_TW/digits.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/zh_TW/digits.fallback diff --git a/src/virtualkeyboard/content/layouts/zh_TW/numbers.fallback b/src/virtualkeyboard/content/layouts/zh_TW/numbers.fallback new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/virtualkeyboard/content/layouts/zh_TW/numbers.fallback diff --git a/src/virtualkeyboard/doc/src/build.qdoc b/src/virtualkeyboard/doc/src/build.qdoc index 72f025cf..856eaba6 100644 --- a/src/virtualkeyboard/doc/src/build.qdoc +++ b/src/virtualkeyboard/doc/src/build.qdoc @@ -70,6 +70,9 @@ The project is split into the following subprojects: \row \li \e src/virtualkeyboard/3rdparty/tcime/tcime.pro \li A project file for compiling the TCIME library. +\row + \li \e src/plugins/myscript/myscript.pro + \li A project file for compiling MyScript Superimposed HWR (handwriting recognition) plugin. \endtable The input methods are implemented either in C++ or QML. @@ -128,7 +131,7 @@ keyboard features. \li \e handwriting \li Enables handwriting input \li This flag enables handwriting input using the first engine available at - build time in the following order: \c t9write, \c lipi-toolkit. To enable handwriting + build time in the following order: \c myscript, \c t9write, \c lipi-toolkit. To enable handwriting input using a specific engine, use the feature-specific configuration instead. For example, \c CONFIG+=lipi-toolkit. \row @@ -271,6 +274,11 @@ the preferred input method to the configuration, e.g., \c CONFIG+="lang-zh_TW zh \li \e handwriting \li Enables the handwriting input method using T9 Write. \li Handwriting recognition is based on the commercial T9 Write product from Nuance Communications. +\row + \li \e myscript + \li \e handwriting + \li Enables the handwriting input method using MyScript Text SDK. + \li Handwriting recognition is based on the most recent commercial Text Recognition SDK product from MyScript. \endtable \section2 Building Documentation @@ -443,6 +451,143 @@ Where the contents of each directory are: Finally, the SDK is included in the build by adding CONFIG+=t9write to the qmake command line. +\section2 MyScript Text SDK Integration + +MyScript Text is designed for building applications that enable the recognition of +handwritten text. MyScript Text supports the recognition of isolated character, cursive, +print and superimposed writing. Especially, most recent text recognition technology, +MyScript superimposed writing is integrated into Qt Virtual Keyboard, and it enables +the recognition of letters, words or parts of words written one over the other, +without any explicit separation between consecutive fragments. It targets small size +devices with sufficient hardware capabilities in terms of CPU power and memory. + +\section3 Input handwriting styles of MyScript Text SDK + +The end-user can write one word fragment over the other or one character over the other, +as depicted below. Space between two written words are automatically added, so that there +is no need for an explicit gesture. + +\raw HTML +<div align="center"><figure><svg xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" width="21.057215mm" height="23.094498mm" viewbox="0 0 74.612178 81.830896" id="svg4891" version="1.1"> <defs id="defs4893"></defs> <metadata id="metadata4896"> </metadata> <g id="layer1" transform="translate(523.68284,-132.09962)"> <filter id="dropshadow" height="130%"> <fegaussianblur in="SourceAlpha" stddeviation="3"></fegaussianblur> <feoffset dx="2" dy="2" result="offsetblur"></feoffset> <fecomponenttransfer xmlns="http://www.w3.org/2000/svg"> <fefunca type="linear" slope="0.5"></fefunca> </fecomponenttransfer> <femerge> <femergenode></femergenode> <femergenode in="SourceGraphic"></femergenode> </femerge></filter> <path style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1" stroke-dasharray="300" stroke-dashoffset="300" d="m -523.25902,200.29853 c 6.95139,11.10595 25.78874,3.22177 32.32488,-4.04061 11.79865,-13.1096 17.63403,-31.02787 14.14214,-48.48732 -0.50587,-2.52933 -5.5167,-18.22189 -9.09137,-14.64721 -5.55428,5.55427 -5.5673,24.06358 -6.06092,30.80965 -0.76585,10.46668 -2.8203,20.43699 -4.04061,30.80965 -0.6416,5.45361 -0.50508,9.28437 -0.50508,14.64722 0,1.34687 1.34687,4.04061 0,4.04061 -0.61968,0 0.23734,-4.20009 2.52539,-10.60661 3.69589,-10.34851 8.06488,-17.115 18.68782,-21.71828 2.1627,-0.93717 6.32571,-2.23606 7.07106,0 1.75433,5.26298 -3.71882,27.10875 8.08123,24.74874 1.4766,-0.29532 3.0107,-0.92173 4.04061,-2.0203 1.59968,-1.70633 2.42154,-4.00433 3.53553,-6.06092 1.07581,-1.98612 2.0203,-4.04061 3.03046,-6.06091" id="path4899"> <animate begin="0s;hOpacityFinal.end" attributename="stroke-dashoffset" from="300px" to="0px" dur="2s" fill="freeze" id="h"></animate> <animate begin="h.end" attributename="opacity" from="1" to="0.2" dur="2s" fill="freeze" id="hOpacity"></animate> <animate begin="oOpacity.end" attributename="opacity" from="0.2" to="0" dur="0.1s" fill="remove" id="hOpacityFinal"></animate> <set begin="hOpacityFinal.end" attributename="opacity" to="1"></set> </path> <path style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1" stroke-dasharray="150" stroke-dashoffset="150" d="m -503.05597,187.16655 c 6.30156,1.57539 7.48006,2.26745 14.64721,2.0203 4.68337,-0.16149 7.79914,-1.02611 11.11168,-4.54568 10.51043,-11.16733 -11.38898,-18.31643 -18.18274,-3.03046 -0.77578,1.7455 -0.56279,12.84339 0,14.14214 6.50612,15.01414 20.7593,7.81972 27.77919,-2.52539 1.4399,-2.12194 2.02031,-4.71404 3.03046,-7.07106" id="path4901"> <animate begin="h.end+0.01s" attributename="stroke-dashoffset" from="150px" to="0px" dur="2s" fill="freeze" id="e"></animate> <animate begin="e.end" attributename="opacity" from="1" to="0.2" dur="2s" fill="freeze" id="eOpacity"></animate> <animate begin="oOpacity.end" attributename="opacity" from="0.2" to="0" dur="0.1s" fill="remove" id="eOpacityFinal"></animate> <set begin="h.end" attributename="opacity" to="1"></set> </path> <path style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1" stroke-dasharray="200" stroke-dashoffset="200" d="m -501.03566,200.80361 c 11.64322,7.6781 20.14867,-6.67932 24.24366,-16.16244 1.65295,-3.82789 5.7942,-16.09995 4.54568,-21.71828 -0.76783,-3.45526 -2.7246,-6.56132 -4.54568,-9.59645 -10.0858,-16.80967 -16.78281,-1.60069 -18.68782,10.10152 -1.35371,8.31563 -3.14678,22.86131 -0.50508,31.31473 4.4811,14.33953 15.24399,22.1694 26.76904,8.5863 3.22845,-3.80496 5.30918,-10.30708 7.07107,-15.15229" id="path4903"> <animate begin="e.end+0.01s" attributename="stroke-dashoffset" from="200px" to="0px" dur="2s" fill="freeze" id="l"></animate> <animate begin="l.end" attributename="opacity" from="1" to="0.2" dur="2s" fill="freeze" id="lOpacity"></animate> <animate begin="oOpacity.end" attributename="opacity" from="0.2" to="0" dur="0.1s" fill="remove" id="lOpacityFinal"></animate> <set begin="e.end" attributename="opacity" to="1"></set> </path> <path style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1" stroke-dasharray="220" stroke-dashoffset="220" d="m -507.60165,205.3493 c 1.53719,3.07439 0.25722,2.0203 4.54568,2.0203 11.013,0 16.92189,-7.83289 21.21321,-17.67767 1.48054,-3.39653 3.24098,-15.42468 3.03045,-18.68782 -0.31004,-4.80567 -4.96262,-9.4326 -7.57614,-12.62691 -5.01521,-6.1297 -7.93642,-7.18375 -11.61676,1.51523 -3.61721,8.54979 -5.0193,26.86342 -2.0203,35.86042 3.71905,11.15714 12.82566,21.08507 24.74874,11.61675 3.11162,-2.47099 4.71404,-6.39763 7.07106,-9.59645" id="path4905"> <animate begin="l.end+0.01s" attributename="stroke-dashoffset" from="220px" to="0px" dur="2s" fill="freeze" id="l2"></animate> <animate begin="l2.end" attributename="opacity" from="1" to="0.2" dur="2s" fill="freeze" id="l2Opacity"></animate> <animate begin="oOpacity.end" attributename="opacity" from="0.2" to="0" dur="0.1s" fill="remove" id="l2OpacityFinal"></animate> <set begin="l.end" attributename="opacity" to="1"></set> </path> <path style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1" stroke-dasharray="120" stroke-dashoffset="120" d="m -483.86307,185.14624 c -4.91638,-10.38229 -25.09874,-2.01585 -21.71828,9.09138 4.18358,13.74606 25.60472,15.81949 31.31473,2.0203 8.05585,-19.4683 -24.24366,-20.3309 -24.24366,-12.12183" id="path4907"> <animate begin="l2.end+0.01s" attributename="stroke-dashoffset" from="100px" to="0px" dur="2s" fill="freeze" id="o"></animate> <animate begin="o.end" attributename="opacity" from="1" to="0" dur="2s" fill="freeze" id="oOpacity"></animate> <set begin="l2.end" attributename="opacity" to="1"></set> </path> </g></svg><figcaption>Writing one character over the other</figcaption></figure></div> +<div align="center"><figure><svg xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" version="1.1" id="svg2" viewbox="0 0 156.63411 96.840738" height="27.330608mm" width="44.205627mm"> <defs id="defs4"></defs> <metadata id="metadata7"> </metadata> <g transform="translate(-19.991064,-156.76845)" id="layer1"> <path id="path3338" stroke-dasharray="700" stroke-dashoffset="700" d="m 20.203051,228.07773 c 7.019038,3.28583 18.296996,2.19868 25.253814,2.0203 27.834023,-0.71369 42.825541,-21.91043 41.416254,-47.98224 -0.323001,-5.97553 -7.191269,-26.45641 -10.606602,-24.74874 -10.259596,5.1298 -9.124503,41.18434 -7.576144,52.02286 1.430314,10.01219 2.165272,8.95563 3.030458,20.20305 0.514408,6.68731 0.563751,12.53255 1.515229,19.19289 0.191958,1.34371 0.355181,2.69156 0.505076,4.04061 0.01859,0.16733 0,0.67344 0,0.50508 0,-2.49868 0.106479,0.64925 -1.010153,-4.04061 -1.138171,-4.78032 -2.879899,-14.31543 -2.525381,-18.68782 0.215131,-2.65328 1.334905,-5.19519 2.525381,-7.57615 1.190476,-2.38095 2.750791,-4.60015 4.545687,-6.56599 2.880061,-3.15435 5.631315,-6.15186 10.101525,-5.55584 7.218425,0.96246 9.158962,18.77507 9.596449,24.24367 0.312712,3.90889 -0.730173,4.84918 1.010153,8.08122 2.037193,3.78335 3.387013,4.88523 8.081223,5.55583 5.47716,0.78246 9.60547,-2.86344 13.63706,-6.06091 2.23856,-1.77541 4.56788,-3.62491 6.06091,-6.06092 4.94323,-8.06526 6.7262,-26.15308 -6.06091,-28.28427 -20.629129,-3.43819 -15.11782,36.04559 11.11167,35.35534 3.30658,-0.087 6.53787,-1.26596 9.59645,-2.52538 25.47885,-10.49129 20.89279,-45.3686 11.61676,-65.65992 -1.54311,-3.37554 -5.32932,-11.06285 -9.09137,-13.13198 -1.47519,-0.81135 -3.36718,0 -5.05077,0 -1.01015,0 -2.08112,-0.34521 -3.03046,0 -9.66282,3.51375 -12.01346,27.64821 -11.11167,36.36549 0.68611,6.63247 4.06851,21.716 8.08122,26.76905 8.89766,11.20446 20.90822,13.3675 34.34518,14.64721 4.58435,0.4366 7.15182,0.9294 10.10153,-2.02031" style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;"> <animate begin="0s;helOpacityFinal.end" attributename="stroke-dashoffset" from="700px" to="0px" dur="2s" fill="freeze" id="hel"></animate> <animate begin="hel.end" attributename="opacity" from="1" to="0.2" dur="3s" fill="freeze" id="helOpacity"></animate> <animate begin="loOpacity.end" attributename="opacity" from="0.2" to="0" dur="0.1s" fill="remove" id="helOpacityFinal"></animate> <set begin="helOpacityFinal.end" attributename="opacity" to="1"></set> </path> <path id="path3344" stroke-dasharray="500" stroke-dashoffset="500" d="m 41.416254,231.61326 c 3.094802,7.92585 11.797035,7.22396 19.192898,7.57614 31.260076,1.48858 50.776938,-24.97346 43.436558,-55.55839 -2.10376,-8.76565 -7.342388,-19.06976 -17.172591,-20.70812 -0.664273,-0.11071 -1.494441,-0.42069 -2.020305,0 -0.542049,0.43364 -0.354492,1.34267 -0.505077,2.0203 -0.522917,2.35313 -1.164511,4.68619 -1.515229,7.07107 -2.708747,18.41948 0.296465,32.36077 6.565992,49.49747 2.682486,7.33213 5.639357,17.22468 15.15229,17.67767 13.38648,0.63746 15.45757,-25.2821 7.07106,-32.82995 -1.55953,-1.40358 -5.88665,6.03367 -4.54568,15.15228 1.46349,9.95173 11.80613,17.40505 21.71828,15.15229 4.41964,-1.00446 11.43406,-9.0399 12.6269,-11.11167 7.10359,-12.33781 -9.7499,-22.51604 -18.18274,-26.26397 -11.05732,-4.91436 -18.5283,7.61904 -12.62691,11.61675 9.07281,6.1461 23.89173,1.97435 32.32488,-1.51523 4.27171,-1.7676 7.7445,-5.05076 11.61676,-7.57614" style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4"> <animate begin="hel.end" attributename="stroke-dashoffset" from="500px" to="0px" dur="3s" fill="freeze" id="lo"></animate> <animate begin="lo.end" attributename="opacity" from="1" to="0" dur="2s" fill="freeze" id="loOpacity"></animate> <set begin="hel.end" attributename="opacity" to="1"></set> </path> </g></svg><figcaption>Writing fragments of word over the others</figcaption></figure></div> +\endraw + +\section3 Language coverage of MyScript Text SDK + +MyScript Superimposed supports 70 languages. + +\section3 MyScript Text SDK Packages Installation + +MyScript delivery team provide you the packages with various \c .zip archives. +In order to access all the code, tools, and resources needed for building your own +handwriting application, \b {extract all the packages in the same destination folder} as +\c src/plugins/myscript/3rdparty/myscript. + +The file hierarchy should look like below: + +\badcode +3rdparty +└── myscript + ├─── conf + ├─── doc + ├─── edk + ├─── engine + │ └─── bin + │ ├─── lin-arm64 + │ │ └─── *.so + │ ├─── lin-armv7 + │ │ └─── *.so + │ ├─── lin-x64 + │ │ └─── *.so + │ ├─── lin-x86 + │ │ └─── *.so + │ ├─── win-x64 + │ │ └─── *.dll + │ ├─── win-x86 + │ │ └─── *.dll + │ (etc.) + ├─── rdk + ├─── resources + │ ├─── ar + │ │ └─── *.res + │ ├─── en_GB + │ │ └─── *.res + │ ├─── ja_JP + │ │ └─── *.res + │ ├─── ko_KR + │ │ └─── *.res + │ ├─── zh_CN + │ │ └─── *.res + │ (etc.) + ├─── tools + └─── voim + ├─── api + ├─── bin + │ ├─── lin-arm64 + │ │ └─── *.so + │ ├─── lin-armv7 + │ │ └─── *.so + │ ├─── lin-x64 + │ │ └─── *.so + │ ├─── lin-x86 + │ │ └─── *.so + │ ├─── win-x64 + │ │ └─── *.dll + │ ├─── win-x86 + │ │ └─── *.dll + │ (etc.) + └─── conf +\endcode + +The description for the contents of each directory are: + +\table +\header + \li Directory + \li Description +\row + \li \e conf + \li Contains the language configuration files that the Engine uses to configure language resources. +\row + \li \e doc + \li Contains the HTML documentation files. The file \c index.html displays the main page. +\row + \li \e edk + \li Contains the Engine Development Kit and handwriting programming elements for each supported programming language API, including code samples. +\row + \li \e engine + \li Contains libraries of each engine object, depending on the target platforms it could be SO, A, or DLL. +\row + \li \e rdk + \li Contains the Resource Development Kit, i.e. tools and examples for creating custom resources. +\row + \li \e resources + \li Contains resource files with the /c .res extension. They are binary assets used at run time by the different MyScript technologies to achieve the various recognition tasks. +\row + \li \e tools + \li Contains useful programmer tools including InkTool for ink testing. +\row + \li \e voim + \li Contains libraries of MyScript Text Input Method. It is an extension SDK to the MyScript Text recognition system, and designed for building input methods using handwriting recognition easily and quickly. +\endtable + +\section3 Setting the Certificate of MyScript Text SDK + +\b {A valid certificate is mandatory to use the MyScript Text SDK.} This is a +security measure that uniquely identifies you as a legitimate customer of MyScript +technologies. The certificate helps us trace customers identify and the products +that have been purchased. + +The certificate is delivered in the /c [your_login].vo.zip package. When you unzip +this package, the certificate is automatically put in the appropriate location. +This ensure that the certificate is instantly working within the services and code +samples that you have been provided with. + +\section3 How to build Qt Virtual Keyboard with MyScript Text SDK + +The MyScript Text SDK is included in the build of Qt Virtual Keyboard by either +adding \c CONFIG+=handwriting or \c CONFIG+=myscript to the qmake command line. + \section2 Static builds The virtual keyboard can be built and linked statically against the application. diff --git a/src/virtualkeyboard/doc/src/includes/layouts.qdocinc b/src/virtualkeyboard/doc/src/includes/layouts.qdocinc index dacced04..6bd0148a 100644 --- a/src/virtualkeyboard/doc/src/includes/layouts.qdocinc +++ b/src/virtualkeyboard/doc/src/includes/layouts.qdocinc @@ -3,6 +3,7 @@ The Virtual Keyboard supports the following languages: \list + \li \l {Albanian Layout}{Albanian} \li \l {Arabic Layout}{Arabic} \li \l {Bulgarian Layout}{Bulgarian} \li \l {Bulgarian Layout (Latin)}{Bulgarian (Latin)} @@ -14,6 +15,7 @@ The Virtual Keyboard supports the following languages: \li \l {Estonian Layout}{Estonian} \li \l {Finnish Layout}{Finnish} \li \l {French Layout}{French} + \li \l {French Layout (Canadian)}{French (Canadian)} \li \l {German Layout}{German} \li \l {Greek Layout}{Greek} \li \l {Greek Layout (Latin)}{Greek (Latin)} @@ -21,12 +23,14 @@ The Virtual Keyboard supports the following languages: \li \l {Hebrew Layout (Latin)}{Hebrew (Latin)} \li \l {Hindi Layout}{Hindi} \li \l {Hungarian Layout}{Hungarian} + \li \l {Indonesian Layout}{Indonesian} \li \l {Italian Layout}{Italian} \li \l {Japanese Layout (Hiragana)}{Japanese (Hiragana)} \li \l {Japanese Layout (Katakana)}{Japanese (Katakana)} \li \l {Japanese Layout (Full Width Latin)}{Japanese (Full Width Latin)} \li \l {Japanese Layout (Latin)}{Japanese (Latin)} \li \l {Korean Layout}{Korean} + \li \l {Malay Layout}{Malay} \li \l {Norwegian Layout}{Norwegian} \li \l {Persian/Farsi Layout}{Persian/Farsi} \li \l {Polish Layout}{Polish} @@ -38,8 +42,13 @@ The Virtual Keyboard supports the following languages: \li \l {Simplified Chinese Layout}{Simplified Chinese} \li \l {Traditional Chinese Layout (Zhuyin)}{Traditional Chinese (Zhuyin)} \li \l {Traditional Chinese Layout (Cangjie)}{Traditional Chinese (Cangjie)} + \li \l {Slovak Layout}{Slovak} + \li \l {Slovenian Layout}{Slovenian} \li \l {Spanish Layout}{Spanish} \li \l {Swedish Layout}{Swedish} + \li \l {Thai Layout}{Thai} + \li \l {Turkish Layout}{Turkish} + \li \l {Ukrainian Layout}{Ukrainian} \li \l {Vietnamese Layout}{Vietnamese} \endlist diff --git a/src/virtualkeyboard/doc/src/layouts.qdoc b/src/virtualkeyboard/doc/src/layouts.qdoc index 231f6cb2..efe21f2e 100644 --- a/src/virtualkeyboard/doc/src/layouts.qdoc +++ b/src/virtualkeyboard/doc/src/layouts.qdoc @@ -36,6 +36,10 @@ The next sections illustrate each layout. +\section2 Albanian Layout + +\image layouts/qtvirtualkeyboard-layout-sq_AL.png + \section2 Arabic Layout \image layouts/qtvirtualkeyboard-layout-ar_AR.png @@ -80,6 +84,10 @@ The next sections illustrate each layout. \image layouts/qtvirtualkeyboard-layout-fr_FR.png +\section2 French Layout (Canadian) + +\image layouts/qtvirtualkeyboard-layout-fr_CA.png + \section2 German Layout \image layouts/qtvirtualkeyboard-layout-de_DE.png @@ -108,6 +116,10 @@ The next sections illustrate each layout. \image layouts/qtvirtualkeyboard-layout-hu_HU.png +\section2 Indonesian Layout + +\image layouts/qtvirtualkeyboard-layout-id_ID.png + \section2 Italian Layout \image layouts/qtvirtualkeyboard-layout-it_IT.png @@ -132,6 +144,10 @@ The next sections illustrate each layout. \image layouts/qtvirtualkeyboard-layout-ko_KR.png +\section2 Malay Layout + +\image layouts/qtvirtualkeyboard-layout-ms_MY.png + \section2 Norwegian Layout \image layouts/qtvirtualkeyboard-layout-nb_NO.png @@ -176,6 +192,14 @@ The next sections illustrate each layout. \image layouts/qtvirtualkeyboard-layout-zh_TW-cangjie.png +\section2 Slovak Layout + +\image layouts/qtvirtualkeyboard-layout-sk_SK.png + +\section2 Slovenian Layout + +\image layouts/qtvirtualkeyboard-layout-sl_SI.png + \section2 Spanish Layout \image layouts/qtvirtualkeyboard-layout-es_ES.png @@ -184,4 +208,16 @@ The next sections illustrate each layout. \image layouts/qtvirtualkeyboard-layout-sv_SE.png +\section2 Thai Layout + +\image layouts/qtvirtualkeyboard-layout-th_TH.png + +\section2 Turkish Layout + +\image layouts/qtvirtualkeyboard-layout-tr_TR.png + +\section2 Ukrainian Layout + +\image layouts/qtvirtualkeyboard-layout-uk_UA.png + */ diff --git a/src/virtualkeyboard/doc/src/qtvirtualkeyboard-index.qdoc b/src/virtualkeyboard/doc/src/qtvirtualkeyboard-index.qdoc index 9f3a2f0d..d68d8a9f 100644 --- a/src/virtualkeyboard/doc/src/qtvirtualkeyboard-index.qdoc +++ b/src/virtualkeyboard/doc/src/qtvirtualkeyboard-index.qdoc @@ -97,7 +97,7 @@ */ /*! -\qmlmodule QtQuick.VirtualKeyboard 2.3 +\qmlmodule QtQuick.VirtualKeyboard 2.4 \title Qt Virtual Keyboard QML Types \ingroup qmlmodules \brief Provides QML types for an input framework and a reference keyboard front @@ -107,7 +107,7 @@ end. import statements in your .qml file: \code - import QtQuick.VirtualKeyboard 2.3 + import QtQuick.VirtualKeyboard 2.4 import QtQuick.VirtualKeyboard.Styles 2.2 import QtQuick.VirtualKeyboard.Settings 2.2 \endcode diff --git a/src/virtualkeyboard/doc/src/technical-guide.qdoc b/src/virtualkeyboard/doc/src/technical-guide.qdoc index 2165d446..51057b30 100644 --- a/src/virtualkeyboard/doc/src/technical-guide.qdoc +++ b/src/virtualkeyboard/doc/src/technical-guide.qdoc @@ -87,7 +87,20 @@ from the application. This information includes, but is not limited to: The list of supported locales is specified by the existence of a locale specific layout directory in "layouts/*". Each layout directory may contain one -or more layouts, for example fi_FI/main.qml or symbols.qml. +or more layouts, for example fi_FI/main.qml or symbols.qml. If the locale specific +layout is not different from the fallback locale, then a place holder file \c +<layout type>.fallback can be added for the layout. This will specify the virtual +keyboard that a fallback layout can be used instead. + +At minimum the layout directory must contain the files: + +\list + \li \c dialpad.fallback + \li \c digits.fallback + \li \c main.fallback + \li \c numbers.fallback + \li \c symbols.fallback +\endlist The application can specify the initial layout by changing the default locale. However, this needs to be done before the application is initialized and the @@ -97,8 +110,8 @@ current system locale is used. The keyboard locale matching is performed in the following sequence: \list - \li layouts/language_country - \li layouts/language_* + \li layouts/<language>_<country> + \li layouts/<language>_* \li layouts/en_GB \endlist diff --git a/src/virtualkeyboard/doc/src/user-guide.qdoc b/src/virtualkeyboard/doc/src/user-guide.qdoc index b784178b..0a5e8235 100644 --- a/src/virtualkeyboard/doc/src/user-guide.qdoc +++ b/src/virtualkeyboard/doc/src/user-guide.qdoc @@ -65,30 +65,37 @@ The handwriting mode can be activated by pressing the handwriting key: \li Gesture \li Lipi Toolkit \li T9 Write + \li MyScript Text SDK \row \li Backspace \li \image gesture-single-left.png \li \image gesture-single-left.png + \li \image gesture-single-left.png \row \li Space \li \image gesture-single-right.png \li \image gesture-single-right.png + \li \image gesture-single-left.png \row \li Enter \li Gesture not available \li \image gesture-single-down-left.png + \li \image gesture-single-down-left.png \row \li Reset word \li \image gesture-double-left.png \li Gesture not available + \li Gesture not available \row \li Toggle input mode \li \image gesture-single-up.png \li Gesture not available + \li Gesture not available \row \li Toggle text case \li \image gesture-double-up.png \li Gesture not available + \li Gesture not available \endtable */ diff --git a/src/virtualkeyboard/inputcontext.cpp b/src/virtualkeyboard/inputcontext.cpp index dd937966..493f68e6 100644 --- a/src/virtualkeyboard/inputcontext.cpp +++ b/src/virtualkeyboard/inputcontext.cpp @@ -252,6 +252,7 @@ QString InputContext::preeditText() const void InputContext::setPreeditText(const QString &text, QList<QInputMethodEvent::Attribute> attributes, int replaceFrom, int replaceLength) { + Q_D(InputContext); // Add default attributes if (!text.isEmpty()) { if (!testAttribute(attributes, QInputMethodEvent::TextFormat)) { @@ -259,7 +260,7 @@ void InputContext::setPreeditText(const QString &text, QList<QInputMethodEvent:: textFormat.setUnderlineStyle(QTextCharFormat::SingleUnderline); attributes.append(QInputMethodEvent::Attribute(QInputMethodEvent::TextFormat, 0, text.length(), textFormat)); } - } else { + } else if (d->forceCursorPosition != -1) { addSelectionAttribute(attributes); } @@ -442,7 +443,7 @@ void InputContext::sendKeyClick(int key, const QString &text, int modifiers) if (d->focus && d->inputContext) { QKeyEvent pressEvent(QEvent::KeyPress, key, Qt::KeyboardModifiers(modifiers), text); QKeyEvent releaseEvent(QEvent::KeyRelease, key, Qt::KeyboardModifiers(modifiers), text); - VIRTUALKEYBOARD_DEBUG() << "InputContext::::sendKeyClick():" << key; + VIRTUALKEYBOARD_DEBUG() << "InputContext::sendKeyClick():" << key; d->stateFlags |= InputContextPrivate::KeyEventState; d->inputContext->sendKeyEvent(&pressEvent); @@ -450,7 +451,8 @@ void InputContext::sendKeyClick(int key, const QString &text, int modifiers) if (d->activeKeys.isEmpty()) d->stateFlags &= ~InputContextPrivate::KeyEventState; } else { - qWarning() << "InputContext::::sendKeyClick():" << key << "no focus"; + qWarning() << "InputContext::sendKeyClick(): no focus to send key click" << key << text + << "- QGuiApplication::focusWindow() is:" << QGuiApplication::focusWindow(); } } @@ -492,17 +494,20 @@ void InputContext::commit(const QString &text, int replaceFrom, int replaceLengt Q_D(InputContext); VIRTUALKEYBOARD_DEBUG() << "InputContext::commit():" << text << replaceFrom << replaceLength; bool preeditChanged = !d->preeditText.isEmpty(); - d->preeditText.clear(); - d->preeditTextAttributes.clear(); if (d->inputContext) { QList<QInputMethodEvent::Attribute> attributes; addSelectionAttribute(attributes); + d->preeditText.clear(); + d->preeditTextAttributes.clear(); QInputMethodEvent inputEvent(QString(), attributes); inputEvent.setCommitString(text, replaceFrom, replaceLength); d->stateFlags |= InputContextPrivate::InputMethodEventState; d->inputContext->sendEvent(&inputEvent); d->stateFlags &= ~InputContextPrivate::InputMethodEventState; + } else { + d->preeditText.clear(); + d->preeditTextAttributes.clear(); } if (preeditChanged) @@ -831,6 +836,9 @@ void InputContext::invokeAction(QInputMethod::Action action, int cursorPosition) switch (action) { case QInputMethod::Click: if ((int)d->stateFlags == 0) { + if (d->inputEngine->clickPreeditText(cursorPosition)) + break; + bool reselect = !d->inputMethodHints.testFlag(Qt::ImhNoPredictiveText) && d->selectedText.isEmpty() && cursorPosition < d->preeditText.length(); if (reselect) { d->stateFlags |= InputContextPrivate::ReselectEventState; @@ -893,11 +901,23 @@ bool InputContext::filterEvent(const QEvent *event) void InputContext::addSelectionAttribute(QList<QInputMethodEvent::Attribute> &attributes) { Q_D(InputContext); - if (!testAttribute(attributes, QInputMethodEvent::Selection) && d->forceCursorPosition != -1) { - if (d->forceAnchorPosition != -1) - attributes.append(QInputMethodEvent::Attribute(QInputMethodEvent::Selection, d->forceAnchorPosition, d->forceCursorPosition - d->forceAnchorPosition, QVariant())); - else - attributes.append(QInputMethodEvent::Attribute(QInputMethodEvent::Selection, d->forceCursorPosition, 0, QVariant())); + if (!testAttribute(attributes, QInputMethodEvent::Selection)) { + // Convert Cursor attribute to Selection attribute. + // In this case the cursor is set in pre-edit text, but + // the cursor is not being forced to specific location. + if (d->forceCursorPosition == -1) { + int cursorAttributeIndex = findAttribute(d->preeditTextAttributes, QInputMethodEvent::Cursor); + if (cursorAttributeIndex != -1 && d->preeditTextAttributes[cursorAttributeIndex].length > 0) + d->forceCursorPosition = d->cursorPosition + d->preeditTextAttributes[cursorAttributeIndex].start; + d->forceAnchorPosition = -1; + } + + if (d->forceCursorPosition != -1) { + if (d->forceAnchorPosition != -1) + attributes.append(QInputMethodEvent::Attribute(QInputMethodEvent::Selection, d->forceAnchorPosition, d->forceCursorPosition - d->forceAnchorPosition, QVariant())); + else + attributes.append(QInputMethodEvent::Attribute(QInputMethodEvent::Selection, d->forceCursorPosition, 0, QVariant())); + } } d->forceAnchorPosition = -1; d->forceCursorPosition = -1; @@ -912,6 +932,16 @@ bool InputContext::testAttribute(const QList<QInputMethodEvent::Attribute> &attr return false; } +int InputContext::findAttribute(const QList<QInputMethodEvent::Attribute> &attributes, QInputMethodEvent::AttributeType attributeType) const +{ + const int count = attributes.count(); + for (int i = 0; i < count; ++i) { + if (attributes.at(i).type == attributeType) + return i; + } + return -1; +} + /*! \qmlproperty bool InputContext::focus diff --git a/src/virtualkeyboard/inputcontext.h b/src/virtualkeyboard/inputcontext.h index 839c8f10..fc2010e0 100644 --- a/src/virtualkeyboard/inputcontext.h +++ b/src/virtualkeyboard/inputcontext.h @@ -170,6 +170,7 @@ private: bool filterEvent(const QEvent *event); void addSelectionAttribute(QList<QInputMethodEvent::Attribute> &attributes); bool testAttribute(const QList<QInputMethodEvent::Attribute> &attributes, QInputMethodEvent::AttributeType attributeType) const; + int findAttribute(const QList<QInputMethodEvent::Attribute> &attributes, QInputMethodEvent::AttributeType attributeType) const; private: friend class PlatformInputContext; diff --git a/src/virtualkeyboard/inputengine.cpp b/src/virtualkeyboard/inputengine.cpp index 5994362e..84b1cf09 100644 --- a/src/virtualkeyboard/inputengine.cpp +++ b/src/virtualkeyboard/inputengine.cpp @@ -568,6 +568,18 @@ bool InputEngine::reselect(int cursorPosition, const ReselectFlags &reselectFlag /*! \internal + This method is called when the current preedit text is clicked. +*/ +bool InputEngine::clickPreeditText(int cursorPosition) +{ + Q_D(InputEngine); + if (!d->inputMethod) + return false; + return d->inputMethod->clickPreeditText(cursorPosition); +} + +/*! + \internal Resets the input method. */ void InputEngine::reset() diff --git a/src/virtualkeyboard/inputengine.h b/src/virtualkeyboard/inputengine.h index 5880e844..80e13424 100644 --- a/src/virtualkeyboard/inputengine.h +++ b/src/virtualkeyboard/inputengine.h @@ -128,6 +128,7 @@ public: Q_INVOKABLE bool traceEnd(Trace *trace); Q_INVOKABLE bool reselect(int cursorPosition, const ReselectFlags &reselectFlags); + bool clickPreeditText(int cursorPosition); Q_SIGNALS: void virtualKeyClicked(Qt::Key key, const QString &text, Qt::KeyboardModifiers modifiers, bool isAutoRepeat); diff --git a/src/virtualkeyboard/inputmethod.cpp b/src/virtualkeyboard/inputmethod.cpp index af99972d..7ee4317e 100644 --- a/src/virtualkeyboard/inputmethod.cpp +++ b/src/virtualkeyboard/inputmethod.cpp @@ -229,6 +229,16 @@ namespace QtVirtualKeyboard { */ /*! + \qmlmethod bool InputMethod::clickPreeditText(int cursorPosition) + \since QtQuick.VirtualKeyboard 2.4 + + Called when the user clicks on pre-edit text at \a cursorPosition. + + The function should return \c true if it handles the event. Otherwise the input + falls back to \l reselect() for further processing. +*/ + +/*! \class QtVirtualKeyboard::InputMethod \internal */ @@ -376,6 +386,15 @@ bool InputMethod::reselect(int cursorPosition, const InputEngine::ReselectFlags return result.toBool(); } +bool InputMethod::clickPreeditText(int cursorPosition) +{ + QVariant result; + QMetaObject::invokeMethod(this, "clickPreeditText", + Q_RETURN_ARG(QVariant, result), + Q_ARG(int, cursorPosition)); + return result.toBool(); +} + void InputMethod::reset() { QMetaObject::invokeMethod(this, "reset"); diff --git a/src/virtualkeyboard/inputmethod_p.h b/src/virtualkeyboard/inputmethod_p.h index 09591d62..e480a82a 100644 --- a/src/virtualkeyboard/inputmethod_p.h +++ b/src/virtualkeyboard/inputmethod_p.h @@ -73,6 +73,7 @@ public: bool traceEnd(Trace *trace); bool reselect(int cursorPosition, const InputEngine::ReselectFlags &reselectFlags); + bool clickPreeditText(int cursorPosition); void reset(); void update(); diff --git a/src/virtualkeyboard/selectionlistmodel.cpp b/src/virtualkeyboard/selectionlistmodel.cpp index 1f8f9db9..33ec8de9 100644 --- a/src/virtualkeyboard/selectionlistmodel.cpp +++ b/src/virtualkeyboard/selectionlistmodel.cpp @@ -118,6 +118,22 @@ public: the completion part expressed as the number of characters counted from the end of the string. + \value DictionaryTypeRole + An integer specifying \ l {QtVirtualKeyboard::SelectionListModel::DictionaryType}{dictionary type}. + \value CanRemoveSuggestionRole + A boolean value indicating if the word candidate + can be removed from dictionary. +*/ + +/*! + \enum QtVirtualKeyboard::SelectionListModel::DictionaryType + + This enum specifies the dictionary type of a word. + + \value DefaultDictionary + The word candidate is from the default dictionary. + \value UserDictionary + The word candidate is from the user dictionary. */ SelectionListModel::SelectionListModel(QObject *parent) : @@ -226,6 +242,14 @@ void SelectionListModel::selectItem(int index) } } +void SelectionListModel::removeItem(int index) +{ + Q_D(SelectionListModel); + if (index >= 0 && index < d->rowCount && d->dataSource) { + d->dataSource->selectionListRemoveItem(d->type, index); + } +} + /*! * \internal */ diff --git a/src/virtualkeyboard/selectionlistmodel.h b/src/virtualkeyboard/selectionlistmodel.h index ec9b84e3..22d0ed3d 100644 --- a/src/virtualkeyboard/selectionlistmodel.h +++ b/src/virtualkeyboard/selectionlistmodel.h @@ -56,11 +56,19 @@ public: enum Role { DisplayRole = Qt::DisplayRole, - WordCompletionLengthRole = Qt::UserRole + 1 + WordCompletionLengthRole = Qt::UserRole + 1, + DictionaryTypeRole, + CanRemoveSuggestionRole, + }; + enum DictionaryType + { + DefaultDictionary = 0, + UserDictionary }; Q_ENUM(Type) Q_ENUM(Role) + Q_ENUM(DictionaryType) ~SelectionListModel(); void setDataSource(AbstractInputMethod *dataSource, Type type); @@ -72,6 +80,7 @@ public: int count() const; Q_INVOKABLE void selectItem(int index); + Q_INVOKABLE void removeItem(int index); Q_INVOKABLE QVariant dataAt(int index, int role = Qt::DisplayRole) const; Q_SIGNALS: @@ -92,5 +101,6 @@ QT_END_NAMESPACE Q_DECLARE_METATYPE(QT_PREPEND_NAMESPACE(QtVirtualKeyboard)::SelectionListModel::Type) Q_DECLARE_METATYPE(QT_PREPEND_NAMESPACE(QtVirtualKeyboard)::SelectionListModel::Role) +Q_DECLARE_METATYPE(QT_PREPEND_NAMESPACE(QtVirtualKeyboard)::SelectionListModel::DictionaryType) #endif // SELECTIONLISTMODEL_H diff --git a/src/virtualkeyboard/shifthandler.cpp b/src/virtualkeyboard/shifthandler.cpp index e5cc101d..3b867b0d 100644 --- a/src/virtualkeyboard/shifthandler.cpp +++ b/src/virtualkeyboard/shifthandler.cpp @@ -50,7 +50,7 @@ public: toggleShiftEnabled(false), shiftChanged(false), resetWhenVisible(false), - manualShiftLanguageFilter(QSet<QLocale::Language>() << QLocale::Arabic << QLocale::Persian << QLocale::Hindi << QLocale::Korean), + manualShiftLanguageFilter(QSet<QLocale::Language>() << QLocale::Arabic << QLocale::Persian << QLocale::Hindi << QLocale::Korean << QLocale::Thai), manualCapsInputModeFilter(QSet<InputEngine::InputMode>() << InputEngine::Cangjie << InputEngine::Zhuyin << InputEngine::Hebrew), noAutoUppercaseInputModeFilter(QSet<InputEngine::InputMode>() << InputEngine::FullwidthLatin << InputEngine::Pinyin << InputEngine::Cangjie << InputEngine::Zhuyin << InputEngine::ChineseHandwriting << InputEngine::JapaneseHandwriting << InputEngine::KoreanHandwriting), allCapsInputModeFilter(QSet<InputEngine::InputMode>() << InputEngine::Hiragana << InputEngine::Katakana) diff --git a/src/virtualkeyboard/trace.cpp b/src/virtualkeyboard/trace.cpp index 59d47b99..80b55e25 100644 --- a/src/virtualkeyboard/trace.cpp +++ b/src/virtualkeyboard/trace.cpp @@ -40,7 +40,8 @@ public: QObjectPrivate(), traceId(0), final(false), - canceled(false) + canceled(false), + opacity(1.0) { } int traceId; @@ -48,6 +49,7 @@ public: QMap<QString, QVariantList> channels; bool final; bool canceled; + qreal opacity; }; /*! @@ -368,6 +370,21 @@ void Trace::setCanceled(bool canceled) } } +qreal Trace::opacity() const +{ + Q_D(const Trace); + return d->opacity; +} + +void Trace::setOpacity(qreal opacity) +{ + Q_D(Trace); + if (d->opacity != opacity) { + d->opacity = opacity; + emit opacityChanged(opacity); + } +} + /*! \qmlproperty int Trace::traceId Unique id of this Trace. @@ -425,5 +442,28 @@ void Trace::setCanceled(bool canceled) whose isCanceled property set to true. */ +/*! \qmlproperty qreal Trace::opacity + \since QtQuick.VirtualKeyboard 2.4 + + This property defines how opaque the Trace is. + + A lower value results in a more transparent trace: \c 0.0 is fully + transparent, and \c 1.0 is fully opaque. + + This property is useful for making older traces more transparent as new + ones are added. +*/ + +/*! \property QtVirtualKeyboard::Trace::opacity + + This property defines how opaque the Trace is. + + A lower value results in a more transparent trace: \c 0.0 is fully + transparent, and \c 1.0 is fully opaque. + + This property is useful for making older traces more transparent as new + ones are added. +*/ + } // namespace QtVirtualKeyboard QT_END_NAMESPACE diff --git a/src/virtualkeyboard/trace.h b/src/virtualkeyboard/trace.h index 585cc073..26491f17 100644 --- a/src/virtualkeyboard/trace.h +++ b/src/virtualkeyboard/trace.h @@ -49,6 +49,7 @@ class QVIRTUALKEYBOARD_EXPORT Trace : public QObject Q_PROPERTY(int length READ length NOTIFY lengthChanged) Q_PROPERTY(bool isFinal READ isFinal WRITE setFinal NOTIFY finalChanged) Q_PROPERTY(bool isCanceled READ isCanceled WRITE setCanceled NOTIFY canceledChanged) + Q_PROPERTY(qreal opacity READ opacity WRITE setOpacity NOTIFY opacityChanged) public: explicit Trace(QObject *parent = nullptr); ~Trace(); @@ -73,12 +74,16 @@ public: bool isCanceled() const; void setCanceled(bool canceled); + qreal opacity() const; + void setOpacity(qreal opacity); + Q_SIGNALS: void traceIdChanged(int traceId); void channelsChanged(); void lengthChanged(int length); void finalChanged(bool isFinal); void canceledChanged(bool isCanceled); + void opacityChanged(qreal opacity); }; } // namespace QtVirtualKeyboard diff --git a/src/virtualkeyboard/virtualkeyboard.pro b/src/virtualkeyboard/virtualkeyboard.pro index 91497ee2..48fb5082 100644 --- a/src/virtualkeyboard/virtualkeyboard.pro +++ b/src/virtualkeyboard/virtualkeyboard.pro @@ -72,16 +72,30 @@ RESOURCES += \ # Fallback for languages which don't have these special layouts LAYOUT_FILES += \ - content/layouts/en_GB/dialpad.qml \ - content/layouts/en_GB/digits.qml \ - content/layouts/en_GB/numbers.qml -contains(CONFIG, lang-en.*) { + content/layouts/fallback/dialpad.qml \ + content/layouts/fallback/digits.qml \ + content/layouts/fallback/numbers.qml \ + content/layouts/fallback/main.qml \ + content/layouts/fallback/symbols.qml +contains(CONFIG, lang-en(_GB)?) { LAYOUT_FILES += \ - content/layouts/en_GB/main.qml \ - content/layouts/en_GB/symbols.qml + content/layouts/en_GB/dialpad.fallback \ + content/layouts/en_GB/digits.fallback \ + content/layouts/en_GB/main.fallback \ + content/layouts/en_GB/numbers.fallback \ + content/layouts/en_GB/symbols.fallback +} +contains(CONFIG, lang-en(_US)?) { + LAYOUT_FILES += \ + content/layouts/en_US/dialpad.fallback \ + content/layouts/en_US/digits.fallback \ + content/layouts/en_US/main.fallback \ + content/layouts/en_US/numbers.fallback \ + content/layouts/en_US/symbols.fallback } contains(CONFIG, lang-ar.*) { LAYOUT_FILES += \ + content/layouts/ar_AR/dialpad.fallback \ content/layouts/ar_AR/digits.qml \ content/layouts/ar_AR/main.qml \ content/layouts/ar_AR/numbers.qml \ @@ -89,41 +103,71 @@ contains(CONFIG, lang-ar.*) { } contains(CONFIG, lang-bg.*) { LAYOUT_FILES += \ + content/layouts/bg_BG/dialpad.fallback \ + content/layouts/bg_BG/digits.fallback \ content/layouts/bg_BG/main.qml \ - content/layouts/bg_BG/symbols.qml + content/layouts/bg_BG/numbers.fallback \ + content/layouts/bg_BG/symbols.fallback } contains(CONFIG, lang-cs.*) { LAYOUT_FILES += \ + content/layouts/cs_CZ/dialpad.fallback \ + content/layouts/cs_CZ/digits.fallback \ content/layouts/cs_CZ/main.qml \ - content/layouts/cs_CZ/symbols.qml + content/layouts/cs_CZ/numbers.fallback \ + content/layouts/cs_CZ/symbols.fallback } contains(CONFIG, lang-da.*) { LAYOUT_FILES += \ + content/layouts/da_DK/dialpad.fallback \ + content/layouts/da_DK/digits.fallback \ content/layouts/da_DK/main.qml \ - content/layouts/da_DK/symbols.qml + content/layouts/da_DK/numbers.fallback \ + content/layouts/da_DK/symbols.fallback } contains(CONFIG, lang-de.*) { LAYOUT_FILES += \ + content/layouts/de_DE/dialpad.fallback \ + content/layouts/de_DE/digits.fallback \ content/layouts/de_DE/main.qml \ - content/layouts/de_DE/symbols.qml + content/layouts/de_DE/numbers.fallback \ + content/layouts/de_DE/symbols.fallback } contains(CONFIG, lang-el.*) { LAYOUT_FILES += \ + content/layouts/el_GR/dialpad.fallback \ + content/layouts/el_GR/digits.fallback \ content/layouts/el_GR/main.qml \ - content/layouts/el_GR/symbols.qml + content/layouts/el_GR/numbers.fallback \ + content/layouts/el_GR/symbols.fallback } -contains(CONFIG, lang-es.*) { +contains(CONFIG, lang-es(_ES)?) { LAYOUT_FILES += \ + content/layouts/es_ES/dialpad.fallback \ + content/layouts/es_ES/digits.fallback \ content/layouts/es_ES/main.qml \ + content/layouts/es_ES/numbers.fallback \ content/layouts/es_ES/symbols.qml } +contains(CONFIG, lang-es(_MX)?) { + LAYOUT_FILES += \ + content/layouts/es_MX/dialpad.fallback \ + content/layouts/es_MX/digits.fallback \ + content/layouts/es_MX/main.qml \ + content/layouts/es_MX/numbers.fallback \ + content/layouts/es_MX/symbols.qml +} contains(CONFIG, lang-et.*) { LAYOUT_FILES += \ + content/layouts/et_EE/dialpad.fallback \ + content/layouts/et_EE/digits.fallback \ content/layouts/et_EE/main.qml \ - content/layouts/et_EE/symbols.qml + content/layouts/et_EE/numbers.fallback \ + content/layouts/et_EE/symbols.fallback } contains(CONFIG, lang-fa.*) { LAYOUT_FILES += \ + content/layouts/fa_FA/dialpad.fallback \ content/layouts/fa_FA/digits.qml \ content/layouts/fa_FA/main.qml \ content/layouts/fa_FA/numbers.qml \ @@ -131,82 +175,202 @@ contains(CONFIG, lang-fa.*) { } contains(CONFIG, lang-fi.*) { LAYOUT_FILES += \ + content/layouts/fi_FI/dialpad.fallback \ + content/layouts/fi_FI/digits.fallback \ content/layouts/fi_FI/main.qml \ - content/layouts/fi_FI/symbols.qml + content/layouts/fi_FI/numbers.fallback \ + content/layouts/fi_FI/symbols.fallback +} +contains(CONFIG, lang-fr(_CA)?) { + LAYOUT_FILES += \ + content/layouts/fr_CA/dialpad.fallback \ + content/layouts/fr_CA/digits.fallback \ + content/layouts/fr_CA/main.qml \ + content/layouts/fr_CA/numbers.fallback \ + content/layouts/fr_CA/symbols.fallback } -contains(CONFIG, lang-fr.*) { +contains(CONFIG, lang-fr(_FR)?) { LAYOUT_FILES += \ + content/layouts/fr_FR/dialpad.fallback \ + content/layouts/fr_FR/digits.fallback \ content/layouts/fr_FR/main.qml \ - content/layouts/fr_FR/symbols.qml + content/layouts/fr_FR/numbers.fallback \ + content/layouts/fr_FR/symbols.fallback } contains(CONFIG, lang-he.*) { LAYOUT_FILES += \ + content/layouts/he_IL/dialpad.fallback \ + content/layouts/he_IL/digits.fallback \ content/layouts/he_IL/main.qml \ + content/layouts/he_IL/numbers.fallback \ content/layouts/he_IL/symbols.qml } contains(CONFIG, lang-hi.*) { LAYOUT_FILES += \ + content/layouts/hi_IN/dialpad.fallback \ + content/layouts/hi_IN/digits.fallback \ content/layouts/hi_IN/main.qml \ + content/layouts/hi_IN/numbers.fallback \ content/layouts/hi_IN/symbols.qml } contains(CONFIG, lang-hr.*) { LAYOUT_FILES += \ + content/layouts/hr_HR/dialpad.fallback \ + content/layouts/hr_HR/digits.fallback \ content/layouts/hr_HR/main.qml \ - content/layouts/hr_HR/symbols.qml + content/layouts/hr_HR/numbers.fallback \ + content/layouts/hr_HR/symbols.fallback } contains(CONFIG, lang-hu.*) { LAYOUT_FILES += \ + content/layouts/hu_HU/dialpad.fallback \ + content/layouts/hu_HU/digits.fallback \ content/layouts/hu_HU/main.qml \ - content/layouts/hu_HU/symbols.qml + content/layouts/hu_HU/numbers.fallback \ + content/layouts/hu_HU/symbols.fallback +} +contains(CONFIG, lang-id.*) { + LAYOUT_FILES += \ + content/layouts/id_ID/dialpad.fallback \ + content/layouts/id_ID/digits.fallback \ + content/layouts/id_ID/main.fallback \ + content/layouts/id_ID/numbers.fallback \ + content/layouts/id_ID/symbols.fallback } contains(CONFIG, lang-it.*) { LAYOUT_FILES += \ + content/layouts/it_IT/dialpad.fallback \ + content/layouts/it_IT/digits.fallback \ content/layouts/it_IT/main.qml \ - content/layouts/it_IT/symbols.qml + content/layouts/it_IT/numbers.fallback \ + content/layouts/it_IT/symbols.fallback } contains(CONFIG, lang-nb.*) { LAYOUT_FILES += \ + content/layouts/nb_NO/dialpad.fallback \ + content/layouts/nb_NO/digits.fallback \ content/layouts/nb_NO/main.qml \ - content/layouts/nb_NO/symbols.qml + content/layouts/nb_NO/numbers.fallback \ + content/layouts/nb_NO/symbols.fallback +} +contains(CONFIG, lang-ms.*) { + LAYOUT_FILES += \ + content/layouts/ms_MY/dialpad.fallback \ + content/layouts/ms_MY/digits.fallback \ + content/layouts/ms_MY/main.fallback \ + content/layouts/ms_MY/numbers.fallback \ + content/layouts/ms_MY/symbols.fallback } contains(CONFIG, lang-nl.*) { LAYOUT_FILES += \ - content/layouts/nl_NL/main.qml \ - content/layouts/nl_NL/symbols.qml + content/layouts/nl_NL/dialpad.fallback \ + content/layouts/nl_NL/digits.fallback \ + content/layouts/nl_NL/main.fallback \ + content/layouts/nl_NL/numbers.fallback \ + content/layouts/nl_NL/symbols.fallback } contains(CONFIG, lang-pl.*) { LAYOUT_FILES += \ + content/layouts/pl_PL/dialpad.fallback \ + content/layouts/pl_PL/digits.fallback \ content/layouts/pl_PL/main.qml \ - content/layouts/pl_PL/symbols.qml + content/layouts/pl_PL/numbers.fallback \ + content/layouts/pl_PL/symbols.fallback +} +contains(CONFIG, lang-pt(_BR)?) { + LAYOUT_FILES += \ + content/layouts/pt_BR/dialpad.fallback \ + content/layouts/pt_BR/digits.fallback \ + content/layouts/pt_BR/main.qml \ + content/layouts/pt_BR/numbers.fallback \ + content/layouts/pt_BR/symbols.fallback } -contains(CONFIG, lang-pt.*) { +contains(CONFIG, lang-pt(_PT)?) { LAYOUT_FILES += \ + content/layouts/pt_PT/dialpad.fallback \ + content/layouts/pt_PT/digits.fallback \ content/layouts/pt_PT/main.qml \ - content/layouts/pt_PT/symbols.qml + content/layouts/pt_PT/numbers.fallback \ + content/layouts/pt_PT/symbols.fallback } contains(CONFIG, lang-ro.*) { LAYOUT_FILES += \ + content/layouts/ro_RO/dialpad.fallback \ + content/layouts/ro_RO/digits.fallback \ content/layouts/ro_RO/main.qml \ - content/layouts/ro_RO/symbols.qml + content/layouts/ro_RO/numbers.fallback \ + content/layouts/ro_RO/symbols.fallback } contains(CONFIG, lang-ru.*) { LAYOUT_FILES += \ + content/layouts/ru_RU/dialpad.fallback \ + content/layouts/ru_RU/digits.fallback \ content/layouts/ru_RU/main.qml \ - content/layouts/ru_RU/symbols.qml + content/layouts/ru_RU/numbers.fallback \ + content/layouts/ru_RU/symbols.fallback +} +contains(CONFIG, lang-sk.*) { + LAYOUT_FILES += \ + content/layouts/sk_SK/dialpad.fallback \ + content/layouts/sk_SK/digits.fallback \ + content/layouts/sk_SK/main.qml \ + content/layouts/sk_SK/numbers.fallback \ + content/layouts/sk_SK/symbols.fallback +} +contains(CONFIG, lang-sl.*) { + LAYOUT_FILES += \ + content/layouts/sl_SI/dialpad.fallback \ + content/layouts/sl_SI/digits.fallback \ + content/layouts/sl_SI/main.qml \ + content/layouts/sl_SI/numbers.fallback \ + content/layouts/sl_SI/symbols.fallback +} +contains(CONFIG, lang-sq.*) { + LAYOUT_FILES += \ + content/layouts/sq_AL/dialpad.fallback \ + content/layouts/sq_AL/digits.fallback \ + content/layouts/sq_AL/main.qml \ + content/layouts/sq_AL/numbers.fallback \ + content/layouts/sq_AL/symbols.fallback } contains(CONFIG, lang-sr.*) { LAYOUT_FILES += \ + content/layouts/sr_SP/dialpad.fallback \ + content/layouts/sr_SP/digits.fallback \ content/layouts/sr_SP/main.qml \ - content/layouts/sr_SP/symbols.qml + content/layouts/sr_SP/numbers.fallback \ + content/layouts/sr_SP/symbols.fallback } contains(CONFIG, lang-sv.*) { LAYOUT_FILES += \ + content/layouts/sv_SE/dialpad.fallback \ + content/layouts/sv_SE/digits.fallback \ content/layouts/sv_SE/main.qml \ - content/layouts/sv_SE/symbols.qml + content/layouts/sv_SE/numbers.fallback \ + content/layouts/sv_SE/symbols.fallback +} +contains(CONFIG, lang-tr.*) { + LAYOUT_FILES += \ + content/layouts/tr_TR/dialpad.fallback \ + content/layouts/tr_TR/digits.fallback \ + content/layouts/tr_TR/main.qml \ + content/layouts/tr_TR/numbers.fallback \ + content/layouts/tr_TR/symbols.fallback +} +contains(CONFIG, lang-uk.*) { + LAYOUT_FILES += \ + content/layouts/uk_UA/dialpad.fallback \ + content/layouts/uk_UA/digits.fallback \ + content/layouts/uk_UA/main.qml \ + content/layouts/uk_UA/numbers.fallback \ + content/layouts/uk_UA/symbols.fallback } contains(CONFIG, lang-vi.*) { LAYOUT_FILES += \ + content/layouts/vi_VN/dialpad.fallback \ + content/layouts/vi_VN/digits.fallback \ content/layouts/vi_VN/main.qml \ + content/layouts/vi_VN/numbers.fallback \ content/layouts/vi_VN/symbols.qml } @@ -225,7 +389,8 @@ OTHER_FILES += \ content/styles/retro/*.qml \ content/*.qml \ content/components/*.qml \ - qtvirtualkeyboard.json + qtvirtualkeyboard.json \ + $$LAYOUT_FILES !disable-desktop:isEmpty(CROSS_COMPILE):!android-embedded:!qnx { SOURCES += desktopinputpanel.cpp inputview.cpp diff --git a/tests/auto/inputpanel/data/inputpanel/handwritinginputpanel.qml b/tests/auto/inputpanel/data/inputpanel/handwritinginputpanel.qml index 692116d0..aa7ae714 100644 --- a/tests/auto/inputpanel/data/inputpanel/handwritinginputpanel.qml +++ b/tests/auto/inputpanel/data/inputpanel/handwritinginputpanel.qml @@ -38,6 +38,7 @@ HandwritingInputPanel { z: 99 property var testcase + readonly property var inputMethod: InputContext.inputEngine.inputMethod readonly property var wordCandidatePopupList: Utils.findChildByProperty(handwritingInputPanel, "objectName", "wordCandidatePopupList", null) anchors.fill: parent @@ -129,7 +130,15 @@ HandwritingInputPanel { console.warn("Cannot produce the symbol '%1' in full screen handwriting mode".arg(ch)) return false } + if (isSuperimposedHandwriting()) + return true; inputMethodResultSpy.wait(3000) return inputMethodResultSpy.count > 0 } + + function isSuperimposedHandwriting() { + if (!available) + return false + return inputMethod != null && inputMethod.hasOwnProperty("superimposed") && inputMethod.superimposed; + } } diff --git a/tests/auto/inputpanel/data/inputpanel/inputpanel.qml b/tests/auto/inputpanel/data/inputpanel/inputpanel.qml index 6a5ae429..c3682b8a 100644 --- a/tests/auto/inputpanel/data/inputpanel/inputpanel.qml +++ b/tests/auto/inputpanel/data/inputpanel/inputpanel.qml @@ -67,6 +67,7 @@ InputPanel { naviationHighlight.widthAnimation.running || naviationHighlight.heightAnimation.running readonly property var wordCandidateView: Utils.findChildByProperty(keyboard, "objectName", "wordCandidateView", null) + readonly property var wordCandidateContextMenu: Utils.findChildByProperty(keyboard, "objectName", "wordCandidateContextMenu", null) readonly property var shadowInputControl: Utils.findChildByProperty(keyboard, "objectName", "shadowInputControl", null) readonly property var shadowInput: Utils.findChildByProperty(keyboard, "objectName", "shadowInput", null) readonly property var selectionControl: Utils.findChildByProperty(inputPanel, "objectName", "selectionControl", null) @@ -178,6 +179,12 @@ InputPanel { } SignalSpy { + id: wordCandidateContextMenuActiveSpy + target: wordCandidateContextMenu + signalName: "onActiveChanged" + } + + SignalSpy { id: shiftStateSpy target: InputContext signalName: "onShiftChanged" @@ -376,12 +383,15 @@ InputPanel { } } else if (typeof key != "number" || key !== Qt.Key_Shift) { // Some layouts (such as Arabic, Hindi) may have a second layout - virtualKeyPress(Qt.Key_Shift) + virtualKeyClick(Qt.Key_Shift) InputContext.shiftHandler.clearToggleShiftTimer() testcase.waitForRendering(inputPanel) success = keyActionOnCurrentLayoutCb(key) - virtualKeyPress(Qt.Key_Shift) - InputContext.shiftHandler.clearToggleShiftTimer() + if (!success) { + virtualKeyClick(Qt.Key_Shift) + InputContext.shiftHandler.clearToggleShiftTimer() + testcase.waitForRendering(inputPanel) + } } if (success) break @@ -527,6 +537,14 @@ InputPanel { InputContext.shiftHandler.toggleShift() } + function setShift(shift) { + InputContext.shift = shift + } + + function setCapsLock(capsLock) { + InputContext.capsLock = capsLock + } + function style() { return VirtualKeyboardSettings.styleName } @@ -580,6 +598,48 @@ InputPanel { return true } + function selectionListCurrentIndex() { + return inputPanel.wordCandidateView.currentIndex + } + + function selectionListSuggestionIsFromUserDictionary() { + if (!inputPanel.wordCandidateView.currentItem) + return false + var dictionaryType = inputPanel.wordCandidateView.model.dataAt(inputPanel.wordCandidateView.currentIndex, SelectionListModel.DictionaryTypeRole) + return dictionaryType !== undefined && dictionaryType === SelectionListModel.UserDictionary + } + + function openWordCandidateContextMenu() { + if (!inputPanel.wordCandidateView.currentItem) + return false + testcase.wait(200) + wordCandidateContextMenuActiveSpy.clear() + testcase.mousePress(inputPanel.wordCandidateView.currentItem) + wordCandidateContextMenuActiveSpy.wait() + testcase.mouseRelease(inputPanel.wordCandidateView.currentItem) + return wordCandidateContextMenu.active + } + + function selectItemFromWordCandidateContextMenu(index) { + if (!inputPanel.wordCandidateView.currentItem) + return false + if (!wordCandidateContextMenu.active) + return false + var wordCandidateContextMenuList = Utils.findChildByProperty(keyboard, "objectName", "wordCandidateContextMenuList", null) + if (wordCandidateContextMenuList.currentIndex !== index) { + wordCandidateContextMenuList.currentIndex = index + testcase.waitForRendering(inputPanel) + } + if (!wordCandidateContextMenuList.currentItem) + return false + var itemPos = inputPanel.mapFromItem(wordCandidateContextMenuList.currentItem, + wordCandidateContextMenuList.currentItem.width / 2, + wordCandidateContextMenuList.currentItem.height / 2) + testcase.mouseClick(inputPanel, itemPos.x, itemPos.y, Qt.LeftButton, 0, 20) + testcase.waitForRendering(inputPanel) + return true + } + function setHandwritingMode(enabled) { if (inputPanel.keyboard.handwritingMode !== enabled) { if (!enabled || inputPanel.keyboard.isHandwritingAvailable()) @@ -600,7 +660,15 @@ InputPanel { console.warn("Cannot produce the symbol '%1' in handwriting mode".arg(ch)) return false } + if (isSuperimposedHandwriting()) + return true inputMethodResultSpy.wait(3000) return inputMethodResultSpy.count > 0 } + + function isSuperimposedHandwriting() { + if (!inputPanel.keyboard.handwritingMode) + return false + return inputMethod != null && inputMethod.hasOwnProperty("superimposed") && inputMethod.superimposed + } } diff --git a/tests/auto/inputpanel/data/inputpanel/unipen_data_korean.js b/tests/auto/inputpanel/data/inputpanel/unipen_data_korean.js index 1b487c49..db30adda 100644 --- a/tests/auto/inputpanel/data/inputpanel/unipen_data_korean.js +++ b/tests/auto/inputpanel/data/inputpanel/unipen_data_korean.js @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2017 The Qt Company Ltd. +** Copyright (C) 2018 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Virtual Keyboard module of the Qt Toolkit. @@ -38,528 +38,528 @@ var unipenData = { ".PEN": [ [ [ - 379, + 344, 53, 0 ], [ - 380, + 345, 53, 155 ], [ - 382, + 347, 53, 177 ], [ - 385, + 350, 53, 179 ], [ - 391, + 356, 53, 243 ], [ - 400, + 365, 53, 244 ], [ - 421, + 386, 55, 311 ], [ - 437, + 402, 55, 313 ], [ - 441, + 406, 55, 315 ], [ - 448, + 413, 55, 365 ], [ - 454, + 419, 55, 366 ], [ - 461, + 426, 55, 370 ], [ - 467, + 432, 54, 426 ], [ - 472, + 437, 54, 427 ], [ - 475, + 440, 54, 486 ], [ - 477, + 442, 54, 487 ], [ - 478, + 443, 54, 490 ], [ - 479, + 444, 54, 548 ], [ - 480, + 445, 54, 549 ], [ - 482, + 447, 54, 610 ], [ - 485, + 450, 54, 610 ], [ - 488, + 453, 54, 670 ], [ - 489, + 454, 54, 731 ], [ - 489, + 454, 55, 939 ], [ - 489, + 454, 56, 1003 ], [ - 489, + 454, 60, 1004 ], [ - 489, + 454, 64, 1064 ], [ - 489, + 454, 66, 1065 ], [ - 489, + 454, 72, 1124 ], [ - 489, + 454, 75, 1125 ], [ - 489, + 454, 79, 1131 ], [ - 489, + 454, 81, 1184 ], [ - 489, + 454, 86, 1185 ], [ - 489, + 454, 91, 1245 ], [ - 489, + 454, 92, 1246 ], [ - 489, + 454, 97, 1306 ], [ - 489, + 454, 99, 1307 ], [ - 489, + 454, 101, 1366 ], [ - 489, + 454, 102, 1367 ], [ - 489, + 454, 103, 1427 ], [ - 489, + 454, 105, 1429 ], [ - 489, + 454, 106, 1500 ], [ - 489, + 454, 107, 1549 ], [ - 489, + 454, 108, 1550 ], [ - 489, + 454, 109, 1614 ] ], [ [ - 383, + 348, 113, 2999 ], [ - 384, + 349, 113, 3259 ], [ - 385, + 350, 112, 3291 ], [ - 386, + 351, 112, 3360 ], [ - 399, + 364, 112, 3361 ], [ - 412, + 377, 112, 3389 ], [ - 434, + 399, 112, 3449 ], [ - 440, + 405, 112, 3450 ], [ - 451, + 416, 112, 3451 ], [ - 455, + 420, 112, 3510 ], [ - 479, + 444, 111, 3511 ], [ - 493, + 458, 110, 3574 ], [ - 506, + 471, 109, 3576 ], [ - 513, + 478, 109, 3632 ], [ - 515, + 480, 109, 3633 ], [ - 516, + 481, 109, 3636 ] ], [ [ - 430, + 395, 115, 5767 ], [ - 430, + 395, 116, 5851 ], [ - 432, + 397, 120, 5884 ], [ - 433, + 398, 123, 5937 ], [ - 433, + 398, 127, 5938 ], [ - 434, + 399, 130, 6000 ], [ - 434, + 399, 133, 6002 ], [ - 435, + 400, 139, 6058 ], [ - 435, + 400, 141, 6059 ], [ - 435, + 400, 142, 6124 ], [ - 435, + 400, 143, 6523 ] ], [ [ - 393, + 358, 151, 7943 ], [ - 394, + 359, 151, 8099 ], [ - 399, + 364, 150, 8124 ], [ - 412, + 377, 150, 8184 ], [ - 422, + 387, 150, 8185 ], [ - 438, + 403, 150, 8245 ], [ - 448, + 413, 150, 8246 ], [ - 465, + 430, 149, 8305 ], [ - 478, + 443, 149, 8306 ], [ - 485, + 450, 149, 8366 ], [ - 487, + 452, 149, 8366 ], [ - 488, + 453, 149, 8432 ], [ - 489, + 454, 149, 8490 ], [ - 491, + 456, 149, 8492 ], [ - 492, + 457, 149, 8549 ], [ - 492, + 457, 150, 8835 ], [ - 492, + 457, 152, 8882 ], [ - 492, + 457, 155, 8883 ], [ - 492, + 457, 159, 8944 ], [ - 492, + 457, 163, 8945 ], [ - 492, + 457, 168, 9005 ], [ - 491, + 456, 173, 9005 ], [ - 491, + 456, 177, 9067 ], [ - 490, + 455, 182, 9068 ], [ - 490, + 455, 188, 9126 ], [ - 490, + 455, 192, 9126 ], [ - 490, + 455, 193, 9130 ], [ - 490, + 455, 196, 9188 ], [ - 490, + 455, 198, 9247 ], [ - 490, + 455, 200, 9247 ], [ - 490, + 455, 202, 9307 ], [ - 490, + 455, 203, 9308 ] @@ -871,108 +871,128 @@ var unipenData = { ], [ 625, - 120, - 3236 + 121, + 3096 + ], + [ + 626, + 121, + 3155 + ], + [ + 628, + 121, + 3199 + ], + [ + 629, + 121, + 3254 + ], + [ + 631, + 121, + 3310 ] ], [ [ - 614, + 626, 42, 3848 ], [ - 614, + 626, 45, 3896 ], [ - 614, + 626, 47, 3897 ], [ - 614, + 626, 54, 3900 ], [ - 615, + 627, 63, 3958 ], [ - 617, + 629, 76, 3958 ], [ - 619, + 631, 92, 4017 ], [ - 620, + 632, 100, 4018 ], [ - 620, + 632, 115, 4078 ], [ - 620, + 632, 133, 4079 ], [ - 618, + 630, 141, 4084 ], [ - 616, + 628, 153, 4138 ], [ - 616, + 628, 157, 4139 ], [ - 615, + 627, 169, 4200 ], [ - 614, + 626, 176, 4201 ], [ - 614, + 626, 178, 4205 ], [ - 613, + 625, 184, 4260 ], [ - 613, + 625, 188, 4261 ], [ - 613, + 625, 190, 4420 ], [ - 613, + 625, 191, 4540 ] @@ -996,134 +1016,134 @@ var unipenData = { ".PEN": [ [ [ - 169, - 59, + 224, + 27, 0 ], [ - 171, - 59, + 223, + 27, 148 ], [ - 175, - 59, + 222, + 34, 170 ], [ - 183, - 59, + 222, + 39, 228 ], [ - 197, - 59, + 223, + 46, 229 ], [ - 210, - 59, + 223, + 47, 288 ], [ 223, - 61, + 50, 289 ], [ - 233, - 61, + 224, + 53, 292 ], [ - 241, - 61, + 224, + 56, 350 ], [ - 252, - 62, + 224, + 57, 350 ], [ - 260, - 62, + 225, + 59, 418 ], [ - 265, - 62, + 225, + 61, 419 ], [ - 266, + 225, 62, 748 ] ], [ [ - 224, - 27, + 169, + 59, 1367 ], [ - 223, - 27, + 171, + 59, 1414 ], [ - 222, - 34, + 175, + 59, 1444 ], [ - 222, - 39, + 183, + 59, 1502 ], [ - 223, - 46, + 197, + 59, 1503 ], [ - 223, - 47, + 210, + 59, 1508 ], [ 223, - 50, + 61, 1566 ], [ - 224, - 53, + 233, + 61, 1568 ], [ - 224, - 56, + 241, + 61, 1629 ], [ - 224, - 57, + 252, + 62, 1630 ], [ - 225, - 59, + 260, + 62, 1630 ], [ - 225, - 61, + 265, + 62, 1686 ], [ - 225, + 266, 62, 1687 ] @@ -1132,568 +1152,568 @@ var unipenData = { [ 244, 82, - 3184 + 2184 ], [ 243, 81, - 3259 + 2259 ], [ 242, 81, - 3285 + 2285 ], [ 238, 80, - 3349 + 2349 ], [ 225, 80, - 3350 + 2350 ], [ 210, 80, - 3412 + 2412 ], [ 198, 82, - 3414 + 2414 ], [ 192, 84, - 3474 + 2474 ], [ 186, 88, - 3476 + 2476 ], [ 184, 90, - 3478 + 2478 ], [ 180, 95, - 3532 + 2532 ], [ 178, 100, - 3533 + 2533 ], [ 178, 109, - 3595 + 2595 ], [ 178, 117, - 3598 + 2598 ], [ 181, 125, - 3657 + 2657 ], [ 186, 130, - 3658 + 2658 ], [ 194, 136, - 3716 + 2716 ], [ 197, 137, - 3717 + 2717 ], [ 199, 137, - 3775 + 2775 ], [ 202, 137, - 3776 + 2776 ], [ 204, 137, - 3780 + 2780 ], [ 206, 137, - 3835 + 2835 ], [ 223, 135, - 3836 + 2836 ], [ 234, 133, - 3897 + 2897 ], [ 240, 130, - 3898 + 2898 ], [ 242, 129, - 3900 + 2900 ], [ 244, 128, - 3958 + 2958 ], [ 251, 120, - 3959 + 2959 ], [ 253, 117, - 4017 + 3017 ], [ 253, 114, - 4020 + 3020 ], [ 253, 110, - 4081 + 3081 ], [ 251, 104, - 4083 + 3083 ], [ 249, 99, - 4140 + 3140 ], [ 247, 95, - 4141 + 3141 ], [ 243, 89, - 4205 + 3205 ], [ 242, 86, - 4206 + 3206 ], [ 242, 85, - 4212 + 3212 ], [ 241, 84, - 4284 + 3284 ], [ 240, 84, - 4324 + 3324 ], [ 239, 84, - 4596 - ] - ], - [ - [ - 177, - 144, - 6344 - ], - [ - 178, - 144, - 6573 - ], - [ - 178, - 146, - 6600 - ], - [ - 179, - 148, - 6604 - ], - [ - 179, - 150, - 6657 - ], - [ - 180, - 153, - 6658 - ], - [ - 181, - 160, - 6719 - ], - [ - 182, - 167, - 6720 - ], - [ - 183, - 176, - 6779 - ], - [ - 184, - 182, - 6780 - ], - [ - 184, - 185, - 6840 - ], - [ - 185, - 189, - 6841 - ], - [ - 186, - 189, - 7108 - ], - [ - 195, - 189, - 7174 - ], - [ - 206, - 187, - 7234 - ], - [ - 213, - 186, - 7236 - ], - [ - 219, - 186, - 7294 - ], - [ - 224, - 186, - 7296 - ], - [ - 233, - 186, - 7355 - ], - [ - 241, - 185, - 7355 - ], - [ - 252, - 185, - 7417 - ], - [ - 262, - 185, - 7419 - ], - [ - 268, - 186, - 7421 - ], - [ - 276, - 186, - 7475 - ], - [ - 281, - 186, - 7476 - ], - [ - 289, - 186, - 7536 - ], - [ - 290, - 186, - 7537 - ], - [ - 291, - 186, - 7597 - ], - [ - 292, - 186, - 7660 - ], - [ - 293, - 186, - 7724 - ], - [ - 294, - 186, - 7725 - ], - [ - 295, - 186, - 8172 + 3596 ] ], [ [ 283, 25, - 9136 + 4344 ], [ 283, 26, - 9220 + 4573 ], [ 283, 27, - 9244 + 4600 ], [ 283, 33, - 9299 + 4604 ], [ 283, 41, - 9300 + 4657 ], [ 282, 53, - 9359 + 4658 ], [ 282, 65, - 9359 + 4719 ], [ 282, 78, - 9420 + 4720 ], [ 282, 92, - 9421 + 4779 ], [ 281, 115, - 9481 + 4780 ], [ 280, 124, - 9482 + 4840 ], [ 279, 133, - 9484 + 4841 ], [ 279, 135, - 9542 + 5108 ], [ 278, 142, - 9542 + 5174 ], [ 277, 148, - 9605 + 5234 ], [ 277, 150, - 9607 + 5236 ], [ 277, 151, - 9764 + 5294 ], [ 277, 153, - 9816 + 5296 ], [ 277, 154, - 9876 + 5355 ], [ 277, 153, - 10124 + 5355 ], [ 277, 151, - 10180 + 5417 ] ], [ [ 282, 89, - 10651 + 6136 ], [ 283, 89, - 10796 + 6220 ], [ 286, 89, - 10821 + 6244 ], [ 288, 88, - 10879 + 6299 ], [ 291, 88, - 10879 + 6300 ], [ 294, 88, - 10941 + 6359 ], [ 295, 88, - 10941 + 6359 ], [ 297, 88, - 11003 + 6420 ], [ 298, 88, - 11004 + 6421 ], [ 299, 88, - 11061 + 6481 ], [ 300, 88, - 11062 + 6482 ], [ 301, 88, - 11121 + 6484 ], [ 302, 88, - 11123 + 6542 ], [ 303, 88, - 11185 + 6542 ], [ 304, 88, - 11187 + 6605 ], [ 305, 88, - 11189 + 6607 ], [ 306, 88, - 11248 + 6764 ], [ 307, 88, - 11249 + 6816 ], [ 309, 89, - 11304 + 6876 + ] + ], + [ + [ + 177, + 144, + 7651 + ], + [ + 178, + 144, + 7796 + ], + [ + 178, + 146, + 7821 + ], + [ + 179, + 148, + 7879 + ], + [ + 179, + 150, + 7879 + ], + [ + 180, + 153, + 7941 + ], + [ + 181, + 160, + 7941 + ], + [ + 182, + 167, + 8003 + ], + [ + 183, + 176, + 8004 + ], + [ + 184, + 182, + 8061 + ], + [ + 184, + 185, + 8062 + ], + [ + 185, + 189, + 8121 + ], + [ + 186, + 189, + 8123 + ], + [ + 195, + 189, + 8185 + ], + [ + 206, + 187, + 8187 + ], + [ + 213, + 186, + 8189 + ], + [ + 219, + 186, + 8248 + ], + [ + 224, + 186, + 8249 + ], + [ + 233, + 186, + 8304 + ], + [ + 241, + 185, + 8304 + ], + [ + 252, + 185, + 8366 + ], + [ + 262, + 185, + 8368 + ], + [ + 268, + 186, + 8370 + ], + [ + 276, + 186, + 8424 + ], + [ + 281, + 186, + 8425 + ], + [ + 289, + 186, + 8485 + ], + [ + 290, + 186, + 8486 + ], + [ + 291, + 186, + 8546 + ], + [ + 292, + 186, + 8609 + ], + [ + 293, + 186, + 8673 + ], + [ + 294, + 186, + 8674 + ], + [ + 295, + 186, + 8738 ] ] ], diff --git a/tests/auto/inputpanel/data/tst_inputpanel.qml b/tests/auto/inputpanel/data/tst_inputpanel.qml index 9ecbc516..3f423dd0 100644 --- a/tests/auto/inputpanel/data/tst_inputpanel.qml +++ b/tests/auto/inputpanel/data/tst_inputpanel.qml @@ -331,23 +331,35 @@ Rectangle { { initLocale: "de_DE", initInputMethodHints: Qt.ImhNoPredictiveText, inputSequence: "hallo", outputText: "Hallo" }, { initLocale: "el_GR", initInputMethodHints: Qt.ImhNoPredictiveText, inputSequence: "\u03C7\u03B1\u03AF\u03C1\u03B5\u03C4\u03B5", outputText: "\u03A7\u03B1\u03AF\u03C1\u03B5\u03C4\u03B5" }, { initLocale: "en_GB", initInputMethodHints: Qt.ImhNoPredictiveText, inputSequence: "hello", outputText: "Hello" }, + { initLocale: "en_US", initInputMethodHints: Qt.ImhNoPredictiveText, inputSequence: "hello", outputText: "Hello" }, { initLocale: "es_ES", initInputMethodHints: Qt.ImhNoPredictiveText, inputSequence: "hola", outputText: "Hola" }, + { initLocale: "es_MX", initInputMethodHints: Qt.ImhNoPredictiveText, inputSequence: "hola", outputText: "Hola" }, { initLocale: "et_EE", initInputMethodHints: Qt.ImhNoPredictiveText, inputSequence: "tere", outputText: "Tere" }, { initLocale: "hi_IN", initInputMethodHints: Qt.ImhNoPredictiveText, inputSequence: "\u0928\u092E\u0938\u094D\u0915\u093E\u0930", outputText: "\u0928\u092E\u0938\u094D\u0915\u093E\u0930" }, { initLocale: "hr_HR", initInputMethodHints: Qt.ImhNoPredictiveText, inputSequence: "zdravo", outputText: "Zdravo" }, { initLocale: "hu_HU", initInputMethodHints: Qt.ImhNoPredictiveText, inputSequence: "helló", outputText: "Helló" }, { initLocale: "fi_FI", initInputMethodHints: Qt.ImhNoPredictiveText, inputSequence: "hei", outputText: "Hei" }, + { initLocale: "fr_CA", initInputMethodHints: Qt.ImhNoPredictiveText, inputSequence: "bonjour", outputText: "Bonjour" }, { initLocale: "fr_FR", initInputMethodHints: Qt.ImhNoPredictiveText, inputSequence: "bonjour", outputText: "Bonjour" }, + { initLocale: "id_ID", initInputMethodHints: Qt.ImhNoPredictiveText, inputSequence: "halo", outputText: "Halo" }, { initLocale: "it_IT", initInputMethodHints: Qt.ImhNoPredictiveText, inputSequence: "ciao", outputText: "Ciao" }, { initLocale: "ja_JP", initInputMethodHints: Qt.ImhNoPredictiveText, inputSequence: "watashi", outputText: "\u308F\u305F\u3057" }, + { initLocale: "ms_MY", initInputMethodHints: Qt.ImhNoPredictiveText, inputSequence: "hello", outputText: "Hello" }, { initLocale: "nb_NO", initInputMethodHints: Qt.ImhNoPredictiveText, inputSequence: "hallo", outputText: "Hallo" }, { initLocale: "nl_NL", initInputMethodHints: Qt.ImhNoPredictiveText, inputSequence: "hallo", outputText: "Hallo" }, { initLocale: "pl_PL", initInputMethodHints: Qt.ImhNoPredictiveText, inputSequence: "cze\u015B\u0107", outputText: "Cze\u015B\u0107" }, + { initLocale: "pt_BR", initInputMethodHints: Qt.ImhNoPredictiveText, inputSequence: "ol\u00E1", outputText: "Ol\u00E1" }, { initLocale: "pt_PT", initInputMethodHints: Qt.ImhNoPredictiveText, inputSequence: "ol\u00E1", outputText: "Ol\u00E1" }, { initLocale: "ru_RU", initInputMethodHints: Qt.ImhNoPredictiveText, inputSequence: "\u043F\u0440\u0438\u0432\u0435\u0442", outputText: "\u041F\u0440\u0438\u0432\u0435\u0442" }, { initLocale: "ru_RU", initInputMethodHints: Qt.ImhNoPredictiveText, initInputMode: "Latin", inputSequence: "hello", outputText: "Hello" }, { initLocale: "sr_SP", initInputMethodHints: Qt.ImhNoPredictiveText, inputSequence: "\u0437\u0434\u0440\u0430\u0432\u043E", outputText: "\u0417\u0434\u0440\u0430\u0432\u043E" }, - { initLocale: "sv_SE", initInputMethodHints: Qt.ImhNoPredictiveText, inputSequence: "hall\u00E5", outputText: "Hall\u00E5" } + { initLocale: "sv_SE", initInputMethodHints: Qt.ImhNoPredictiveText, inputSequence: "hall\u00E5", outputText: "Hall\u00E5" }, + { initLocale: "sq_AL", initInputMethodHints: Qt.ImhNoPredictiveText, inputSequence: "përshëndetje", outputText: "Përshëndetje" }, + { initLocale: "sk_SK", initInputMethodHints: Qt.ImhNoPredictiveText, inputSequence: "ahoj", outputText: "Ahoj" }, + { initLocale: "sl_SI", initInputMethodHints: Qt.ImhNoPredictiveText, inputSequence: "zdravo", outputText: "Zdravo" }, + { initLocale: "th_TH", initInputMethodHints: Qt.ImhNoPredictiveText, inputSequence: "สวัสดี", outputText: "สวัสดี" }, + { initLocale: "tr_TR", initInputMethodHints: Qt.ImhNoPredictiveText, inputSequence: "merhaba", outputText: "Merhaba" }, + { initLocale: "uk_UA", initInputMethodHints: Qt.ImhNoPredictiveText, inputSequence: "здравствуйте", outputText: "Здравствуйте" }, ] } @@ -1104,6 +1116,10 @@ Rectangle { { initLocale: "ja_JP", initInputMode: "Hiragana", inputSequence: ["n","i","h","o","n","g","o"], outputText: "" }, // Latin only { initLocale: "ja_JP", initInputMethodHints: Qt.ImhLatinOnly, inputSequence: "hello", outputText: "Hello" }, + // Cursor test: 1. Enter hiragana input sequence and move cursor in the middle of input. + // 2. Change input mode to Katakana. + // 3. The input sequence should be committed leaving the cursor in the middle. + { initLocale: "ja_JP", initInputMode: "Hiragana", inputSequence: ["n","i","h","o","n","g","o",Qt.Key_Left,Qt.Key_Left,Qt.Key_Left,Qt.Key_Mode_switch], outputText: "\u306B\u307B\u3093\u3054", expectedCursorPosition: 2 }, ] } @@ -1116,6 +1132,9 @@ Rectangle { waitForRendering(inputPanel) compare(textInput.text, data.outputText) + + if (data.hasOwnProperty("expectedCursorPosition")) + compare(textInput.cursorPosition, data.expectedCursorPosition) } function test_baseKeyNoModifier() { @@ -1174,6 +1193,9 @@ Rectangle { function test_hwrInputSequence(data) { prepareTest(data, true) + if (inputPanel.isSuperimposedHandwriting()) + skip("Not valid test for Superimposed Handwriting") + for (var i = 0; i < data.toggleShiftCount; i++) { inputPanel.toggleShift() } @@ -1192,6 +1214,52 @@ Rectangle { compare(textInput.text, data.outputText) } + function test_superimposedHwrInputSequence_data() { + return [ + { initHwrMode: true, initInputMethodHints: Qt.ImhNone, initLocale: "en_GB", inputSequence: "Hellohowareyou?", outputText: "Hello how are you?" }, + { initHwrMode: true, initInputMethodHints: Qt.ImhNone, initLocale: "fr_FR", inputSequence: "Bonjour", outputText: "Bonjour" }, + { initHwrMode: true, initInputMethodHints: Qt.ImhNone, initLocale: "da_DK", inputSequence: "Hej", outputText: "Hej" }, + { initHwrMode: true, initInputMethodHints: Qt.ImhNone, initLocale: "de_DE", inputSequence: "Hallo", outputText: "Hallo" }, + { initHwrMode: true, initInputMethodHints: Qt.ImhNone, initLocale: "es_ES", inputSequence: "Hola", outputText: "Hola" }, + { initHwrMode: true, initInputMethodHints: Qt.ImhNone, initLocale: "et_EE", inputSequence: "Tere", outputText: "Tere" }, + { initHwrMode: true, initInputMethodHints: Qt.ImhNone, initLocale: "hr_HR", inputSequence: "Zdravo", outputText: "Zdravo" }, + { initHwrMode: true, initInputMethodHints: Qt.ImhNone, initLocale: "it_IT", inputSequence: "Ciao", outputText: "Ciao" }, + { initHwrMode: true, initInputMethodHints: Qt.ImhNone, initLocale: "cs_CZ", inputSequence: "Ahoj", outputText: "Ahoj" }, + { initHwrMode: true, initInputMethodHints: Qt.ImhNone, initLocale: "bg_BG", inputSequence: "\u0431\u044A\u043B\u0433\u0430\u0440\u0441\u043A\u0438", outputText: "\u0411\u044A\u043B\u0433\u0430\u0440\u0441\u043A\u0438" }, + { initHwrMode: true, initInputMethodHints: Qt.ImhNone, initLocale: "zh_CN", inputSequence: "\u4e2d\u6587", outputText: "\u4e2d\u6587" }, + { initHwrMode: true, initInputMethodHints: Qt.ImhNone, initLocale: "zh_TW", inputSequence: "\u570b", outputText: "\u570b" }, + { initHwrMode: true, initInputMethodHints: Qt.ImhNone, initLocale: "ja_JP", inputSequence: "\u65E5\u672C\u8A9E", outputText: "\u65E5\u672C\u8A9E" }, + { initHwrMode: true, initInputMethodHints: Qt.ImhNone, initLocale: "ko_KR", inputSequence: "\uD55C\uAD6D\uC5B4", outputText: "\uD55C\uAD6D\uC5B4" }, + { initHwrMode: true, initInputMethodHints: Qt.ImhNone, initLocale: "el_GR", inputSequence: "\u0395\u03BB\u03BB\u03B7\u03BD\u03B9\u03BA\u03AC", outputText: "\u0395\u03BB\u03BB\u03B7\u03BD\u03B9\u03BA\u03AC" }, + { initHwrMode: true, initInputMethodHints: Qt.ImhNone, initLocale: "he_IL", inputSequence: "\u05D0\u05D5\u05D8\u05D5", outputText: "\u05D0\u05D5\u05D8\u05D5" }, + ] + } + + function test_superimposedHwrInputSequence(data) { + prepareTest(data, true) + + if (!inputPanel.isSuperimposedHandwriting()) + skip("Not valid test for non-Superimposed Handwriting") + + for (var i = 0; i < data.toggleShiftCount; i++) { + inputPanel.toggleShift() + } + for (var inputIndex in data.inputSequence) { + verify(inputPanel.emulateHandwriting(data.inputSequence.charAt(inputIndex), true)) + } + wait(2000) + + if (inputPanel.wordCandidateView.count > 0) { + if (inputPanel.selectionListSearchSuggestion(data.outputText)) { + inputPanel.selectionListSelectCurrentItem() + } + } + + Qt.inputMethod.commit() + waitForRendering(inputPanel) + compare(textInput.text, data.outputText) + } + function test_hwrNumericInputSequence_data() { return [ { initHwrMode: true, initInputMethodHints: Qt.ImhNoPredictiveText | Qt.ImhPreferNumbers, modeSwitchAllowed: true, inputSequence: "0123456789", outputText: "0123456789" }, @@ -1208,6 +1276,9 @@ Rectangle { function test_hwrNumericInputSequence(data) { prepareTest(data, true) + if (inputPanel.isSuperimposedHandwriting()) + skip("Not valid test for Superimposed Handwriting") + for (var inputIndex in data.inputSequence) { verify(inputPanel.emulateHandwriting(data.inputSequence.charAt(inputIndex), true)) } @@ -1242,6 +1313,9 @@ Rectangle { function test_hwrSpellCorrectionSuggestions(data) { prepareTest(data, true) + if (inputPanel.isSuperimposedHandwriting()) + skip("Not valid test for Superimposed Handwriting") + for (var inputIndex in data.inputSequence) { verify(inputPanel.emulateHandwriting(data.inputSequence.charAt(inputIndex), true)) } @@ -1278,6 +1352,9 @@ Rectangle { handwritingInputPanel.available = true verify(inputPanel.visible === false) + if (inputPanel.isSuperimposedHandwriting()) + skip("Not valid test for Superimposed Handwriting") + for (var i = 0; i < data.toggleShiftCount; i++) { inputPanel.toggleShift() } @@ -1293,6 +1370,52 @@ Rectangle { compare(textInput.text, data.outputText) } + function test_superimposedHwrFullScreenInputSequence_data() { + return [ + { initHwrMode: true, initInputMethodHints: Qt.ImhNone, initLocale: "en_GB", inputSequence: "Hellohowareyou", outputText: "Hello how are you" }, + { initHwrMode: true, initInputMethodHints: Qt.ImhNone, initLocale: "fr_FR", inputSequence: "Bonjour", outputText: "Bonjour" }, + { initHwrMode: true, initInputMethodHints: Qt.ImhNone, initLocale: "da_DK", inputSequence: "Hej", outputText: "Hej" }, + { initHwrMode: true, initInputMethodHints: Qt.ImhNone, initLocale: "de_DE", inputSequence: "Hallo", outputText: "Hallo" }, + { initHwrMode: true, initInputMethodHints: Qt.ImhNone, initLocale: "es_ES", inputSequence: "Hola", outputText: "Hola" }, + { initHwrMode: true, initInputMethodHints: Qt.ImhNone, initLocale: "et_EE", inputSequence: "Tere", outputText: "Tere" }, + { initHwrMode: true, initInputMethodHints: Qt.ImhNone, initLocale: "hr_HR", inputSequence: "Zdravo", outputText: "Zdravo" }, + { initHwrMode: true, initInputMethodHints: Qt.ImhNone, initLocale: "it_IT", inputSequence: "Ciao", outputText: "Ciao" }, + { initHwrMode: true, initInputMethodHints: Qt.ImhNone, initLocale: "cs_CZ", inputSequence: "Ahoj", outputText: "Ahoj" }, + { initHwrMode: true, initInputMethodHints: Qt.ImhNone, initLocale: "bg_BG", inputSequence: "\u0431\u044A\u043B\u0433\u0430\u0440\u0441\u043A\u0438", outputText: "\u0411\u044A\u043B\u0433\u0430\u0440\u0441\u043A\u0438" }, + { initHwrMode: true, initInputMethodHints: Qt.ImhNone, initLocale: "zh_CN", inputSequence: "\u4e2d\u6587", outputText: "\u4e2d\u6587" }, + { initHwrMode: true, initInputMethodHints: Qt.ImhNone, initLocale: "zh_TW", inputSequence: "\u570b", outputText: "\u570b" }, + { initHwrMode: true, initInputMethodHints: Qt.ImhNone, initLocale: "ja_JP", inputSequence: "\u65E5\u672C\u8A9E", outputText: "\u65E5\u672C\u8A9E" }, + { initHwrMode: true, initInputMethodHints: Qt.ImhNone, initLocale: "ko_KR", inputSequence: "\uD55C\uAD6D\uC5B4", outputText: "\uD55C\uAD6D\uC5B4" }, + { initHwrMode: true, initInputMethodHints: Qt.ImhNone, initLocale: "el_GR", inputSequence: "\u0395\u03BB\u03BB\u03B7\u03BD\u03B9\u03BA\u03AC", outputText: "\u0395\u03BB\u03BB\u03B7\u03BD\u03B9\u03BA\u03AC" }, + { initHwrMode: true, initInputMethodHints: Qt.ImhNone, initLocale: "he_IL", inputSequence: "\u05D0\u05D5\u05D8\u05D5", outputText: "\u05D0\u05D5\u05D8\u05D5" }, + ] + } + + function test_superimposedHwrFullScreenInputSequence(data) { + prepareTest(data, true) + + handwritingInputPanel.available = true + verify(inputPanel.visible === false) + + if (!inputPanel.isSuperimposedHandwriting()) + skip("Not valid test for non-Superimposed Handwriting") + + for (var i = 0; i < data.toggleShiftCount; i++) { + inputPanel.toggleShift() + } + for (var inputIndex in data.inputSequence) { + verify(handwritingInputPanel.emulateHandwriting(data.inputSequence[inputIndex], true)) + } + wait(2000) + + if (handwritingInputPanel.wordCandidatePopupListSearchSuggestion(data.outputText)) { + handwritingInputPanel.wordCandidatePopupListSelectCurrentItem() + } + + Qt.inputMethod.commit() + compare(textInput.text, data.outputText) + } + function test_hwrFullScreenNumericInputSequence_data() { return [ { initHwrMode: true, initInputMethodHints: Qt.ImhNoPredictiveText | Qt.ImhPreferNumbers, inputSequence: "0123456789", outputText: "0123456789" }, @@ -1308,6 +1431,9 @@ Rectangle { handwritingInputPanel.available = true verify(inputPanel.visible === false) + if (handwritingInputPanel.isSuperimposedHandwriting()) + skip("Not valid test for Superimposed Handwriting") + for (var inputIndex in data.inputSequence) { verify(handwritingInputPanel.emulateHandwriting(data.inputSequence.charAt(inputIndex), true)) } @@ -1333,6 +1459,9 @@ Rectangle { handwritingInputPanel.available = true verify(inputPanel.visible === false) + if (handwritingInputPanel.isSuperimposedHandwriting()) + skip("Not valid test for Superimposed Handwriting") + for (var inputIndex in data.inputSequence) { verify(handwritingInputPanel.emulateHandwriting(data.inputSequence[inputIndex], true)) } @@ -1357,6 +1486,9 @@ Rectangle { if (!inputPanel.wordCandidateListVisibleHint) skip("Word candidates not available (spell correction/hwr suggestions)") + if (handwritingInputPanel.isSuperimposedHandwriting()) + skip("Not valid test for Superimposed Handwriting") + var numAddedLines = Math.floor(textInput.height / Qt.inputMethod.cursorRectangle.height - data.initLinesToBottom) - 1 for (var i = 0; i < numAddedLines; i++) { textInput.insert(textInput.length, "\n") @@ -1498,6 +1630,9 @@ Rectangle { function test_hwrWordReselection(data) { prepareTest(data, true) + if (inputPanel.isSuperimposedHandwriting()) + skip("Not valid test for Superimposed Handwriting") + var cursorRects = [] for (var i = 0; i < data.clickPositions.length; i++) cursorRects.push(textInput.positionToRectangle(data.clickPositions[i])) @@ -1691,19 +1826,14 @@ Rectangle { skip("Prediction/spell correction not enabled") for (var len = 1; len <= 5; ++len) { - inputPanel.wordCandidateListChangedSpy.clear() inputPanel.virtualKeyClick("z") - waitForRendering(inputPanel) - if (len >= 3) { - if (data.wclAutoCommitWord) - tryVerify(function() { return inputPanel.wordCandidateView.model.count === 0 }, 500) - else - wait(500) + if (len >= 2) { + inputPanel.wordCandidateListChangedSpy.clear() + inputPanel.wordCandidateListChangedSpy.wait() if (inputPanel.wordCandidateView.model.count <= 1) break } } - waitForRendering(inputPanel) if (data.wclAutoCommitWord) compare(inputPanel.wordCandidateView.model.count, 0) @@ -1889,5 +2019,67 @@ Rectangle { compare(inputPanel.shadowInput.text, "") } + function test_userDictionary_data() { + return [ + { inputSequence: ['a','s','d','f'], initShift: false }, + { inputSequence: ['a','s','d'], initShift: false, expectedSuggestion: "asdf", suggestionIsFromUserDictionary: true }, + { inputSequence: ['a','s','d'], initShift: true, expectedSuggestion: "Asdf", suggestionIsFromUserDictionary: true }, + // + { inputSequence: ['s','d','f','a'], initShift: true }, + { inputSequence: ['s','d','f'], initShift: true, expectedSuggestion: "Sdfa", suggestionIsFromUserDictionary: true }, + { inputSequence: ['s','d','f'], initShift: false, expectedSuggestion: "sdfa", suggestionIsFromUserDictionary: true, removeSuggestion: true }, + // + { inputSequence: ['d','f','a','s'], initCapsLock: true }, + { inputSequence: ['d','f','a'], initCapsLock: true, expectedSuggestion: "DFAS", suggestionIsFromUserDictionary: true }, + { inputSequence: ['d','f','a'], initShift: false, unexpectedSuggestion: "dfas", suggestionIsFromUserDictionary: true }, + // + { inputSequence: ['f','a','s','d'], initShift: false, initInputMethodHints: Qt.ImhSensitiveData }, + { inputSequence: ['f','a','s'], initShift: false, unexpectedSuggestion: "fasd" }, + { inputSequence: ['f','a','s'], initShift: true, unexpectedSuggestion: "Fasd"}, + // + { initLocale: "en_GB", inputSequence: "windo", expectedSuggestion: "Window", suggestionIsFromUserDictionary: false, removeSuggestion: true }, + { initLocale: "en_GB", inputSequence: "window", }, + { initLocale: "en_GB", inputSequence: "windo", expectedSuggestion: "Window", suggestionIsFromUserDictionary: false }, + ] + } + + function test_userDictionary(data) { + prepareTest(data, true) + + if (!inputPanel.wordCandidateListVisibleHint) + skip("Prediction/spell correction not enabled") + + if (data.hasOwnProperty("initShift")) + inputPanel.setShift(data.initShift) + if (data.hasOwnProperty("initCapsLock")) + inputPanel.setCapsLock(data.initCapsLock) + + for (var inputIndex in data.inputSequence) + inputPanel.virtualKeyClick(data.inputSequence[inputIndex]) + + if (data.hasOwnProperty("expectedSuggestion")) { + tryVerify(function() {return inputPanel.selectionListSearchSuggestion(data.expectedSuggestion)}, 1000, "The expected spell correction suggestion \"%1\" was not found".arg(data.expectedSuggestion)) + verify(inputPanel.selectionListCurrentIndex() > 0) + if (data.hasOwnProperty("suggestionIsFromUserDictionary")) + compare(inputPanel.selectionListSuggestionIsFromUserDictionary(), data.suggestionIsFromUserDictionary) + if (data.hasOwnProperty("removeSuggestion") && data.removeSuggestion) { + verify(inputPanel.openWordCandidateContextMenu()) + inputPanel.wordCandidateListChangedSpy.clear() + verify(inputPanel.selectItemFromWordCandidateContextMenu(0)) + inputPanel.wordCandidateListChangedSpy.wait() + tryVerify(function() {return !inputPanel.selectionListSearchSuggestion(data.expectedSuggestion)}, 1000, "An unexpected spell correction suggestion \"%1\" was found".arg(data.unexpectedSuggestion)) + } else { + inputPanel.selectionListSelectCurrentItem() + } + } else if (data.hasOwnProperty("unexpectedSuggestion")) { + var oldIndex = inputPanel.selectionListCurrentIndex() + tryVerify(function() {return !inputPanel.selectionListSearchSuggestion(data.unexpectedSuggestion)}, 1000, "An unexpected spell correction suggestion \"%1\" was found".arg(data.unexpectedSuggestion)) + compare(inputPanel.selectionListCurrentIndex(), oldIndex) + } else { + inputPanel.selectionListSelectCurrentItem() + } + + Qt.inputMethod.reset() + } } } diff --git a/tests/auto/inputpanel/hwr_test_data/korean/44397_100_0.txt b/tests/auto/inputpanel/hwr_test_data/korean/44397_100_0.txt index cd2eab9b..16f1285e 100644 --- a/tests/auto/inputpanel/hwr_test_data/korean/44397_100_0.txt +++ b/tests/auto/inputpanel/hwr_test_data/korean/44397_100_0.txt @@ -8,114 +8,114 @@ .Y_POINTS_PER_INCH 94 .POINTS_PER_SECOND 60 .PEN_DOWN -379 53 0 -380 53 155 -382 53 177 -385 53 179 -391 53 243 -400 53 244 -421 55 311 -437 55 313 -441 55 315 -448 55 365 -454 55 366 -461 55 370 -467 54 426 -472 54 427 -475 54 486 -477 54 487 -478 54 490 -479 54 548 -480 54 549 -482 54 610 -485 54 610 -488 54 670 -489 54 731 -489 55 939 -489 56 1003 -489 60 1004 -489 64 1064 -489 66 1065 -489 72 1124 -489 75 1125 -489 79 1131 -489 81 1184 -489 86 1185 -489 91 1245 -489 92 1246 -489 97 1306 -489 99 1307 -489 101 1366 -489 102 1367 -489 103 1427 -489 105 1429 -489 106 1500 -489 107 1549 -489 108 1550 -489 109 1614 +344 53 0 +345 53 155 +347 53 177 +350 53 179 +356 53 243 +365 53 244 +386 55 311 +402 55 313 +406 55 315 +413 55 365 +419 55 366 +426 55 370 +432 54 426 +437 54 427 +440 54 486 +442 54 487 +443 54 490 +444 54 548 +445 54 549 +447 54 610 +450 54 610 +453 54 670 +454 54 731 +454 55 939 +454 56 1003 +454 60 1004 +454 64 1064 +454 66 1065 +454 72 1124 +454 75 1125 +454 79 1131 +454 81 1184 +454 86 1185 +454 91 1245 +454 92 1246 +454 97 1306 +454 99 1307 +454 101 1366 +454 102 1367 +454 103 1427 +454 105 1429 +454 106 1500 +454 107 1549 +454 108 1550 +454 109 1614 .PEN_UP .PEN_DOWN -383 113 2999 -384 113 3259 -385 112 3291 -386 112 3360 -399 112 3361 -412 112 3389 -434 112 3449 -440 112 3450 -451 112 3451 -455 112 3510 -479 111 3511 -493 110 3574 -506 109 3576 -513 109 3632 -515 109 3633 -516 109 3636 +348 113 2999 +349 113 3259 +350 112 3291 +351 112 3360 +364 112 3361 +377 112 3389 +399 112 3449 +405 112 3450 +416 112 3451 +420 112 3510 +444 111 3511 +458 110 3574 +471 109 3576 +478 109 3632 +480 109 3633 +481 109 3636 .PEN_UP .PEN_DOWN -430 115 5767 -430 116 5851 -432 120 5884 -433 123 5937 -433 127 5938 -434 130 6000 -434 133 6002 -435 139 6058 -435 141 6059 -435 142 6124 -435 143 6523 +395 115 5767 +395 116 5851 +397 120 5884 +398 123 5937 +398 127 5938 +399 130 6000 +399 133 6002 +400 139 6058 +400 141 6059 +400 142 6124 +400 143 6523 .PEN_UP .PEN_DOWN -393 151 7943 -394 151 8099 -399 150 8124 -412 150 8184 -422 150 8185 -438 150 8245 -448 150 8246 -465 149 8305 -478 149 8306 -485 149 8366 -487 149 8366 -488 149 8432 -489 149 8490 -491 149 8492 -492 149 8549 -492 150 8835 -492 152 8882 -492 155 8883 -492 159 8944 -492 163 8945 -492 168 9005 -491 173 9005 -491 177 9067 -490 182 9068 -490 188 9126 -490 192 9126 -490 193 9130 -490 196 9188 -490 198 9247 -490 200 9247 -490 202 9307 -490 203 9308 +358 151 7943 +359 151 8099 +364 150 8124 +377 150 8184 +387 150 8185 +403 150 8245 +413 150 8246 +430 149 8305 +443 149 8306 +450 149 8366 +452 149 8366 +453 149 8432 +454 149 8490 +456 149 8492 +457 149 8549 +457 150 8835 +457 152 8882 +457 155 8883 +457 159 8944 +457 163 8945 +457 168 9005 +456 173 9005 +456 177 9067 +455 182 9068 +455 188 9126 +455 192 9126 +455 193 9130 +455 196 9188 +455 198 9247 +455 200 9247 +455 202 9307 +455 203 9308 .PEN_UP diff --git a/tests/auto/inputpanel/hwr_test_data/korean/50612_100_0.txt b/tests/auto/inputpanel/hwr_test_data/korean/50612_100_0.txt index fd22d87d..03a24576 100644 --- a/tests/auto/inputpanel/hwr_test_data/korean/50612_100_0.txt +++ b/tests/auto/inputpanel/hwr_test_data/korean/50612_100_0.txt @@ -67,27 +67,31 @@ 622 121 2840 623 121 2957 624 121 3045 -625 120 3236 +625 121 3096 +626 121 3155 +628 121 3199 +629 121 3254 +631 121 3310 .PEN_UP .PEN_DOWN -614 42 3848 -614 45 3896 -614 47 3897 -614 54 3900 -615 63 3958 -617 76 3958 -619 92 4017 -620 100 4018 -620 115 4078 -620 133 4079 -618 141 4084 -616 153 4138 -616 157 4139 -615 169 4200 -614 176 4201 -614 178 4205 -613 184 4260 -613 188 4261 -613 190 4420 -613 191 4540 +626 42 3848 +626 45 3896 +626 47 3897 +626 54 3900 +627 63 3958 +629 76 3958 +631 92 4017 +632 100 4018 +632 115 4078 +632 133 4079 +630 141 4084 +628 153 4138 +628 157 4139 +627 169 4200 +626 176 4201 +626 178 4205 +625 184 4260 +625 188 4261 +625 190 4420 +625 191 4540 .PEN_UP diff --git a/tests/auto/inputpanel/hwr_test_data/korean/54620_100_0.txt b/tests/auto/inputpanel/hwr_test_data/korean/54620_100_0.txt index 99f6f912..25488a30 100644 --- a/tests/auto/inputpanel/hwr_test_data/korean/54620_100_0.txt +++ b/tests/auto/inputpanel/hwr_test_data/korean/54620_100_0.txt @@ -8,152 +8,152 @@ .Y_POINTS_PER_INCH 94 .POINTS_PER_SECOND 60 .PEN_DOWN -169 59 0 -171 59 148 -175 59 170 -183 59 228 -197 59 229 -210 59 288 -223 61 289 -233 61 292 -241 61 350 -252 62 350 -260 62 418 -265 62 419 -266 62 748 +224 27 0 +223 27 148 +222 34 170 +222 39 228 +223 46 229 +223 47 288 +223 50 289 +224 53 292 +224 56 350 +224 57 350 +225 59 418 +225 61 419 +225 62 748 .PEN_UP .PEN_DOWN -224 27 1367 -223 27 1414 -222 34 1444 -222 39 1502 -223 46 1503 -223 47 1508 -223 50 1566 -224 53 1568 -224 56 1629 -224 57 1630 -225 59 1630 -225 61 1686 -225 62 1687 +169 59 1367 +171 59 1414 +175 59 1444 +183 59 1502 +197 59 1503 +210 59 1508 +223 61 1566 +233 61 1568 +241 61 1629 +252 62 1630 +260 62 1630 +265 62 1686 +266 62 1687 .PEN_UP .PEN_DOWN -244 82 3184 -243 81 3259 -242 81 3285 -238 80 3349 -225 80 3350 -210 80 3412 -198 82 3414 -192 84 3474 -186 88 3476 -184 90 3478 -180 95 3532 -178 100 3533 -178 109 3595 -178 117 3598 -181 125 3657 -186 130 3658 -194 136 3716 -197 137 3717 -199 137 3775 -202 137 3776 -204 137 3780 -206 137 3835 -223 135 3836 -234 133 3897 -240 130 3898 -242 129 3900 -244 128 3958 -251 120 3959 -253 117 4017 -253 114 4020 -253 110 4081 -251 104 4083 -249 99 4140 -247 95 4141 -243 89 4205 -242 86 4206 -242 85 4212 -241 84 4284 -240 84 4324 -239 84 4596 +244 82 2184 +243 81 2259 +242 81 2285 +238 80 2349 +225 80 2350 +210 80 2412 +198 82 2414 +192 84 2474 +186 88 2476 +184 90 2478 +180 95 2532 +178 100 2533 +178 109 2595 +178 117 2598 +181 125 2657 +186 130 2658 +194 136 2716 +197 137 2717 +199 137 2775 +202 137 2776 +204 137 2780 +206 137 2835 +223 135 2836 +234 133 2897 +240 130 2898 +242 129 2900 +244 128 2958 +251 120 2959 +253 117 3017 +253 114 3020 +253 110 3081 +251 104 3083 +249 99 3140 +247 95 3141 +243 89 3205 +242 86 3206 +242 85 3212 +241 84 3284 +240 84 3324 +239 84 3596 .PEN_UP .PEN_DOWN -177 144 6344 -178 144 6573 -178 146 6600 -179 148 6604 -179 150 6657 -180 153 6658 -181 160 6719 -182 167 6720 -183 176 6779 -184 182 6780 -184 185 6840 -185 189 6841 -186 189 7108 -195 189 7174 -206 187 7234 -213 186 7236 -219 186 7294 -224 186 7296 -233 186 7355 -241 185 7355 -252 185 7417 -262 185 7419 -268 186 7421 -276 186 7475 -281 186 7476 -289 186 7536 -290 186 7537 -291 186 7597 -292 186 7660 -293 186 7724 -294 186 7725 -295 186 8172 +283 25 4344 +283 26 4573 +283 27 4600 +283 33 4604 +283 41 4657 +282 53 4658 +282 65 4719 +282 78 4720 +282 92 4779 +281 115 4780 +280 124 4840 +279 133 4841 +279 135 5108 +278 142 5174 +277 148 5234 +277 150 5236 +277 151 5294 +277 153 5296 +277 154 5355 +277 153 5355 +277 151 5417 .PEN_UP .PEN_DOWN -283 25 9136 -283 26 9220 -283 27 9244 -283 33 9299 -283 41 9300 -282 53 9359 -282 65 9359 -282 78 9420 -282 92 9421 -281 115 9481 -280 124 9482 -279 133 9484 -279 135 9542 -278 142 9542 -277 148 9605 -277 150 9607 -277 151 9764 -277 153 9816 -277 154 9876 -277 153 10124 -277 151 10180 +282 89 6136 +283 89 6220 +286 89 6244 +288 88 6299 +291 88 6300 +294 88 6359 +295 88 6359 +297 88 6420 +298 88 6421 +299 88 6481 +300 88 6482 +301 88 6484 +302 88 6542 +303 88 6542 +304 88 6605 +305 88 6607 +306 88 6764 +307 88 6816 +309 89 6876 .PEN_UP .PEN_DOWN -282 89 10651 -283 89 10796 -286 89 10821 -288 88 10879 -291 88 10879 -294 88 10941 -295 88 10941 -297 88 11003 -298 88 11004 -299 88 11061 -300 88 11062 -301 88 11121 -302 88 11123 -303 88 11185 -304 88 11187 -305 88 11189 -306 88 11248 -307 88 11249 -309 89 11304 +177 144 7651 +178 144 7796 +178 146 7821 +179 148 7879 +179 150 7879 +180 153 7941 +181 160 7941 +182 167 8003 +183 176 8004 +184 182 8061 +184 185 8062 +185 189 8121 +186 189 8123 +195 189 8185 +206 187 8187 +213 186 8189 +219 186 8248 +224 186 8249 +233 186 8304 +241 185 8304 +252 185 8366 +262 185 8368 +268 186 8370 +276 186 8424 +281 186 8425 +289 186 8485 +290 186 8486 +291 186 8546 +292 186 8609 +293 186 8673 +294 186 8674 +295 186 8738 .PEN_UP diff --git a/tests/auto/inputpanel/tst_inputpanel.cpp b/tests/auto/inputpanel/tst_inputpanel.cpp index 8b84f67b..409383c7 100644 --- a/tests/auto/inputpanel/tst_inputpanel.cpp +++ b/tests/auto/inputpanel/tst_inputpanel.cpp @@ -29,7 +29,22 @@ #include <QtQuickTest/quicktest.h> #include <QByteArray> +#include <QStandardPaths> +#include <QFileInfo> +#include <QDir> static bool s_configEnv = qputenv("QT_IM_MODULE", QByteArray("qtvirtualkeyboard")); +static bool initStandardPaths() { + QStandardPaths::setTestModeEnabled(true); + auto configLocations = QStringList() + << QStandardPaths::writableLocation(QStandardPaths::ConfigLocation) + "/qtvirtualkeyboard" + << QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation) + "/qtvirtualkeyboard"; + for (const QString &configLocation : configLocations) { + if (configLocation != "/qtvirtualkeyboard") + QDir(configLocation).removeRecursively(); + } + return true; +} +static bool s_initStandardPaths = initStandardPaths(); QUICK_TEST_MAIN(inputpanel) |