diff options
author | Jarkko Koivikko <jarkko.koivikko@code-q.fi> | 2016-02-19 00:53:05 +0200 |
---|---|---|
committer | Kalle Viironen <kalle.viironen@theqtcompany.com> | 2016-02-22 09:52:03 +0000 |
commit | 1f14cf01ffeca6c10cdcea586cd2b4ac0ad718a6 (patch) | |
tree | 650b003c91faa0f9a79e000d3dc88524c1807832 | |
parent | 4d480f8f0c1ca3308f4c3a423ad30d5d44e9c1bf (diff) |
Update documentation for handwritingv2.0.0
Added some documentation about handwriting support in general.
Change-Id: Ie901a8296020d74c44ce952659615ac8d215616e
Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
-rw-r--r-- | src/virtualkeyboard/content/components/HandwritingModeKey.qml | 3 | ||||
-rw-r--r-- | 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 |