Base type for creating input method in QML. 更多...
| import 語句: | import QtQuick.VirtualKeyboard 2.2 |
The InputMethod type lets you create a custom input method which can be assigned to InputEngine .
|
inputContext : InputContext |
The input context.
|
inputEngine : InputEngine |
The input engine.
輸入法會發射此信號當當前 index 已改變在選定列錶標識通過 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.
The input method emits this signal when the selection list types have changed. This signal will trigger a call to selectionLists() method, allowing the input method to update the selection list types.
This QML signal was introduced in QtQuick.VirtualKeyboard 2.2.
Returns a list of input modes for locale .
此方法的目的是, 處理由輸入引擎生成的鍵事件。
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 .
此方法返迴
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.
返迴支持模式識彆方式的列錶。
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 。 reselectFlags 定義應如何選擇光標位置相關單詞的規則。
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.
方法返迴
true
若單詞被成功重選。
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 。 role 參數指定請求何種數據。 index parameter is a zero based index into the selecteion list.
返迴選定列錶項數標識通過 type .
此方法被調用當項位於 index 被用戶選中。選定列錶的標識是通過 type 參數。
Returns the list of selection types used for this input method.
此方法由輸入引擎調用,當輸入法被激活且每次更新輸入法提示時。輸入法可以預留選定列錶,通過返迴期望的選定列錶類型。
輸入法可以請求輸入引擎隨時更新選定列錶通過發射 selectionListsChanged() signal. This signal will trigger a call to this method, allowing the input method to update the selection list types.
變化
inputMode
and
locale
為此輸入法。方法返迴
true
若成功。
Updates
textCase
為此輸入法。方法返迴
true
若成功。
The possible values for the text case are:
InputEngine.Lower
小寫文本。
InputEngine.Upper
大寫文本。
|
Trace traceBegin ( int traceId , int patternRecognitionMode , var traceCaptureDeviceInfo , var traceScreenInfo ) |
此方法被調用當開始跟蹤交互采用指定 patternRecognitionMode 。跟蹤的唯一標識是通過 traceId 。 traceCaptureDeviceInfo 提供源設備的有關信息和 traceScreenInfo 提供屏幕上下文的有關信息。
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 ) |
此方法被調用,當跟蹤交互結束時。輸入法應銷毀 trace 對象在某個時刻,在調用此函數後。見 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.