diff options
author | Jarkko Koivikko <jarkko.koivikko@code-q.fi> | 2015-02-12 10:07:00 +0200 |
---|---|---|
committer | Jarkko Koivikko <jarkko.koivikko@code-q.fi> | 2015-06-17 12:33:42 +0300 |
commit | 28cf4492839f598a3058d40feab37a3274a02771 (patch) | |
tree | b219ffa5c0679f8f99e454d65be5103c900ea14a /src/virtualkeyboard/doc/src | |
parent | d0ded0ea4a0f322fe1fd54348ad0e0b4ae74a1af (diff) |
Add support for pattern recognition based input methods
This change adds generic support for pattern recognition
based input methods.
Added new API for the input engine and input method to
process trace data. The trace data can originate from
various input devices, e.g. from touch screen or from
a dedicated hardware touch panel.
Added new data model type for trace supporting both the C++
and QML interfaces. The new data model is DeclarativeTrace
and Trace respectively, and it stores the trace data captured
from the input device.
The trace object is owned by the input method and is accessible
to the UI layer, capture device and the input method.
First, when the trace event begins, the capture device invokes
the InputEngine.traceBegin(). The input engine forwards this
call to the input method, which creates the trace object in
response to successful call.
Then the capture device receives the trace object and starts
collecting the data. Also, in case of touch screen input, there
are also the UI layer which renders the data. For this purpose
there are new kinds of Style elements available in the Styles
plugin. TraceCanvas is a specialized Canvas for rendering the
trace object on screen. The TraceCanvas is a normal styling
component, and can be customized like any other style element.
Finally, the InputMethod.traceEnd() is called when the trace
interaction ends. The trace is removed from screen automatically
when the trace object is deleted. I.e., the input method has
full control on how many traces it wants to collect for single
recognition phase.
Change-Id: I80ed90032f715726280197d9e94e7f0bd8280ff3
Reviewed-by: Gatis Paeglis <gatis.paeglis@theqtcompany.com>
Diffstat (limited to 'src/virtualkeyboard/doc/src')
-rw-r--r-- | src/virtualkeyboard/doc/src/technical-guide.qdoc | 46 |
1 files changed, 45 insertions, 1 deletions
diff --git a/src/virtualkeyboard/doc/src/technical-guide.qdoc b/src/virtualkeyboard/doc/src/technical-guide.qdoc index ba9224d3..35e58245 100644 --- a/src/virtualkeyboard/doc/src/technical-guide.qdoc +++ b/src/virtualkeyboard/doc/src/technical-guide.qdoc @@ -264,6 +264,47 @@ to hide the list if necessary. The list model's word candidate list is provided by the InputEngine::wordCandidateListModel property. +\section1 Integrating Handwriting Recognition + +Since the version 1.4 of the virtual keyboard, the input methods can consume +touch input data from touch screen or other input device. + +\section2 Data Model for the Handwriting Input + +The data collected from the input source is stored in an object named DeclarativeTrace (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. + +\section2 Trace API for Input Method + +The trace API consists of the following virtual methods, which the input method +must implement in order to receive and process touch input data. + +\list + \li \l { AbstractInputMethod::patternRecognitionModes } { patternRecognitionModes } + \li \l { AbstractInputMethod::traceBegin } { traceBegin } + \li \l { AbstractInputMethod::traceEnd } { traceEnd } +\endlist + +By implementing these methods, the input method can receive and process the data +from variety of input sources. + +The patternRecognitionModes method returns a list of pattern recognition modes, +which are supported by the input method. A pattern recognition mode, such as the +\l { DeclarativeInputEngine::HandwritingRecoginition } { HandwritingRecoginition }, +defines the method by which the input method processes the data. + +The trace interaction is started when an input source detects a new contact point, and +calls the traceBegin method for a new trace object. If the input method accepts the +interaction, it creates a new trace object and returns it to the caller. From this point +on, the data is collected to the trace until the traceEnd method is called. + +When the traceEnd method is called, the input method may begin processing of the data +contained in the trace object. After processing the data the input method should destroy +the object. This also removes the trace rendered to the screen. + \section1 Keyboard Layouts Keyboard layouts are located in the \e src/virtualkeyboard/content/layouts @@ -275,7 +316,7 @@ uppercase, two or three-letter ISO 3166 country code. \section2 Layout Types Different keyboard layout types are used in different input modes. The default -layout which is used for reqular text input, is called the "main" layout. +layout which is used for regular text input, is called the "main" layout. The layout type is determined by the layout file name. Therefore, the "main" layout file is called the "main.qml". @@ -287,6 +328,7 @@ List of supported layout types: \li \c numbers Numeric layout for formatted numbers (activated by Qt::ImhFormattedNumbersOnly) \li \c digits Digits only layout (activated by Qt::ImhDigitsOnly) \li \c dialpad Dialpad layout for phone number input (activated by Qt::ImhDialableCharactersOnly) + \li \c handwriting Handwriting layout for handwriting recognition (activated from main layout) \endlist \section2 Adding New Keyboard Layouts @@ -328,6 +370,8 @@ specialized key types. Below is the list of all key types: \li \l ShiftKey \li \l SpaceKey \li \l SymbolModeKey + \li \l HandwritingModeKey + \li \l TraceInputKey \endlist For example, to add a regular key which sends a key event to the input method: |