aboutsummaryrefslogtreecommitdiffstats
path: root/src/virtualkeyboard
diff options
context:
space:
mode:
authorJarkko Koivikko <jarkko.koivikko@code-q.fi>2018-10-08 20:55:36 +0300
committerJarkko Koivikko <jarkko.koivikko@code-q.fi>2018-10-11 08:26:45 +0000
commitca5ee85100306bbfe5746d0dc56e07c534884666 (patch)
tree9bd77d7874a489d6c1c7f5d74e90736aef97032f /src/virtualkeyboard
parent6bcc33aea90d5d725a08b51eda7374a50408ee07 (diff)
t9write: Add Thai handwriting recognition
[ChangeLog] Added Thai handwriting recognition (T9 Write). Change-Id: Idb34fcf07d0318bbca6e6573e5859edb375f205f Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/virtualkeyboard')
-rw-r--r--src/virtualkeyboard/content/components/InputModeKey.qml1
-rw-r--r--src/virtualkeyboard/content/components/Keyboard.qml3
-rw-r--r--src/virtualkeyboard/content/layouts/th_TH/handwriting.qml99
-rw-r--r--src/virtualkeyboard/content/styles/default/style.qml2
-rw-r--r--src/virtualkeyboard/content/styles/retro/style.qml2
-rw-r--r--src/virtualkeyboard/qvirtualkeyboardinputengine.cpp1
-rw-r--r--src/virtualkeyboard/qvirtualkeyboardinputengine.h3
7 files changed, 110 insertions, 1 deletions
diff --git a/src/virtualkeyboard/content/components/InputModeKey.qml b/src/virtualkeyboard/content/components/InputModeKey.qml
index 6ac04422..f7b31b9b 100644
--- a/src/virtualkeyboard/content/components/InputModeKey.qml
+++ b/src/virtualkeyboard/content/components/InputModeKey.qml
@@ -75,6 +75,7 @@ Key {
"中文", // InputEngine.InputMode.ChineseHandwriting
"日本語", // InputEngine.InputMode.JapaneseHandwriting
"한국어", // InputEngine.InputMode.KoreanHandwriting
+ "กขค", // InputEngine.InputMode.Thai
]
/*!
diff --git a/src/virtualkeyboard/content/components/Keyboard.qml b/src/virtualkeyboard/content/components/Keyboard.qml
index 00c7a926..da064820 100644
--- a/src/virtualkeyboard/content/components/Keyboard.qml
+++ b/src/virtualkeyboard/content/components/Keyboard.qml
@@ -1344,6 +1344,9 @@ Item {
// Make sure the current layout is included in the list
if (customInputMethodSharedLayouts.indexOf(layoutType) === -1)
customInputMethodSharedLayouts.push(layoutType)
+
+ // Reset input mode, since inputEngine.inputModes is updated
+ inputModeNeedsReset = true
}
} catch (e) {
console.error(e.message)
diff --git a/src/virtualkeyboard/content/layouts/th_TH/handwriting.qml b/src/virtualkeyboard/content/layouts/th_TH/handwriting.qml
new file mode 100644
index 00000000..428f29fa
--- /dev/null
+++ b/src/virtualkeyboard/content/layouts/th_TH/handwriting.qml
@@ -0,0 +1,99 @@
+/****************************************************************************
+**
+** 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
+
+KeyboardLayout {
+ function createInputMethod() {
+ return Qt.createQmlObject('import QtQuick 2.0; import QtQuick.VirtualKeyboard.Plugins 2.3; HandwritingInputMethod {}', parent)
+ }
+ sharedLayouts: ['symbols']
+
+ KeyboardRow {
+ Layout.preferredHeight: 3
+ KeyboardColumn {
+ Layout.preferredWidth: bottomRow.width - hideKeyboardKey.width
+ KeyboardRow {
+ TraceInputKey {
+ objectName: "hwrInputArea"
+ patternRecognitionMode: InputEngine.PatternRecognitionMode.Handwriting
+ horizontalRulers:
+ InputContext.inputEngine.inputMode !== InputEngine.InputMode.Thai ? [] :
+ [Math.round(boundingBox.height / 4), Math.round(boundingBox.height / 4) * 3]
+ }
+ }
+ }
+ 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_QuoteDbl
+ text: "\""
+ alternativeKeys: "<>()#%&*/\\\"'=+-_"
+ }
+ Key {
+ key: Qt.Key_Period
+ text: "."
+ alternativeKeys: ":;,.?!"
+ }
+ HideKeyboardKey {
+ id: hideKeyboardKey
+ weight: 204
+ }
+ }
+}
diff --git a/src/virtualkeyboard/content/styles/default/style.qml b/src/virtualkeyboard/content/styles/default/style.qml
index d561ac28..095d5fc4 100644
--- a/src/virtualkeyboard/content/styles/default/style.qml
+++ b/src/virtualkeyboard/content/styles/default/style.qml
@@ -792,6 +792,8 @@ KeyboardStyle {
return "日本語"
case InputEngine.InputMode.KoreanHandwriting:
return "한국어"
+ case InputEngine.InputMode.Thai:
+ return "กขค"
default:
return "Abc"
}
diff --git a/src/virtualkeyboard/content/styles/retro/style.qml b/src/virtualkeyboard/content/styles/retro/style.qml
index eb640783..17d2581e 100644
--- a/src/virtualkeyboard/content/styles/retro/style.qml
+++ b/src/virtualkeyboard/content/styles/retro/style.qml
@@ -905,6 +905,8 @@ KeyboardStyle {
return "日本語"
case InputEngine.InputMode.KoreanHandwriting:
return "한국어"
+ case InputEngine.InputMode.Thai:
+ return "กขค"
default:
return "Abc"
}
diff --git a/src/virtualkeyboard/qvirtualkeyboardinputengine.cpp b/src/virtualkeyboard/qvirtualkeyboardinputengine.cpp
index ddc793bf..f6fc03ec 100644
--- a/src/virtualkeyboard/qvirtualkeyboardinputengine.cpp
+++ b/src/virtualkeyboard/qvirtualkeyboardinputengine.cpp
@@ -788,6 +788,7 @@ void QVirtualKeyboardInputEngine::timerEvent(QTimerEvent *timerEvent)
\li \c InputEngine.InputMode.ChineseHandwriting Chinese handwriting.
\li \c InputEngine.InputMode.JapaneseHandwriting Japanese handwriting.
\li \c InputEngine.InputMode.KoreanHandwriting Korean handwriting.
+ \li \c InputEngine.InputMode.Thai Thai input mode.
\endlist
*/
diff --git a/src/virtualkeyboard/qvirtualkeyboardinputengine.h b/src/virtualkeyboard/qvirtualkeyboardinputengine.h
index 29c0eedd..1a0f68d1 100644
--- a/src/virtualkeyboard/qvirtualkeyboardinputengine.h
+++ b/src/virtualkeyboard/qvirtualkeyboardinputengine.h
@@ -83,7 +83,8 @@ public:
Hebrew,
ChineseHandwriting,
JapaneseHandwriting,
- KoreanHandwriting
+ KoreanHandwriting,
+ Thai
};
Q_ENUM(InputMode)