From 61ac14c4d2cabc33e440bd80e3faf4b7a887e136 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Fri, 29 Jan 2016 16:33:35 +0100 Subject: Look for styles in all import paths. The assumption that the QML import path is always last fails for the deployed case, in which the imports are directory under the binaries. Task-number: QTBUG-50730 Change-Id: Iea8b73d78375b6d211095fcb8ecc00e2127f4884 Reviewed-by: Mitch Curtis --- src/virtualkeyboard/virtualkeyboardsettings.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/virtualkeyboard/virtualkeyboardsettings.cpp b/src/virtualkeyboard/virtualkeyboardsettings.cpp index 623034f2..2703d5f6 100644 --- a/src/virtualkeyboard/virtualkeyboardsettings.cpp +++ b/src/virtualkeyboard/virtualkeyboardsettings.cpp @@ -58,10 +58,17 @@ public: { QStringList styleImportPathList; styleImportPathList << "qrc:/QtQuick/Enterprise/VirtualKeyboard/content/styles/"; - QStringList importPathList = engine->importPathList(); - // Add QML import path (Note: the QML base dir is always the last entry in the list) - if (!importPathList.isEmpty()) - styleImportPathList << importPathList.last() + "/QtQuick/Enterprise/VirtualKeyboard/Styles/"; + const QStringList importPathList = engine->importPathList(); + // Add QML import path (Note: the QML base dir is usually the last entry in the list) + for (int i = importPathList.size() - 1; i >= 0; --i) { + const QString stylesPath = importPathList.at(i) + + QStringLiteral("/QtQuick/Enterprise/VirtualKeyboard/Styles/"); + if (QFileInfo(stylesPath).isDir()) { + styleImportPathList += stylesPath; + break; + } + } + foreach (const QString &styleImportPath, styleImportPathList) { QString filePath = buildStyleFilePath(styleImportPath, name); bool pathExist = false; -- cgit v1.2.3 From 214dc00d3e40fddba8acb2ea602aba705b1e3c81 Mon Sep 17 00:00:00 2001 From: Liang Qi Date: Wed, 10 Feb 2016 11:03:05 +0100 Subject: Should display the name of current keyboard Change-Id: I566bedd94dd14250f306c594c19ddae06ca1443f Reviewed-by: Rainer Keller Reviewed-by: Mitch Curtis --- src/virtualkeyboard/content/layouts/zh_TW/main.qml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/virtualkeyboard/content/layouts/zh_TW/main.qml b/src/virtualkeyboard/content/layouts/zh_TW/main.qml index b9d75836..76b989ab 100644 --- a/src/virtualkeyboard/content/layouts/zh_TW/main.qml +++ b/src/virtualkeyboard/content/layouts/zh_TW/main.qml @@ -191,7 +191,8 @@ KeyboardLayoutLoader { } ModeKey { visible: InputContext.inputEngine.inputModes.indexOf(InputEngine.Zhuyin) !== -1 - displayText: "\u6CE8\u97F3" + // Cangjie + displayText: "\u5009\u9821" onClicked: InputContext.inputEngine.inputMode = InputEngine.Zhuyin } SpaceKey { @@ -416,7 +417,8 @@ KeyboardLayoutLoader { } ModeKey { visible: InputContext.inputEngine.inputModes.indexOf(InputEngine.Cangjie) !== -1 - displayText: "\u5009\u9821" + // Zhuyin + displayText: "\u6CE8\u97F3" onClicked: InputContext.inputEngine.inputMode = InputEngine.Cangjie } SpaceKey { -- cgit v1.2.3 From f3b7d334f3e2c042f937d581b1c2edbfad12459a Mon Sep 17 00:00:00 2001 From: Jarkko Koivikko Date: Tue, 16 Feb 2016 21:58:53 +0200 Subject: Fix language switch for handwriting keyboard layout Handwriting layout uses ChangeLanguageKey with customLayoutsOnly attribute to filter out languages which does not have handwriting layout. By default the customLayoutsOnly attribute filters out the base layout (English) if it's not the current language. This functionality exists for the special layouts, such as the numbers layout, to prevent language switch between the languages where the layout does not change. However, for handwriting the input language is significant and it should be possible to switch between all the languages which contain handwriting layout. This change adds an exception for the no-base-layout rule and includes English handwriting layout in the custom layout list. Change-Id: I58449c18b20c2643f5cc905163acefe11fd1fa6c Reviewed-by: Rainer Keller --- src/virtualkeyboard/content/components/Keyboard.qml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/virtualkeyboard/content/components/Keyboard.qml b/src/virtualkeyboard/content/components/Keyboard.qml index 240e5233..29eed63b 100644 --- a/src/virtualkeyboard/content/components/Keyboard.qml +++ b/src/virtualkeyboard/content/components/Keyboard.qml @@ -1004,7 +1004,10 @@ Item { // Update list of custom locale indices newIndices = [] for (i = 0; i < availableLocaleIndices.length; i++) { - if (availableLocaleIndices[i] === localeIndex || (availableLocaleIndices[i] !== baseLayoutIndex && layoutExists(layoutsModel.get(availableLocaleIndices[i], "fileName"), layoutType))) + if (availableLocaleIndices[i] === localeIndex || + ((availableLocaleIndices[i] !== baseLayoutIndex || + (layoutType === "handwriting" && availableLocaleIndices.indexOf(baseLayoutIndex) !== -1)) && + layoutExists(layoutsModel.get(availableLocaleIndices[i], "fileName"), layoutType))) newIndices.push(availableLocaleIndices[i]) } availableCustomLocaleIndices = newIndices -- cgit v1.2.3 From a08d37af789c5ea837ee2841cc37b9e0c2d62e63 Mon Sep 17 00:00:00 2001 From: Jarkko Koivikko Date: Wed, 17 Feb 2016 21:56:47 +0200 Subject: t9write: Fix condition whether the language is supported The condition checks for the wrong variable, thus does not work as expected. An obvious copy paste error. Change-Id: I1f53ed3d8173377704454102f4d63cd6c1aff857 Reviewed-by: Rainer Keller --- src/virtualkeyboard/t9writeinputmethod.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/virtualkeyboard/t9writeinputmethod.cpp b/src/virtualkeyboard/t9writeinputmethod.cpp index b557a730..d3490ad5 100644 --- a/src/virtualkeyboard/t9writeinputmethod.cpp +++ b/src/virtualkeyboard/t9writeinputmethod.cpp @@ -288,7 +288,7 @@ public: int isLanguageSupported = 0; decumaDatabaseIsLanguageSupported(sessionSettings.pStaticDB, language, &isLanguageSupported); - if (language == DECUMA_LANG_GSMDEFAULT) { + if (!isLanguageSupported) { qWarning() << "Handwriting input does not support the language" << locale.name(); return false; } -- cgit v1.2.3 From 0c626ef9ba27b777e19f19e4ba9722f9d510af05 Mon Sep 17 00:00:00 2001 From: Jarkko Koivikko Date: Wed, 17 Feb 2016 22:09:27 +0200 Subject: t9write: Fix Spanish character sets Include inverted question / exclamation mark in the character sets for Spanish language. Change-Id: I8f56a4e5ec8013a4006f3c4e9266fdb0a5f742f9 Reviewed-by: Rainer Keller --- src/virtualkeyboard/t9writeinputmethod.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/virtualkeyboard/t9writeinputmethod.cpp b/src/virtualkeyboard/t9writeinputmethod.cpp index d3490ad5..a2f45c18 100644 --- a/src/virtualkeyboard/t9writeinputmethod.cpp +++ b/src/virtualkeyboard/t9writeinputmethod.cpp @@ -338,6 +338,9 @@ public: symbolCategories.append(DECUMA_CATEGORY_BASIC_PUNCTUATIONS); symbolCategories.append(DECUMA_CATEGORY_CONTRACTION_MARK); } + + if (language == DECUMA_LANG_ES) + symbolCategories.append(DECUMA_CATEGORY_SPANISH_PUNCTUATIONS); } break; -- cgit v1.2.3 From 4d480f8f0c1ca3308f4c3a423ad30d5d44e9c1bf Mon Sep 17 00:00:00 2001 From: Jarkko Koivikko Date: Tue, 16 Feb 2016 20:47:35 +0200 Subject: Enable new languages for handwriting recognition Note: These languages are only available with the T9 Write engine. This change adds handwriting recognition for the following languages: - Danish - German - Spanish - Finnish - French - Italian - Norwegian - Polish - Portuguese - Russian - Swedish Change-Id: I686d15bb89acc7012aaba73e271640426b73649e Reviewed-by: Rainer Keller --- .../content/layouts/da_DK/handwriting.qml | 96 ++++++++++++++++++++++ src/virtualkeyboard/content/layouts/da_DK/main.qml | 3 + .../content/layouts/de_DE/handwriting.qml | 96 ++++++++++++++++++++++ src/virtualkeyboard/content/layouts/de_DE/main.qml | 3 + .../content/layouts/es_ES/handwriting.qml | 96 ++++++++++++++++++++++ src/virtualkeyboard/content/layouts/es_ES/main.qml | 3 + .../content/layouts/fi_FI/handwriting.qml | 96 ++++++++++++++++++++++ src/virtualkeyboard/content/layouts/fi_FI/main.qml | 3 + .../content/layouts/fr_FR/handwriting.qml | 96 ++++++++++++++++++++++ src/virtualkeyboard/content/layouts/fr_FR/main.qml | 3 + .../content/layouts/it_IT/handwriting.qml | 96 ++++++++++++++++++++++ src/virtualkeyboard/content/layouts/it_IT/main.qml | 3 + .../content/layouts/nb_NO/handwriting.qml | 96 ++++++++++++++++++++++ src/virtualkeyboard/content/layouts/nb_NO/main.qml | 3 + .../content/layouts/pl_PL/handwriting.qml | 96 ++++++++++++++++++++++ src/virtualkeyboard/content/layouts/pl_PL/main.qml | 3 + .../content/layouts/pt_PT/handwriting.qml | 96 ++++++++++++++++++++++ src/virtualkeyboard/content/layouts/pt_PT/main.qml | 3 + .../content/layouts/ru_RU/handwriting.qml | 96 ++++++++++++++++++++++ src/virtualkeyboard/content/layouts/ru_RU/main.qml | 3 + .../content/layouts/sv_SE/handwriting.qml | 96 ++++++++++++++++++++++ src/virtualkeyboard/content/layouts/sv_SE/main.qml | 3 + src/virtualkeyboard/virtualkeyboard.pro | 22 +++++ 23 files changed, 1111 insertions(+) create mode 100644 src/virtualkeyboard/content/layouts/da_DK/handwriting.qml create mode 100644 src/virtualkeyboard/content/layouts/de_DE/handwriting.qml create mode 100644 src/virtualkeyboard/content/layouts/es_ES/handwriting.qml create mode 100644 src/virtualkeyboard/content/layouts/fi_FI/handwriting.qml create mode 100644 src/virtualkeyboard/content/layouts/fr_FR/handwriting.qml create mode 100644 src/virtualkeyboard/content/layouts/it_IT/handwriting.qml create mode 100644 src/virtualkeyboard/content/layouts/nb_NO/handwriting.qml create mode 100644 src/virtualkeyboard/content/layouts/pl_PL/handwriting.qml create mode 100644 src/virtualkeyboard/content/layouts/pt_PT/handwriting.qml create mode 100644 src/virtualkeyboard/content/layouts/ru_RU/handwriting.qml create mode 100644 src/virtualkeyboard/content/layouts/sv_SE/handwriting.qml diff --git a/src/virtualkeyboard/content/layouts/da_DK/handwriting.qml b/src/virtualkeyboard/content/layouts/da_DK/handwriting.qml new file mode 100644 index 00000000..1a505e7e --- /dev/null +++ b/src/virtualkeyboard/content/layouts/da_DK/handwriting.qml @@ -0,0 +1,96 @@ +/****************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Virtual Keyboard module. +** +** $QT_BEGIN_LICENSE:COMM$ +** +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** $QT_END_LICENSE$ +** +******************************************************************************/ + +import QtQuick 2.0 +import QtQuick.Layouts 1.0 +import QtQuick.Enterprise.VirtualKeyboard 2.0 + +KeyboardLayout { + function createInputMethod() { + return Qt.createQmlObject('import QtQuick 2.0; import QtQuick.Enterprise.VirtualKeyboard 2.0; 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 + 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 + 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/main.qml b/src/virtualkeyboard/content/layouts/da_DK/main.qml index 9bcfd0da..a18f9ec2 100644 --- a/src/virtualkeyboard/content/layouts/da_DK/main.qml +++ b/src/virtualkeyboard/content/layouts/da_DK/main.qml @@ -185,6 +185,9 @@ KeyboardLayout { ChangeLanguageKey { weight: 154 } + HandwritingModeKey { + weight: 154 + } SpaceKey { weight: 864 } diff --git a/src/virtualkeyboard/content/layouts/de_DE/handwriting.qml b/src/virtualkeyboard/content/layouts/de_DE/handwriting.qml new file mode 100644 index 00000000..1a505e7e --- /dev/null +++ b/src/virtualkeyboard/content/layouts/de_DE/handwriting.qml @@ -0,0 +1,96 @@ +/****************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Virtual Keyboard module. +** +** $QT_BEGIN_LICENSE:COMM$ +** +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** $QT_END_LICENSE$ +** +******************************************************************************/ + +import QtQuick 2.0 +import QtQuick.Layouts 1.0 +import QtQuick.Enterprise.VirtualKeyboard 2.0 + +KeyboardLayout { + function createInputMethod() { + return Qt.createQmlObject('import QtQuick 2.0; import QtQuick.Enterprise.VirtualKeyboard 2.0; 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 + 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 + 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/de_DE/main.qml b/src/virtualkeyboard/content/layouts/de_DE/main.qml index 80bace38..93cda760 100644 --- a/src/virtualkeyboard/content/layouts/de_DE/main.qml +++ b/src/virtualkeyboard/content/layouts/de_DE/main.qml @@ -180,6 +180,9 @@ KeyboardLayout { ChangeLanguageKey { weight: 154 } + HandwritingModeKey { + weight: 154 + } SpaceKey { weight: 864 } diff --git a/src/virtualkeyboard/content/layouts/es_ES/handwriting.qml b/src/virtualkeyboard/content/layouts/es_ES/handwriting.qml new file mode 100644 index 00000000..0bdab338 --- /dev/null +++ b/src/virtualkeyboard/content/layouts/es_ES/handwriting.qml @@ -0,0 +1,96 @@ +/****************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Virtual Keyboard module. +** +** $QT_BEGIN_LICENSE:COMM$ +** +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** $QT_END_LICENSE$ +** +******************************************************************************/ + +import QtQuick 2.0 +import QtQuick.Layouts 1.0 +import QtQuick.Enterprise.VirtualKeyboard 2.0 + +KeyboardLayout { + function createInputMethod() { + return Qt.createQmlObject('import QtQuick 2.0; import QtQuick.Enterprise.VirtualKeyboard 2.0; 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 + 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 + 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/es_ES/main.qml b/src/virtualkeyboard/content/layouts/es_ES/main.qml index d3bed3b3..1826fbdc 100644 --- a/src/virtualkeyboard/content/layouts/es_ES/main.qml +++ b/src/virtualkeyboard/content/layouts/es_ES/main.qml @@ -180,6 +180,9 @@ KeyboardLayout { ChangeLanguageKey { weight: 154 } + HandwritingModeKey { + weight: 154 + } SpaceKey { weight: 864 } diff --git a/src/virtualkeyboard/content/layouts/fi_FI/handwriting.qml b/src/virtualkeyboard/content/layouts/fi_FI/handwriting.qml new file mode 100644 index 00000000..1a505e7e --- /dev/null +++ b/src/virtualkeyboard/content/layouts/fi_FI/handwriting.qml @@ -0,0 +1,96 @@ +/****************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Virtual Keyboard module. +** +** $QT_BEGIN_LICENSE:COMM$ +** +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** $QT_END_LICENSE$ +** +******************************************************************************/ + +import QtQuick 2.0 +import QtQuick.Layouts 1.0 +import QtQuick.Enterprise.VirtualKeyboard 2.0 + +KeyboardLayout { + function createInputMethod() { + return Qt.createQmlObject('import QtQuick 2.0; import QtQuick.Enterprise.VirtualKeyboard 2.0; 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 + 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 + 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/main.qml b/src/virtualkeyboard/content/layouts/fi_FI/main.qml index 274229c5..1f6fa8a3 100644 --- a/src/virtualkeyboard/content/layouts/fi_FI/main.qml +++ b/src/virtualkeyboard/content/layouts/fi_FI/main.qml @@ -179,6 +179,9 @@ KeyboardLayout { ChangeLanguageKey { weight: 154 } + HandwritingModeKey { + weight: 154 + } SpaceKey { weight: 864 } diff --git a/src/virtualkeyboard/content/layouts/fr_FR/handwriting.qml b/src/virtualkeyboard/content/layouts/fr_FR/handwriting.qml new file mode 100644 index 00000000..1a505e7e --- /dev/null +++ b/src/virtualkeyboard/content/layouts/fr_FR/handwriting.qml @@ -0,0 +1,96 @@ +/****************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Virtual Keyboard module. +** +** $QT_BEGIN_LICENSE:COMM$ +** +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** $QT_END_LICENSE$ +** +******************************************************************************/ + +import QtQuick 2.0 +import QtQuick.Layouts 1.0 +import QtQuick.Enterprise.VirtualKeyboard 2.0 + +KeyboardLayout { + function createInputMethod() { + return Qt.createQmlObject('import QtQuick 2.0; import QtQuick.Enterprise.VirtualKeyboard 2.0; 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 + 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 + 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/main.qml b/src/virtualkeyboard/content/layouts/fr_FR/main.qml index 8a568726..6534fffa 100644 --- a/src/virtualkeyboard/content/layouts/fr_FR/main.qml +++ b/src/virtualkeyboard/content/layouts/fr_FR/main.qml @@ -174,6 +174,9 @@ KeyboardLayout { ChangeLanguageKey { weight: 154 } + HandwritingModeKey { + weight: 154 + } SpaceKey { weight: 864 } diff --git a/src/virtualkeyboard/content/layouts/it_IT/handwriting.qml b/src/virtualkeyboard/content/layouts/it_IT/handwriting.qml new file mode 100644 index 00000000..1a505e7e --- /dev/null +++ b/src/virtualkeyboard/content/layouts/it_IT/handwriting.qml @@ -0,0 +1,96 @@ +/****************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Virtual Keyboard module. +** +** $QT_BEGIN_LICENSE:COMM$ +** +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** $QT_END_LICENSE$ +** +******************************************************************************/ + +import QtQuick 2.0 +import QtQuick.Layouts 1.0 +import QtQuick.Enterprise.VirtualKeyboard 2.0 + +KeyboardLayout { + function createInputMethod() { + return Qt.createQmlObject('import QtQuick 2.0; import QtQuick.Enterprise.VirtualKeyboard 2.0; 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 + 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 + 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/main.qml b/src/virtualkeyboard/content/layouts/it_IT/main.qml index f168adcd..78a0a2e4 100644 --- a/src/virtualkeyboard/content/layouts/it_IT/main.qml +++ b/src/virtualkeyboard/content/layouts/it_IT/main.qml @@ -168,6 +168,9 @@ KeyboardLayout { ChangeLanguageKey { weight: 154 } + HandwritingModeKey { + weight: 154 + } SpaceKey { weight: 864 } diff --git a/src/virtualkeyboard/content/layouts/nb_NO/handwriting.qml b/src/virtualkeyboard/content/layouts/nb_NO/handwriting.qml new file mode 100644 index 00000000..1a505e7e --- /dev/null +++ b/src/virtualkeyboard/content/layouts/nb_NO/handwriting.qml @@ -0,0 +1,96 @@ +/****************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Virtual Keyboard module. +** +** $QT_BEGIN_LICENSE:COMM$ +** +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** $QT_END_LICENSE$ +** +******************************************************************************/ + +import QtQuick 2.0 +import QtQuick.Layouts 1.0 +import QtQuick.Enterprise.VirtualKeyboard 2.0 + +KeyboardLayout { + function createInputMethod() { + return Qt.createQmlObject('import QtQuick 2.0; import QtQuick.Enterprise.VirtualKeyboard 2.0; 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 + 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 + 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/main.qml b/src/virtualkeyboard/content/layouts/nb_NO/main.qml index 83935206..cd009976 100644 --- a/src/virtualkeyboard/content/layouts/nb_NO/main.qml +++ b/src/virtualkeyboard/content/layouts/nb_NO/main.qml @@ -185,6 +185,9 @@ KeyboardLayout { ChangeLanguageKey { weight: 154 } + HandwritingModeKey { + weight: 154 + } SpaceKey { weight: 864 } diff --git a/src/virtualkeyboard/content/layouts/pl_PL/handwriting.qml b/src/virtualkeyboard/content/layouts/pl_PL/handwriting.qml new file mode 100644 index 00000000..1a505e7e --- /dev/null +++ b/src/virtualkeyboard/content/layouts/pl_PL/handwriting.qml @@ -0,0 +1,96 @@ +/****************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Virtual Keyboard module. +** +** $QT_BEGIN_LICENSE:COMM$ +** +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** $QT_END_LICENSE$ +** +******************************************************************************/ + +import QtQuick 2.0 +import QtQuick.Layouts 1.0 +import QtQuick.Enterprise.VirtualKeyboard 2.0 + +KeyboardLayout { + function createInputMethod() { + return Qt.createQmlObject('import QtQuick 2.0; import QtQuick.Enterprise.VirtualKeyboard 2.0; 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 + 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 + 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/main.qml b/src/virtualkeyboard/content/layouts/pl_PL/main.qml index e03f8e1d..a8ebfa4c 100644 --- a/src/virtualkeyboard/content/layouts/pl_PL/main.qml +++ b/src/virtualkeyboard/content/layouts/pl_PL/main.qml @@ -172,6 +172,9 @@ KeyboardLayout { ChangeLanguageKey { weight: 154 } + HandwritingModeKey { + weight: 154 + } SpaceKey { weight: 864 } diff --git a/src/virtualkeyboard/content/layouts/pt_PT/handwriting.qml b/src/virtualkeyboard/content/layouts/pt_PT/handwriting.qml new file mode 100644 index 00000000..1a505e7e --- /dev/null +++ b/src/virtualkeyboard/content/layouts/pt_PT/handwriting.qml @@ -0,0 +1,96 @@ +/****************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Virtual Keyboard module. +** +** $QT_BEGIN_LICENSE:COMM$ +** +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** $QT_END_LICENSE$ +** +******************************************************************************/ + +import QtQuick 2.0 +import QtQuick.Layouts 1.0 +import QtQuick.Enterprise.VirtualKeyboard 2.0 + +KeyboardLayout { + function createInputMethod() { + return Qt.createQmlObject('import QtQuick 2.0; import QtQuick.Enterprise.VirtualKeyboard 2.0; 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 + 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 + 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/main.qml b/src/virtualkeyboard/content/layouts/pt_PT/main.qml index 6585f292..55369bf9 100644 --- a/src/virtualkeyboard/content/layouts/pt_PT/main.qml +++ b/src/virtualkeyboard/content/layouts/pt_PT/main.qml @@ -177,6 +177,9 @@ KeyboardLayout { ChangeLanguageKey { weight: 154 } + HandwritingModeKey { + weight: 154 + } SpaceKey { weight: 864 } diff --git a/src/virtualkeyboard/content/layouts/ru_RU/handwriting.qml b/src/virtualkeyboard/content/layouts/ru_RU/handwriting.qml new file mode 100644 index 00000000..1a505e7e --- /dev/null +++ b/src/virtualkeyboard/content/layouts/ru_RU/handwriting.qml @@ -0,0 +1,96 @@ +/****************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Virtual Keyboard module. +** +** $QT_BEGIN_LICENSE:COMM$ +** +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** $QT_END_LICENSE$ +** +******************************************************************************/ + +import QtQuick 2.0 +import QtQuick.Layouts 1.0 +import QtQuick.Enterprise.VirtualKeyboard 2.0 + +KeyboardLayout { + function createInputMethod() { + return Qt.createQmlObject('import QtQuick 2.0; import QtQuick.Enterprise.VirtualKeyboard 2.0; 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 + 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 + 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/main.qml b/src/virtualkeyboard/content/layouts/ru_RU/main.qml index f44bbdb3..9b487c57 100644 --- a/src/virtualkeyboard/content/layouts/ru_RU/main.qml +++ b/src/virtualkeyboard/content/layouts/ru_RU/main.qml @@ -183,6 +183,9 @@ KeyboardLayout { ChangeLanguageKey { weight: 154 } + HandwritingModeKey { + weight: 154 + } SpaceKey { weight: 864 } diff --git a/src/virtualkeyboard/content/layouts/sv_SE/handwriting.qml b/src/virtualkeyboard/content/layouts/sv_SE/handwriting.qml new file mode 100644 index 00000000..1a505e7e --- /dev/null +++ b/src/virtualkeyboard/content/layouts/sv_SE/handwriting.qml @@ -0,0 +1,96 @@ +/****************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Virtual Keyboard module. +** +** $QT_BEGIN_LICENSE:COMM$ +** +** 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 http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** $QT_END_LICENSE$ +** +******************************************************************************/ + +import QtQuick 2.0 +import QtQuick.Layouts 1.0 +import QtQuick.Enterprise.VirtualKeyboard 2.0 + +KeyboardLayout { + function createInputMethod() { + return Qt.createQmlObject('import QtQuick 2.0; import QtQuick.Enterprise.VirtualKeyboard 2.0; 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 + 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 + 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/main.qml b/src/virtualkeyboard/content/layouts/sv_SE/main.qml index 274229c5..1f6fa8a3 100644 --- a/src/virtualkeyboard/content/layouts/sv_SE/main.qml +++ b/src/virtualkeyboard/content/layouts/sv_SE/main.qml @@ -179,6 +179,9 @@ KeyboardLayout { ChangeLanguageKey { weight: 154 } + HandwritingModeKey { + weight: 154 + } SpaceKey { weight: 864 } diff --git a/src/virtualkeyboard/virtualkeyboard.pro b/src/virtualkeyboard/virtualkeyboard.pro index 515b1157..e0182777 100644 --- a/src/virtualkeyboard/virtualkeyboard.pro +++ b/src/virtualkeyboard/virtualkeyboard.pro @@ -81,16 +81,22 @@ contains(CONFIG, lang-da.*) { LAYOUT_FILES += \ content/layouts/da_DK/main.qml \ content/layouts/da_DK/symbols.qml +t9write: LAYOUT_FILES += \ + content/layouts/da_DK/handwriting.qml } contains(CONFIG, lang-de.*) { LAYOUT_FILES += \ content/layouts/de_DE/main.qml \ content/layouts/de_DE/symbols.qml +t9write: LAYOUT_FILES += \ + content/layouts/de_DE/handwriting.qml } contains(CONFIG, lang-es.*) { LAYOUT_FILES += \ content/layouts/es_ES/main.qml \ content/layouts/es_ES/symbols.qml +t9write: LAYOUT_FILES += \ + content/layouts/es_ES/handwriting.qml } contains(CONFIG, lang-fa.*) { LAYOUT_FILES += \ @@ -103,11 +109,15 @@ contains(CONFIG, lang-fi.*) { LAYOUT_FILES += \ content/layouts/fi_FI/main.qml \ content/layouts/fi_FI/symbols.qml +t9write: LAYOUT_FILES += \ + content/layouts/fi_FI/handwriting.qml } contains(CONFIG, lang-fr.*) { LAYOUT_FILES += \ content/layouts/fr_FR/main.qml \ content/layouts/fr_FR/symbols.qml +t9write: LAYOUT_FILES += \ + content/layouts/fr_FR/handwriting.qml } contains(CONFIG, lang-hi.*) { LAYOUT_FILES += \ @@ -118,6 +128,8 @@ contains(CONFIG, lang-it.*) { LAYOUT_FILES += \ content/layouts/it_IT/main.qml \ content/layouts/it_IT/symbols.qml +t9write: LAYOUT_FILES += \ + content/layouts/it_IT/handwriting.qml } contains(CONFIG, lang-ja.*) { LAYOUT_FILES += \ @@ -133,26 +145,36 @@ contains(CONFIG, lang-nb.*) { LAYOUT_FILES += \ content/layouts/nb_NO/main.qml \ content/layouts/nb_NO/symbols.qml +t9write: LAYOUT_FILES += \ + content/layouts/nb_NO/handwriting.qml } contains(CONFIG, lang-pl.*) { LAYOUT_FILES += \ content/layouts/pl_PL/main.qml \ content/layouts/pl_PL/symbols.qml +t9write: LAYOUT_FILES += \ + content/layouts/pl_PL/handwriting.qml } contains(CONFIG, lang-pt.*) { LAYOUT_FILES += \ content/layouts/pt_PT/main.qml \ content/layouts/pt_PT/symbols.qml +t9write: LAYOUT_FILES += \ + content/layouts/pt_PT/handwriting.qml } contains(CONFIG, lang-ru.*) { LAYOUT_FILES += \ content/layouts/ru_RU/main.qml \ content/layouts/ru_RU/symbols.qml +t9write: LAYOUT_FILES += \ + content/layouts/ru_RU/handwriting.qml } contains(CONFIG, lang-sv.*) { LAYOUT_FILES += \ content/layouts/sv_SE/main.qml \ content/layouts/sv_SE/symbols.qml +t9write: LAYOUT_FILES += \ + content/layouts/sv_SE/handwriting.qml } contains(CONFIG, lang-zh(_CN)?) { LAYOUT_FILES += \ -- cgit v1.2.3 From 1f14cf01ffeca6c10cdcea586cd2b4ac0ad718a6 Mon Sep 17 00:00:00 2001 From: Jarkko Koivikko Date: Fri, 19 Feb 2016 00:53:05 +0200 Subject: Update documentation for handwriting Added some documentation about handwriting support in general. Change-Id: Ie901a8296020d74c44ce952659615ac8d215616e Reviewed-by: Mitch Curtis --- .../content/components/HandwritingModeKey.qml | 3 ++ src/virtualkeyboard/doc/src/technical-guide.qdoc | 47 ++++++++++++++++++++-- 2 files changed, 47 insertions(+), 3 deletions(-) diff --git a/src/virtualkeyboard/content/components/HandwritingModeKey.qml b/src/virtualkeyboard/content/components/HandwritingModeKey.qml index 4440eb2b..8d8d7948 100644 --- a/src/virtualkeyboard/content/components/HandwritingModeKey.qml +++ b/src/virtualkeyboard/content/components/HandwritingModeKey.qml @@ -31,6 +31,9 @@ import QtQuick 2.0 \brief Hand writing mode key for keyboard layouts. This key toggles between the handwriting mode layout and the main layout. + + The key is automatically hidden from the keyboard layout if handwriting support + is not enabled for the virtual keyboard. */ Key { diff --git a/src/virtualkeyboard/doc/src/technical-guide.qdoc b/src/virtualkeyboard/doc/src/technical-guide.qdoc index ddc6b1d3..4a570638 100644 --- a/src/virtualkeyboard/doc/src/technical-guide.qdoc +++ b/src/virtualkeyboard/doc/src/technical-guide.qdoc @@ -272,13 +272,35 @@ InputEngine::wordCandidateListModel property. Since version 2.0 of the virtual keyboard, input methods can consume touch input data from touch screens or other input devices. +Handwriting recognition works on the same principle as handling of +normal keyboard input, i.e. input data is collected by the keyboard layout +and transferred by the input engine to the input method for further processing. + +In case of a regular keyboard, the amount of data transferred from the keyboard +to input method is minimal (namely the keycode and text), but in the case of +handwriting recognition the data volume is much bigger. Therefore, the touch +input is stored in a particular data model. + +The input method does not participate in the actual collection of touch data. +However, the input method has full control over touch input since it can +either accept or reject touch. This allows for precise control over how many +fingers can be used simultaneously. + +The input method can collect as many traces as it deems necessary and begin +processing them at will. The processing can even be performed in parallel with +the touch input, although it is not recommended because of the potential side +effects. A recommended way is to start processing in a background thread +after a suitable delay, so that it does not negatively affect the performance +of the user interface. + \section2 Data Model for the Handwriting Input The data collected from the input source is stored in an object named QtVirtualKeyboard::Trace (C++) or \l Trace (QML). -By definition, a trace is a set of points collected from a single point of contact. -In addition to point data, the trace may also include data from other channels, -such as the time for each data point. +By definition, \e trace is a set of data collected in one touch. In addition to +the basic coordinate data, it can also include other types of data, such as +the time of each data point. The input method can define the desired input channels +at the beginning of a touch event. \section2 Trace API for Input Methods @@ -508,6 +530,25 @@ For example: } \endcode +\section2 Handwriting Keyboard Layout + +Each language which supports handwriting recognition must provide a +special keyboard layout named \e handwriting.qml. + +This type of keyboard layout must meet the following requirements: +\list +\li contains a TraceInputKey in the keyboard layout +\li provides an instance of HandwritingInputMethod as the input method. +\endlist + +The handwriting layout may also include ChangeLanguageKey. For this purpose, it is +important to use the \l {ChangeLanguageKey::customLayoutsOnly} {customLayoutsOnly} attribute, which will filter out languages +that do not use handwriting. + +Both the main and handwriting layouts should contain a key to activate +and deactivate the handwriting input mode. This can be done by adding a +HandwritingModeKey to the layout. + \section1 Keyboard Styles The virtual keyboard styling system supports built-in styles as well -- cgit v1.2.3