目录

InputMethod_CursorInfo

typedef struct InputMethod_CursorInfo InputMethod_CursorInfo

Overview

InputMethod_CursorInfo is an opaque type for cursor information. It describes the position and size of the cursor on the physical screen during text input, including the horizontal coordinate (left), vertical coordinate (top), width (width), and height (height) of the cursor.

Purpose: Supplies the input method service with precise position and size information of the cursor. The input method relies on this information to implement the following features:

Usage scenarios:

  1. Carrying cursor information in TextConfig: When the app returns TextConfig in the OH_TextEditorProxy_GetTextConfigFunc callback, the CursorInfo contained in it informs the input method of the current cursor position and size.

  2. Active notification of cursor updates: When the cursor position changes (for example, the user moves the cursor or text insertion shifts the cursor), the app actively notifies the input method of the latest cursor position via OH_InputMethodProxy_NotifyCursorUpdate.

Related functions

Function Description
OH_CursorInfo_Create Creates a CursorInfo instance. The values of left, top, width, and height need to be passed in.
OH_CursorInfo_Destroy Destroys a CursorInfo instance.
OH_CursorInfo_SetRect Sets the position and size of the cursor.
OH_CursorInfo_GetRect Obtains the position and size of the cursor.

Relationship with other structs:

Since: 12

Related module: InputMethod

Header file: inputmethod_cursor_info_capi.h