harmony 鸿蒙ui_input_event.h

  • 2025-06-12
  • 浏览 (4)

ui_input_event.h

Overview

Provides ArkUI event definitions on the native side.

Library: libace_ndk.z.so

File to include:

System capability: SystemCapability.ArkUI.ArkUI.Full

Since: 12

Related module: ArkUI_EventModule

Summary

Types

Name Description
typedef struct ArkUI_UIInputEvent ArkUI_UIInputEvent Defines the UI input event.

Enums

Name Description
ArkUI_UIInputEvent_Type { ARKUI_UIINPUTEVENT_TYPE_UNKNOWN = 0, ARKUI_UIINPUTEVENT_TYPE_TOUCH = 1, ARKUI_UIINPUTEVENT_TYPE_AXIS = 2, ARKUI_UIINPUTEVENT_TYPE_MOUSE = 3 } Enumerates the UI input event types.
{
OH_NATIVEXCOMPONENT_RESULT_SUCCESS = 0, OH_NATIVEXCOMPONENT_RESULT_FAILED = -1, OH_NATIVEXCOMPONENT_RESULT_BAD_PARAMETER = -2, UI_TOUCH_EVENT_ACTION_CANCEL = 0,
UI_TOUCH_EVENT_ACTION_DOWN = 1, UI_TOUCH_EVENT_ACTION_MOVE = 2, UI_TOUCH_EVENT_ACTION_UP = 3
}
Enumerates the action codes of the input event.
{
UI_INPUT_EVENT_TOOL_TYPE_UNKNOWN = 0, UI_INPUT_EVENT_TOOL_TYPE_FINGER = 1, UI_INPUT_EVENT_TOOL_TYPE_PEN = 2, UI_INPUT_EVENT_TOOL_TYPE_MOUSE = 3,
UI_INPUT_EVENT_TOOL_TYPE_TOUCHPAD = 4, UI_INPUT_EVENT_TOOL_TYPE_JOYSTICK = 5
}
Enumerates the tool types of the input event.
{ UI_INPUT_EVENT_SOURCE_TYPE_UNKNOWN = 0, UI_INPUT_EVENTT_SOURCE_TYPE_MOUSE = 1, UI_INPUT_EVENTT_SOURCE_TYPE_TOUCH_SCREEN = 2 } Enumerates the source types of the input event.
HitTestMode { HTMDEFAULT = 0, HTMBLOCK, HTMTRANSPARENT, HTMNONE } Enumerates the hit test modes.
{ UI_MOUSE_EVENT_ACTION_UNKNOWN = 0, UI_MOUSE_EVENT_ACTION_PRESS = 1, UI_MOUSE_EVENT_ACTION_RELEASE = 2, UI_MOUSE_EVENT_ACTION_MOVE = 3 } Enumerates the action codes of the mouse event.
{
UI_MOUSE_EVENT_BUTTON_NONE = 0, UI_MOUSE_EVENT_BUTTON_LEFT = 1, UI_MOUSE_EVENT_BUTTON_RIGHT = 2, UI_MOUSE_EVENT_BUTTON_MIDDLE = 3,
UI_MOUSE_EVENT_BUTTON_BACK = 4, UI_MOUSE_EVENT_BUTTON_FORWARD = 5
}
Enumerates the button types of the mouse event.
ArkUI_ModifierKeyName { ARKUI_MODIFIER_KEY_CTRL = 1 << 0, ARKUI_MODIFIER_KEY_SHIFT = 1 << 1, ARKUI_MODIFIER_KEY_ALT = 1 << 2, ARKUI_MODIFIER_KEY_FN = 1 << 3 } Enumerates the modifier keys.

Functions

Name Description
int32_t OH_ArkUI_UIInputEvent_GetType (const ArkUI_UIInputEvent *event) Obtains the type of a UI input event.
int32_t OH_ArkUI_UIInputEvent_GetAction (const ArkUI_UIInputEvent *event) Obtains the action type of this UI input event.
int32_t OH_ArkUI_UIInputEvent_GetSourceType (const ArkUI_UIInputEvent *event) Obtains the source type of a UI input event.
int32_t OH_ArkUI_UIInputEvent_GetToolType (const ArkUI_UIInputEvent *event) Obtains the tool type of a UI input event.
int64_t OH_ArkUI_UIInputEvent_GetEventTime (const ArkUI_UIInputEvent *event) Obtains the time when a specified UI input event occurs.
uint32_t OH_ArkUI_PointerEvent_GetPointerCount (const ArkUI_UIInputEvent *event) Obtains the number of touch points from a directional input event (such as a touch event, mouse event, or axis event).
int32_t OH_ArkUI_PointerEvent_GetPointerId (const ArkUI_UIInputEvent *event, uint32_t pointerIndex) Obtains the ID of a touch point from a directional input event (such as a touch event, mouse event, or axis event).
float OH_ArkUI_PointerEvent_GetX (const ArkUI_UIInputEvent *event) Obtains the X-coordinate relative to the upper left corner of the current component from a directional input event (such as a touch event, mouse event, or axis event).
float OH_ArkUI_PointerEvent_GetXByIndex (const ArkUI_UIInputEvent *event, uint32_t pointerIndex) Obtains the X-coordinate of a specific touch point relative to the upper left corner of the current component from a directional input event (such as a touch event, mouse event, or axis event).
float OH_ArkUI_PointerEvent_GetY (const ArkUI_UIInputEvent *event) Obtains the Y-coordinate relative to the upper left corner of the current component from a directional input event (such as a touch event, mouse event, or axis event).
float OH_ArkUI_PointerEvent_GetYByIndex (const ArkUI_UIInputEvent *event, uint32_t pointerIndex) Obtains the Y-coordinate of a specific touch point relative to the upper left corner of the current component from a directional input event (such as a touch event, mouse event, or axis event).
float OH_ArkUI_PointerEvent_GetWindowX (const ArkUI_UIInputEvent *event) Obtains the X-coordinate relative to the upper left corner of the current application window from a directional input event (such as a touch event, mouse event, or axis event).
float OH_ArkUI_PointerEvent_GetWindowXByIndex (const ArkUI_UIInputEvent *event, uint32_t pointerIndex) Obtains the X-coordinate of a specific touch point relative to the upper left corner of the current application window from a directional input event (such as a touch event, mouse event, or axis event).
float OH_ArkUI_PointerEvent_GetWindowY (const ArkUI_UIInputEvent *event) Obtains the Y-coordinate relative to the upper left corner of the current application window from a directional input event (such as a touch event, mouse event, or axis event).
float OH_ArkUI_PointerEvent_GetWindowYByIndex (const ArkUI_UIInputEvent *event, uint32_t pointerIndex) Obtains the Y-coordinate of a specific touch point relative to the upper left corner of the current application window from a directional input event (such as a touch event, mouse event, or axis event).
float OH_ArkUI_PointerEvent_GetDisplayX (const ArkUI_UIInputEvent *event) Obtains the X-coordinate relative to the upper left corner of the current screen from a directional input event (such as a touch event, mouse event, or axis event).
float OH_ArkUI_PointerEvent_GetDisplayXByIndex (const ArkUI_UIInputEvent *event, uint32_t pointerIndex) Obtains the X-coordinate of a specific touch point relative to the upper left corner of the current screen from a directional input event (such as a touch event, mouse event, or axis event).
float OH_ArkUI_PointerEvent_GetDisplayY (const ArkUI_UIInputEvent *event) Obtains the Y-coordinate relative to the upper left corner of the current screen from a directional input event (such as a touch event, mouse event, or axis event).
float OH_ArkUI_PointerEvent_GetDisplayYByIndex (const ArkUI_UIInputEvent *event, uint32_t pointerIndex) Obtains the Y-coordinate of a specific touch point relative to the upper left corner of the current screen from a directional input event (such as a touch event, mouse event, or axis event).
float OH_ArkUI_PointerEvent_GetPressure (const ArkUI_UIInputEvent *event, uint32_t pointerIndex) Obtains the pressure applied to the touchscreen from a directional input event (for example, a touch event).
float OH_ArkUI_PointerEvent_GetTiltX (const ArkUI_UIInputEvent *event, uint32_t pointerIndex) Obtains the angle relative to the YZ plane from a directional input event (for example, a touch event). The value range is [-90, 90]. A positive value indicates a rightward tilt.
float OH_ArkUI_PointerEvent_GetTiltY (const ArkUI_UIInputEvent *event, uint32_t pointerIndex) Obtains the angle relative to the XZ plane from a directional input event (for example, a touch event). The value range is [-90, 90]. A positive value indicates a downward tilt.
float OH_ArkUI_PointerEvent_GetTouchAreaWidth (const ArkUI_UIInputEvent *event, uint32_t pointerIndex) Obtains the width of the touch area from a directional input event (for example, a touch event).
float OH_ArkUI_PointerEvent_GetTouchAreaHeight (const ArkUI_UIInputEvent *event, uint32_t pointerIndex) Obtains the height of the touch area from a directional input event (for example, a touch event).
uint32_t OH_ArkUI_PointerEvent_GetHistorySize (const ArkUI_UIInputEvent *event) Obtains the number of historical events from a directional input event (such as a touch event, mouse event, or axis event).
int64_t OH_ArkUI_PointerEvent_GetHistoryEventTime (const ArkUI_UIInputEvent *event, uint32_t historyIndex) Obtains the occurrence time of a historical event from a directional input event (such as a touch event, mouse event, or axis event).
uint32_t OH_ArkUI_PointerEvent_GetHistoryPointerCount (const ArkUI_UIInputEvent *event, uint32_t historyIndex) Obtains the number of touch points in a specific historical event from a directional input event (such as a touch event, mouse event, or axis event).
int32_t OH_ArkUI_PointerEvent_GetHistoryPointerId (const ArkUI_UIInputEvent *event, uint32_t pointerIndex, uint32_t historyIndex) Obtains the ID of a touch point from a directional input event (such as a touch event, mouse event, or axis event).
float OH_ArkUI_PointerEvent_GetHistoryX (const ArkUI_UIInputEvent *event, uint32_t pointerIndex, uint32_t historyIndex) Obtains the X-coordinate of a specific touch point in a specific historical event relative to the upper left corner of the current component from a directional input event (such as a touch event, mouse event, or axis event).
float OH_ArkUI_PointerEvent_GetHistoryY (const ArkUI_UIInputEvent *event, uint32_t pointerIndex, uint32_t historyIndex) Obtains the Y-coordinate of a specific touch point in a specific historical event relative to the upper left corner of the current component from a directional input event (such as a touch event, mouse event, or axis event).
float OH_ArkUI_PointerEvent_GetHistoryWindowX (const ArkUI_UIInputEvent *event, uint32_t pointerIndex, uint32_t historyIndex) Obtains the X-coordinate of a specific touch point in a specific historical event relative to the upper left corner of the current application window from a directional input event (such as a touch event, mouse event, or axis event).
float OH_ArkUI_PointerEvent_GetHistoryWindowY (const ArkUI_UIInputEvent *event, uint32_t pointerIndex, uint32_t historyIndex) Obtains the Y-coordinate of a specific touch point in a specific historical event relative to the upper left corner of the current application window from a directional input event (such as a touch event, mouse event, or axis event).
float OH_ArkUI_PointerEvent_GetHistoryDisplayX (const ArkUI_UIInputEvent *event, uint32_t pointerIndex, uint32_t historyIndex) Obtains the X-coordinate of a specific touch point in a specific historical event relative to the upper left corner of the current screen from a directional input event (such as a touch event, mouse event, or axis event).
float OH_ArkUI_PointerEvent_GetHistoryDisplayY (const ArkUI_UIInputEvent *event, uint32_t pointerIndex, uint32_t historyIndex) Obtains the Y-coordinate of a specific touch point in a specific historical event relative to the upper left corner of the current screen from a directional input event (such as a touch event, mouse event, or axis event).
float OH_ArkUI_PointerEvent_GetHistoryPressure (const ArkUI_UIInputEvent *event, uint32_t pointerIndex, uint32_t historyIndex) Obtains the pressure applied to the touchscreen in a specific historical event from a directional input event (for example, a touch event).
float OH_ArkUI_PointerEvent_GetHistoryTiltX (const ArkUI_UIInputEvent *event, uint32_t pointerIndex, uint32_t historyIndex) Obtains the angle relative to the YZ plane in a specific historical event from a directional input event (for example, a touch event). The value range is [-90, 90]. A positive value indicates a rightward tilt.
float OH_ArkUI_PointerEvent_GetHistoryTiltY (const ArkUI_UIInputEvent *event, uint32_t pointerIndex, uint32_t historyIndex) Obtains the angle relative to the XZ plane in a specific historical event from a directional input event (for example, a touch event). The value range is [-90, 90]. A positive value indicates a downward tilt.
float OH_ArkUI_PointerEvent_GetHistoryTouchAreaWidth (const ArkUI_UIInputEvent *event, uint32_t pointerIndex, uint32_t historyIndex) Obtains the width of the touch area in a specific historical event from a directional input event (for example, a touch event).
float OH_ArkUI_PointerEvent_GetHistoryTouchAreaHeight (const ArkUI_UIInputEvent *event, uint32_t pointerIndex, uint32_t historyIndex) Obtains the height of the touch area in a specific historical event from a directional input event (for example, a touch event).
double OH_ArkUI_AxisEvent_GetVerticalAxisValue (const ArkUI_UIInputEvent *event) Obtains the value of the vertical scroll axis for this axis event.
double OH_ArkUI_AxisEvent_GetHorizontalAxisValue (const ArkUI_UIInputEvent *event) Obtains the value of the horizontal scroll axis for this axis event.
double OH_ArkUI_AxisEvent_GetPinchAxisScaleValue (const ArkUI_UIInputEvent *event) Obtains the scale value of the pinch axis for this axis event.
int32_t OH_ArkUI_PointerEvent_SetInterceptHitTestMode (const ArkUI_UIInputEvent *event, HitTestMode mode) Sets how the component behaves during hit testing.
int32_t OH_ArkUI_MouseEvent_GetMouseButton (const ArkUI_UIInputEvent *event) Obtains the button type of a mouse event.
int32_t OH_ArkUI_MouseEvent_GetMouseAction (const ArkUI_UIInputEvent *event) Obtains the action type of a mouse event.
int32_t OH_ArkUI_PointerEvent_SetStopPropagation (const ArkUI_UIInputEvent *event, bool stopPropagation) Sets whether to stop event propagation.
int32_t OH_ArkUI_UIInputEvent_GetDeviceId (const ArkUI_UIInputEvent *event) Obtains the ID of the input device that triggers a key event.
int32_t OH_ArkUI_UIInputEvent_GetPressedKeys (const ArkUI_UIInputEvent *event, int32_t *pressedKeyCodes, int32_t *length) Obtains all pressed keys. Currently, only key events are supported.

你可能感兴趣的鸿蒙文章

harmony 鸿蒙ArkUI

harmony 鸿蒙ARKUI_TextPickerCascadeRangeContent

harmony 鸿蒙ARKUI_TextPickerRangeContent

harmony 鸿蒙ArkUI_AnimateCompleteCallback

harmony 鸿蒙ArkUI_AttributeItem

harmony 鸿蒙ArkUI_ColorStop

harmony 鸿蒙ArkUI_ContextCallback

harmony 鸿蒙ArkUI_EventModule

harmony 鸿蒙ArkUI_ExpectedFrameRateRange

harmony 鸿蒙ArkUI_IntOffset

0  赞