Skip to main content

Module ui_input_event

Module ui_input_event 

Source
Available on crate feature api-12 only.

Structs§

ArkUI_CoastingAxisEventapi-22
Defines the coasting axis event. When a user swipes with two fingers on the touchpad, the system constructs sliding events based on the speed at the moment the fingers are lifted according to a certain decay curve. You can listen for such events to handle the flick effect immediately after the regular axis events.
ArkUI_CoastingAxisEventPhaseapi-22
Enumerates the coasting axis event phases.
ArkUI_InteractionHandapi-15
Defines whether the touch event is from the left or right hand.
ArkUI_ModifierKeyName
Defines an enum for modifier keys.
ArkUI_TouchTestInfoapi-22
Defines the touch test info.
ArkUI_TouchTestInfoItemapi-22
Defines the touch test info item.
ArkUI_TouchTestStrategyapi-22
Define the touch test strategy.
ArkUI_UIInputEvent
Defines the UI input event.
ArkUI_UIInputEvent_Type
Enumerates the UI input event types.
HitTestMode
Enumerates the hit test modes.
InputEventSourceType
MouseEventAction
TouchEventAction
TouchEventToolType
_bindgen_ty_6api-15
Defines an enum for the axis types for focus axis events.
_bindgen_ty_7api-22
Enumerates the axis types for axis events.
_bindgen_ty_8api-15
Enumerates the action types for axis events.

Constants§

UI_AXIS_EVENT_ACTION_BEGINapi-15
The axis event begins.
UI_AXIS_EVENT_ACTION_CANCELapi-15
The axis event is canceled.
UI_AXIS_EVENT_ACTION_ENDapi-15
The axis event ends.
UI_AXIS_EVENT_ACTION_NONEapi-15
The axis event is abnormal.
UI_AXIS_EVENT_ACTION_UPDATEapi-15
The axis event is updated.
UI_AXIS_TYPE_HORIZONTAL_AXISapi-22
Horizontal scroll axis.
UI_AXIS_TYPE_PINCH_AXISapi-22
Pinch axis.
UI_AXIS_TYPE_VERTICAL_AXISapi-22
Vertical scroll axis.
UI_FOCUS_AXIS_EVENT_ABS_BRAKEapi-15
ABS_BRAKE.
UI_FOCUS_AXIS_EVENT_ABS_GASapi-15
ABS_GAS.
UI_FOCUS_AXIS_EVENT_ABS_HAT0Xapi-15
ABS_HAT0X.
UI_FOCUS_AXIS_EVENT_ABS_HAT0Yapi-15
ABS_HAT0Y.
UI_FOCUS_AXIS_EVENT_ABS_HAT1Xapi-23 and api-15
Game controller HAT1X-axis.
UI_FOCUS_AXIS_EVENT_ABS_HAT1Yapi-23 and api-15
Game controller HAT1Y-axis.
UI_FOCUS_AXIS_EVENT_ABS_HAT2Xapi-23 and api-15
Game controller HAT2X-axis.
UI_FOCUS_AXIS_EVENT_ABS_HAT2Yapi-23 and api-15
Game controller HAT2Y-axis.
UI_FOCUS_AXIS_EVENT_ABS_HAT3Xapi-23 and api-15
Game controller HAT3X-axis.
UI_FOCUS_AXIS_EVENT_ABS_HAT3Yapi-23 and api-15
Game controller HAT3Y-axis.
UI_FOCUS_AXIS_EVENT_ABS_RUDDERapi-23 and api-15
Game controller RUDDER-axis.
UI_FOCUS_AXIS_EVENT_ABS_RXapi-23 and api-15
Game controller RX-axis.
UI_FOCUS_AXIS_EVENT_ABS_RYapi-23 and api-15
Game controller RY-axis.
UI_FOCUS_AXIS_EVENT_ABS_RZapi-15
ABS_RZ.
UI_FOCUS_AXIS_EVENT_ABS_THROTTLEapi-23 and api-15
Game controller THROTTLE-axis.
UI_FOCUS_AXIS_EVENT_ABS_WHEELapi-23 and api-15
Game controller WHEEL-axis.
UI_FOCUS_AXIS_EVENT_ABS_Xapi-15
ABS_X.
UI_FOCUS_AXIS_EVENT_ABS_Yapi-15
ABS_Y.
UI_FOCUS_AXIS_EVENT_ABS_Zapi-15
ABS_Z.

Functions§

OH_ArkUI_AxisEvent_GetAxisActionapi-15
Obtains the action type of the current axis event.
OH_ArkUI_AxisEvent_GetHorizontalAxisValue
Obtains the value of the horizontal scroll axis for this axis event. This value is generated by two-finger horizontal swiping on a touchpad.
OH_ArkUI_AxisEvent_GetPinchAxisScaleValue
This value is generated by a two-finger pinch gesture on a touchpad. The reported scale value is relative to the initial state
OH_ArkUI_AxisEvent_GetScrollStepapi-17
Obtains the scroll step coefficient for a wheel-based axis event. This API returns the user-configured scroll scale factor factor.
OH_ArkUI_AxisEvent_GetVerticalAxisValue
Obtains the value of the vertical scroll axis for this axis event. This value is typically generated by mouse wheel scrolling or two-finger vertical swiping on a touchpad.
OH_ArkUI_AxisEvent_HasAxisapi-22
Checks whether this axis event contains the specified axis type.
OH_ArkUI_AxisEvent_SetPropagationapi-17
Sets whether to enable axis event propagation (bubbling). By default, axis events do not bubble and are only sent to the first component that can respond to axis events. You can enable axis event bubbling to allow the current event to be passed to the next ancestor component in the response chain that can handle axis events. This API cannot be used on axis events obtained from gesture events.
OH_ArkUI_CoastingAxisEvent_GetDeltaXapi-22
Obtains the horizontal delta value.
OH_ArkUI_CoastingAxisEvent_GetDeltaYapi-22
Obtains the vertical delta value.
OH_ArkUI_CoastingAxisEvent_GetEventTimeapi-22
Obtains the time when this coasting event occurs.
OH_ArkUI_CoastingAxisEvent_GetPhaseapi-22
Obtains the coasting phase when this coasting event occurs.
OH_ArkUI_CoastingAxisEvent_SetPropagationapi-22
Sets whether to enable coasting axis event propagation.
OH_ArkUI_FocusAxisEvent_GetAxisValueapi-15
Obtains the axis value of a focus axis event.
OH_ArkUI_FocusAxisEvent_SetStopPropagationapi-15
Sets whether to prevent a focus axis event from bubbling up.
OH_ArkUI_HoverEvent_IsHoveredapi-17
Checks whether the cursor is hovering over this component.
OH_ArkUI_MouseEvent_GetMouseAction
Get the value of the mouse action type for mouse events.
OH_ArkUI_MouseEvent_GetMouseButton
Get the value of the button type for mouse events.
OH_ArkUI_MouseEvent_GetPressedButtonsapi-15
Obtains the pressed buttons from a mouse event.
OH_ArkUI_MouseEvent_GetRawDeltaXapi-15
Obtains the movement increment of the mouse device along the X-axis in a two-dimensional plane. Its value represents the raw movement data from the mouse device, expressed in units of physical distance in the real world. The reported value is determined by the hardware itself and does not correspond to the physical or logical pixels on the screen.
OH_ArkUI_MouseEvent_GetRawDeltaYapi-15
Obtains the movement increment of the mouse device along the Y-axis in a two-dimensional plane. Its value represents the raw movement data from the mouse device, expressed in units of physical distance in the real world. The reported value is determined by the hardware itself and does not correspond to the physical or logical pixels on the screen.
OH_ArkUI_PointerEvent_CreateClonedEventapi-15
Creates a cloned event pointer based on an event pointer. This API is effective only for touch events.
OH_ArkUI_PointerEvent_DestroyClonedEventapi-15
Destroys a cloned event pointer.
OH_ArkUI_PointerEvent_GetChangedPointerIdapi-15
Obtains the ID of the touch pointer that triggers the current touch event.
OH_ArkUI_PointerEvent_GetDisplayX
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).
OH_ArkUI_PointerEvent_GetDisplayXByIndex
Obtains the X coordinate of a specific contact point relative to the upper left corner of the current screen from a pointer event (such as a touch, mouse, or axis event). For mouse and axis events, this API returns the default value of 0.0f if the given index is greater than 0.
OH_ArkUI_PointerEvent_GetDisplayY
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).
OH_ArkUI_PointerEvent_GetDisplayYByIndex
Obtains the Y coordinate of a specific touch point relative to the upper left corner of the current screen from a pointer event (such as a touch event, mouse event, or axis event).
OH_ArkUI_PointerEvent_GetGlobalDisplayXapi-20
Obtains the X coordinate relative to global display from a pointer event (such as a touch, mouse, or axis event). Position information can only be obtained from UI input events.
OH_ArkUI_PointerEvent_GetGlobalDisplayXByIndexapi-20
Obtains the X coordinate of a specific contact point relative to global display from a pointer event (such as a touch, mouse, or axis event). Position information can only be obtained from UI input events. For mouse and axis events, if the provided pointerIndex is greater than 0, this API always returns the default value 0.0f.
OH_ArkUI_PointerEvent_GetGlobalDisplayYapi-20
Obtains the Y coordinate relative to global display from a pointer event (such as a touch, mouse, or axis event). Position information can only be obtained from pointer-like events.
OH_ArkUI_PointerEvent_GetGlobalDisplayYByIndexapi-20
Obtains the Y coordinate of a specific contact point relative to global display from a pointer event (such as a touch, mouse, or axis event). Position information can only be obtained from UI input events. For mouse and axis events, if the provided pointerIndex is greater than 0, this API always returns the default value 0.0f.
OH_ArkUI_PointerEvent_GetHistoryDisplayX
Obtains the X coordinate of a specific touch point in a 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).
OH_ArkUI_PointerEvent_GetHistoryDisplayY
Obtains the Y coordinate of a specific touch point in a 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).
OH_ArkUI_PointerEvent_GetHistoryEventTime
Obtains the occurrence time of a historical event from a directional input event (such as a touch event, mouse event, or axis event).
OH_ArkUI_PointerEvent_GetHistoryGlobalDisplayXapi-20
Obtains the X coordinate relative to the global display for a specific touch point from historical events, based on the given pointer index and history index of an input event (such as a touch, mouse, or axis event). Position information can only be obtained from UI input events. For mouse and axis events, if the provided pointerIndex is greater than 0, this API always returns the default value 0.0f.
OH_ArkUI_PointerEvent_GetHistoryGlobalDisplayYapi-20
Obtains the Y coordinate relative to the global display for a specific touch point from historical events, based on the given pointer index and history index of an input event (such as a touch, mouse, or axis event). Position information can only be obtained from UI input events. For mouse and axis events, if the provided pointerIndex is greater than 0, this API always returns the default value 0.0f.
OH_ArkUI_PointerEvent_GetHistoryPointerCount
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).
OH_ArkUI_PointerEvent_GetHistoryPointerId
Obtains the unique ID of a contact point from a historical event of a pointer event (such as a touch event).
OH_ArkUI_PointerEvent_GetHistoryPressure
Obtains the pressure applied to the touchscreen in a specific historical event from a directional input event (for example, a touch event)..
OH_ArkUI_PointerEvent_GetHistorySize
Obtains the number of historical events from a pointer event (such as a touch event). Historical events are the raw events that occur between the current event and the previous event. This API is applicable only to move events.
OH_ArkUI_PointerEvent_GetHistoryTiltX
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.
OH_ArkUI_PointerEvent_GetHistoryTiltY
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.
OH_ArkUI_PointerEvent_GetHistoryTouchAreaHeight
Obtains the height of the touch area in a specific historical event from a directional input event (for example, a touch event).
OH_ArkUI_PointerEvent_GetHistoryTouchAreaWidth
Obtains the width of the touch area in a specific historical event from a directional input event (for example, a touch event).
OH_ArkUI_PointerEvent_GetHistoryWindowX
Obtains the X coordinate of a specific touch point in a 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).
OH_ArkUI_PointerEvent_GetHistoryWindowY
Obtains the Y coordinate of a specific touch point in a 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).
OH_ArkUI_PointerEvent_GetHistoryX
Obtains the X coordinate of a specific touch point in a 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).
OH_ArkUI_PointerEvent_GetHistoryY
Obtains the Y coordinate of a specific touch point in a 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).
OH_ArkUI_PointerEvent_GetInteractionHandapi-15
Checks whether an event is triggered by the user’s left or right hand. This API is only effective on some touch devices.
OH_ArkUI_PointerEvent_GetInteractionHandByIndexapi-15
Checks whether an event is triggered by the user’s left or right hand. This API is only effective on some touch devices.
OH_ArkUI_PointerEvent_GetPointerCount
Obtains the number of contact points from a pointer event (such as a touch, mouse, or axis event).
OH_ArkUI_PointerEvent_GetPointerId
Obtains the unique ID of a contact point from a pointer event (such as a touch, mouse, or axis event).
OH_ArkUI_PointerEvent_GetPressedTimeByIndexapi-15
Obtains the press time of a specified touch point. This API is effective only for touch events.
OH_ArkUI_PointerEvent_GetPressure
Obtains the pressure applied to the touchscreen from a directional input event (for example, a touch event).
OH_ArkUI_PointerEvent_GetRollAngleapi-17
Obtains the rotation angle of the stylus around the z-axis from a UI input event.
OH_ArkUI_PointerEvent_GetTiltX
Obtains the tilt angle relative to the YZ plane from a pointer event. The value range is [-90, 90], where positive values indicate a rightward tilt. This API is applicable only to stylus-based touch events from devices that support tilt angle reporting.
OH_ArkUI_PointerEvent_GetTiltY
Obtains the tilt angle relative to the XZ plane from a pointer event. The value range is [-90, 90], where positive values indicate a rightward tilt. This API is applicable only to stylus-based touch events from devices that support tilt angle reporting.
OH_ArkUI_PointerEvent_GetTouchAreaHeight
Obtains the height of the contact area for a pointer event. This API is applicable only to finger-based touch events, and the return value typically represents the radius of a circular touch area.
OH_ArkUI_PointerEvent_GetTouchAreaWidth
Obtains the width of the contact area for a pointer event. This API is applicable only to finger-based touch events, and the return value typically represents the radius of a circular touch area.
OH_ArkUI_PointerEvent_GetWindowX
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).
OH_ArkUI_PointerEvent_GetWindowXByIndex
Obtains the X coordinate of a specific contact point relative to the upper left corner of the current application window from a pointer event (such as a touch, mouse, or axis event). For mouse and axis events, this API returns the default value of 0.0f if the given index is greater than 0.
OH_ArkUI_PointerEvent_GetWindowY
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).
OH_ArkUI_PointerEvent_GetWindowYByIndex
Obtains the Y coordinate of a specific contact point relative to the upper left corner of the current application window from a pointer event (such as a touch, mouse, or axis event). For mouse and axis events, this API returns the default value of 0.0f if the given index is greater than 0.
OH_ArkUI_PointerEvent_GetX
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).
OH_ArkUI_PointerEvent_GetXByIndex
Obtains the X coordinate of a specific contact point relative to the upper left corner of the current component from a pointer event (such as a touch, mouse, or axis event). For mouse and axis events, this API returns the default value of 0.0f if the given index is greater than 0.
OH_ArkUI_PointerEvent_GetY
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).
OH_ArkUI_PointerEvent_GetYByIndex
Obtains the Y coordinate of a specific contact point relative to the upper left corner of the current component from a pointer event (such as a touch, mouse, or axis event). For mouse and axis events, this API returns the default value of 0.0f if the given index is greater than 0.
OH_ArkUI_PointerEvent_PostClonedEventapi-15
Posts a cloned event to a specific node.
OH_ArkUI_PointerEvent_SetClonedEventActionTypeapi-15
Sets the action type of a cloned event.
OH_ArkUI_PointerEvent_SetClonedEventChangedFingerIdapi-15
Sets the touch point ID of a cloned pointer event.
OH_ArkUI_PointerEvent_SetClonedEventFingerIdByIndexapi-15
Sets the touch point ID of a specific contact point of a cloned event.
OH_ArkUI_PointerEvent_SetClonedEventLocalPositionapi-15
Sets the X and Y coordinates of a cloned event relative to the upper left corner of the current component.
OH_ArkUI_PointerEvent_SetClonedEventLocalPositionByIndexapi-15
Sets the X and Y coordinates of a specific contact point of a cloned event relative to the upper left corner of the current component.
OH_ArkUI_PointerEvent_SetInterceptHitTestMode
Sets the hit testing mode, that is, how the component behaves during hit testing. This API only applies to scenarios raw input events are received, such as when [NODE_ON_TOUCH] is used for touch event handling. It cannot be used with ArkUI_UIInputEvent objects obtained from gesture events through [OH_ArkUI_GestureEvent_GetRawInputEvent].
OH_ArkUI_PointerEvent_SetStopPropagation
Sets whether to stop event propagation. This API only applies to scenarios raw input events are received, such as when [NODE_ON_TOUCH] is used for touch event handling. It cannot be used with ArkUI_UIInputEvent objects obtained from gesture events through [OH_ArkUI_GestureEvent_GetRawInputEvent].
OH_ArkUI_TouchTestInfoItem_GetChildIdapi-22
Obtains the sub component’s name from the touch test info item.
OH_ArkUI_TouchTestInfoItem_GetChildRectapi-22
Obtains the sub component’s frame rect info from the touch test info item.
OH_ArkUI_TouchTestInfoItem_GetWindowXapi-22
Obtains the X coordinate relative to the upper left corner of the current application window from the touch test info item.
OH_ArkUI_TouchTestInfoItem_GetWindowYapi-22
Obtains the Y coordinate relative to the upper left corner of the current application window from the touch test info item.
OH_ArkUI_TouchTestInfoItem_GetXapi-22
Obtains the X coordinate relative to the upper left corner of the child component from the touch test info item.
OH_ArkUI_TouchTestInfoItem_GetXRelativeToParentapi-22
Obtains the X coordinate relative to the upper left corner of the parent component from the touch test info item.
OH_ArkUI_TouchTestInfoItem_GetYapi-22
Obtains the Y coordinate relative to the upper left corner of the child component from the touch test info item.
OH_ArkUI_TouchTestInfoItem_GetYRelativeToParentapi-22
Obtains the Y coordinate relative to the upper left corner of the parent component from the touch test info item.
OH_ArkUI_TouchTestInfo_GetTouchTestInfoListapi-22
Obtains touch test info item list in the touch test info.
OH_ArkUI_TouchTestInfo_SetTouchResultIdapi-22
Sets the sub component’s name, that is, which sub components need to be effected during hit testing.
OH_ArkUI_TouchTestInfo_SetTouchResultStrategyapi-22
Sets the touch test strategy, that is, how the component and the sub components behave during hit testing.
OH_ArkUI_UIInputEvent_GetAction
Obtains the action type of this UI input event.
OH_ArkUI_UIInputEvent_GetCoastingAxisEventapi-22
Obtains the coasting axis event from a component event, valid event only can be fetched only when user flings on the touchpad with two fingers and any components register NODE_ON_COASTING_AXIS_EVENT exist under the pointer location. Call this method after the ArkUI_UIInputEvent object is obtained from the [ArkUI_NodeEvent] object.
OH_ArkUI_UIInputEvent_GetDeviceIdapi-14
Obtains the ID of device that triggers UI input event.
OH_ArkUI_UIInputEvent_GetEventTargetGlobalPositionXapi-17
Obtains the global X coordinate of the component hit by an event.
OH_ArkUI_UIInputEvent_GetEventTargetGlobalPositionYapi-17
Obtains the global Y coordinate of the component hit by an event.
OH_ArkUI_UIInputEvent_GetEventTargetHeightapi-17
Obtains the height of the component hit by an event.
OH_ArkUI_UIInputEvent_GetEventTargetPositionXapi-17
Obtains the X coordinate of the component hit by an event.
OH_ArkUI_UIInputEvent_GetEventTargetPositionYapi-17
Obtains the Y coordinate of the component hit by an event.
OH_ArkUI_UIInputEvent_GetEventTargetWidthapi-17
Obtains the width of the component hit by an event.
OH_ArkUI_UIInputEvent_GetEventTime
Obtains the time when this UI input event occurs.
OH_ArkUI_UIInputEvent_GetLatestStatusapi-20
Use this method to obtain the execution status of the latest UI input related method.
OH_ArkUI_UIInputEvent_GetModifierKeyStatesapi-17
Obtains the modifier key states for a UI input event. This API outputs the state of all modifier keys at the time of the event through the keys parameter. You can determine which keys are pressed by performing bitwise operations with the modifier key types defined in ArkUI_ModifierKeyName.
OH_ArkUI_UIInputEvent_GetPressedKeysapi-14
Obtains all keys that are pressed from UI input event. Only supports key events currently.
OH_ArkUI_UIInputEvent_GetSourceType
Obtains the source type of a UI input event.
OH_ArkUI_UIInputEvent_GetTargetDisplayIdapi-15
Obtains the ID of the screen where the UI input event occurs.
OH_ArkUI_UIInputEvent_GetToolType
Obtains the tool type of a UI input event.
OH_ArkUI_UIInputEvent_GetType
Obtains the type of a UI input event.

Type Aliases§

ArkUI_TouchTestInfoItemArrayapi-22
Defines the gesture recognizer handle array.
ArkUI_TouchTestInfoItemHandleapi-22
Defines the touch test info item handle.