InputMethod QML Type
Base type for creating input method in QML. More...
Import Statement: | import QtQuick.VirtualKeyboard 2.0 |
Properties
- inputContext : InputContext
- inputEngine : InputEngine
Signals
- selectionListActiveItemChanged(int type, int index)
- selectionListChanged(int type)
Methods
- list<int> inputModes(string locale)
- bool keyEvent(int key, string text, int modifiers)
- list<int> patternRecognitionModes()
- bool reselect(int cursorPosition, int reselectFlags)
- reset()
- var selectionListData(int type, int index, int role)
- int selectionListItemCount(int type)
- void selectionListItemSelected(int type, int index)
- list<int> selectionLists()
- bool setInputMode(string locale, int inputMode)
- bool setTextCase(int textCase)
- Trace traceBegin(int traceId, int patternRecognitionMode, var traceCaptureDeviceInfo, var traceScreenInfo)
- bool traceEnd(Trace trace)
- update()
Detailed Description
The InputMethod type lets you create a custom input method which can be assigned to InputEngine.
Property Documentation
inputContext : InputContext |
The input context.
inputEngine : InputEngine |
The input engine.
Signal Documentation
The input method emits this signal when the current index has changed in the selection list identified by type.
The input method emits this signal when the contents of the selection list are changed. The type parameter specifies which selection list has changed.
Method Documentation
The purpose of this method is to handle the key events generated by the the input engine.
The key parameter specifies the code of the key to handle. The key code does not distinguish between capital and non-capital letters. The text parameter contains the Unicode text for the key. The modifiers parameter contains the key modifiers that apply to key.
This method returns true
if the key event was successfully handled. If the return value is false
, the key event is redirected to the default input method for futher processing.
Returns list of supported pattern recognition modes.
This method is invoked by the input engine to query the list of supported pattern recognition modes.
This QML method was introduced in QtQuick.VirtualKeyboard 2.0.
This method attempts to reselect a word located at the cursorPosition. The reselectFlags define the rules for how the word should be selected in relation to the cursor position.
InputEngine.WordBeforeCursor
Activate the word before the cursor. When this flag is used exclusively, the word must end exactly at the cursor.InputEngine.WordAfterCursor
Activate the word after the cursor. When this flag is used exclusively, the word must start exactly at the cursor.InputEngine.WordAtCursor
Activate the word at the cursor. This flag is a combination of the above flags with the exception that the word cannot start or stop at the cursor.
The method returns true
if the word was successfully reselected.
This QML method was introduced in QtQuick.VirtualKeyboard 2.0.
This method is called by the input engine when this input method needs to be reset. The input method must reset its internal state only. The main difference to the update() method is that reset() modifies only the input method state; it must not modify the input context.
var selectionListData(int type, int index, int role) |
Returns item data for a selection list identified by type. The role parameter specifies which data is requested. The index parameter is a zero based index into the selecteion list.
Returns the number of items in the selection list identified by type.
This method is called when an item at index has been selected by the user. The selection list is identified by the type parameter.
Returns the list of selection types used for this input method.
This method is called by the input engine when the input method is being activated. The input method can reserve the selection lists for its use by returning a list of selection list types required.
Changes inputMode and locale for this input method. The method returns true
if successful.
Updates textCase for this input method. The method returns true
if successful.
The possible values for the text case are:
InputEngine.Lower
Lower case text.InputEngine.Upper
Upper case text.
This method is called when a trace interaction starts with the specified patternRecognitionMode. The trace is uniquely identified by the traceId. The traceCaptureDeviceInfo provides information about the source device and the traceScreenInfo provides information about the screen context.
If the input method accepts the event and wants to capture the trace input, it must return a new Trace object. This object must remain valid until the InputMethod.traceEnd() method is called. If the Trace is rendered on screen, it remains there until the Trace object is destroyed.
This QML method was introduced in QtQuick.VirtualKeyboard 2.0.
bool traceEnd(Trace trace) |
This method is called when the trace interaction ends. The input method should destroy the trace object at some point after this function is called. See the Trace API how to access the gathered data.
This QML method was introduced in QtQuick.VirtualKeyboard 2.0.
This method is called by the input engine when the input method needs to be updated. The input method must close the current pre-edit text and restore the internal state to the default.
© 2017 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.