Available on crate feature
api-12 only.Structs§
- ArkUI_
Interaction Hand api-15 - Defines whether the touch event is from the left or right hand.
- ArkUI_
Modifier KeyName - Defines an enum for modifier keys.
- ArkUI_
UIInput Event - Defines the UI input event.
- ArkUI_
UIInput Event_ Type - Enumerates the UI input event types.
- HitTest
Mode - Enumerates the hit test modes.
- Input
Event Source Type - Mouse
Event Action - Touch
Event Action - Touch
Event Tool Type - _bindgen_
ty_ 6 api-15 - Defines an enum for the axis types for focus axis events.
- _bindgen_
ty_ 7 api-15 - Enumerates the action types for axis events.
Constants§
- UI_
AXIS_ EVENT_ ACTION_ BEGIN api-15 - The axis event begins.
- UI_
AXIS_ EVENT_ ACTION_ CANCEL api-15 - The axis event is canceled.
- UI_
AXIS_ EVENT_ ACTION_ END api-15 - The axis event ends.
- UI_
AXIS_ EVENT_ ACTION_ NONE api-15 - The axis event is abnormal.
- UI_
AXIS_ EVENT_ ACTION_ UPDATE api-15 - The axis event is updated.
- UI_
FOCUS_ AXIS_ EVENT_ ABS_ BRAKE api-15 - ABS_BRAKE.
- UI_
FOCUS_ AXIS_ EVENT_ ABS_ GAS api-15 - ABS_GAS.
- UI_
FOCUS_ AXIS_ EVENT_ ABS_ HAT0X api-15 - ABS_HAT0X.
- UI_
FOCUS_ AXIS_ EVENT_ ABS_ HAT0Y api-15 - ABS_HAT0Y.
- UI_
FOCUS_ AXIS_ EVENT_ ABS_ RZ api-15 - ABS_RZ.
- UI_
FOCUS_ AXIS_ EVENT_ ABS_ X api-15 - ABS_X.
- UI_
FOCUS_ AXIS_ EVENT_ ABS_ Y api-15 - ABS_Y.
- UI_
FOCUS_ AXIS_ EVENT_ ABS_ Z api-15 - ABS_Z.
Functions§
- OH_
ArkUI_ ⚠Axis Event_ GetAxis Action api-15 - Obtains the action type of the current axis event.
- OH_
ArkUI_ ⚠Axis Event_ GetHorizontal Axis Value - 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_ ⚠Axis Event_ GetPinch Axis Scale Value - 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_ ⚠Axis Event_ GetScroll Step api-17 - Obtains the scroll step coefficient for a wheel-based axis event. This API returns the user-configured scroll scale factor factor.
- OH_
ArkUI_ ⚠Axis Event_ GetVertical Axis Value - 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_ ⚠Axis Event_ SetPropagation api-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_ ⚠Focus Axis Event_ GetAxis Value api-15 - Obtains the axis value of a focus axis event.
- OH_
ArkUI_ ⚠Focus Axis Event_ SetStop Propagation api-15 - Sets whether to prevent a focus axis event from bubbling up.
- OH_
ArkUI_ ⚠Hover Event_ IsHovered api-17 - Checks whether the cursor is hovering over this component.
- OH_
ArkUI_ ⚠Mouse Event_ GetMouse Action - Get the value of the mouse action type for mouse events.
- OH_
ArkUI_ ⚠Mouse Event_ GetMouse Button - Get the value of the button type for mouse events.
- OH_
ArkUI_ ⚠Mouse Event_ GetPressed Buttons api-15 - Obtains the pressed buttons from a mouse event.
- OH_
ArkUI_ ⚠Mouse Event_ GetRaw DeltaX api-15 - Obtains the x-axis offset of the mouse pointer position relative to the position in the previously reported mouse event. This value may be less than the difference between the two reported X coordinates when the mouse pointer is near the screen edge.
- OH_
ArkUI_ ⚠Mouse Event_ GetRaw DeltaY api-15 - Obtains the y-axis offset of the mouse pointer position relative to the position in the previously reported mouse event. This value may be less than the difference between the two reported Y coordinates when the mouse pointer is near the screen edge.
- OH_
ArkUI_ ⚠Pointer Event_ Create Cloned Event api-15 - Creates a cloned event pointer based on an event pointer. This API is effective only for touch events.
- OH_
ArkUI_ ⚠Pointer Event_ Destroy Cloned Event api-15 - Destroys a cloned event pointer.
- OH_
ArkUI_ ⚠Pointer Event_ GetChanged Pointer Id api-15 - Obtains the ID of the touch pointer that triggers the current touch event.
- OH_
ArkUI_ ⚠Pointer Event_ 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_ ⚠Pointer Event_ GetDisplayX ByIndex - 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_ ⚠Pointer Event_ 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_ ⚠Pointer Event_ GetDisplayY ByIndex - 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_ ⚠Pointer Event_ GetGlobal DisplayX api-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_ ⚠Pointer Event_ GetGlobal DisplayX ByIndex api-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_ ⚠Pointer Event_ GetGlobal DisplayY api-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_ ⚠Pointer Event_ GetGlobal DisplayY ByIndex api-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_ ⚠Pointer Event_ GetHistory DisplayX - 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_ ⚠Pointer Event_ GetHistory DisplayY - 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_ ⚠Pointer Event_ GetHistory Event Time - 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_ ⚠Pointer Event_ GetHistory Global DisplayX api-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_ ⚠Pointer Event_ GetHistory Global DisplayY api-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_ ⚠Pointer Event_ GetHistory Pointer Count - 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_ ⚠Pointer Event_ GetHistory Pointer Id - Obtains the unique ID of a contact point from a historical event of a pointer event (such as a touch event).
- OH_
ArkUI_ ⚠Pointer Event_ GetHistory Pressure - Obtains the pressure applied to the touchscreen in a specific historical event from a directional input event (for example, a touch event)..
- OH_
ArkUI_ ⚠Pointer Event_ GetHistory Size - 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_ ⚠Pointer Event_ GetHistory TiltX - 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_ ⚠Pointer Event_ GetHistory TiltY - 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_ ⚠Pointer Event_ GetHistory Touch Area Height - Obtains the height of the touch area in a specific historical event from a directional input event (for example, a touch event).
- OH_
ArkUI_ ⚠Pointer Event_ GetHistory Touch Area Width - Obtains the width of the touch area in a specific historical event from a directional input event (for example, a touch event).
- OH_
ArkUI_ ⚠Pointer Event_ GetHistory WindowX - 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_ ⚠Pointer Event_ GetHistory WindowY - 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_ ⚠Pointer Event_ 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_ ⚠Pointer Event_ 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_ ⚠Pointer Event_ GetInteraction Hand api-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_ ⚠Pointer Event_ GetInteraction Hand ByIndex api-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_ ⚠Pointer Event_ GetPointer Count - Obtains the number of contact points from a pointer event (such as a touch, mouse, or axis event).
- OH_
ArkUI_ ⚠Pointer Event_ GetPointer Id - Obtains the unique ID of a contact point from a pointer event (such as a touch, mouse, or axis event).
- OH_
ArkUI_ ⚠Pointer Event_ GetPressed Time ByIndex api-15 - Obtains the press time of a specified touch point. This API is effective only for touch events.
- OH_
ArkUI_ ⚠Pointer Event_ GetPressure - Obtains the pressure applied to the touchscreen from a directional input event (for example, a touch event).
- OH_
ArkUI_ ⚠Pointer Event_ GetRoll Angle api-17 - Obtains the rotation angle of the stylus around the z-axis from a UI input event.
- OH_
ArkUI_ ⚠Pointer Event_ 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_ ⚠Pointer Event_ 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_ ⚠Pointer Event_ GetTouch Area Height - 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_ ⚠Pointer Event_ GetTouch Area Width - 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_ ⚠Pointer Event_ 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_ ⚠Pointer Event_ GetWindowX ByIndex - 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_ ⚠Pointer Event_ 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_ ⚠Pointer Event_ GetWindowY ByIndex - 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_ ⚠Pointer Event_ 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_ ⚠Pointer Event_ GetX ByIndex - 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_ ⚠Pointer Event_ 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_ ⚠Pointer Event_ GetY ByIndex - 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_ ⚠Pointer Event_ Post Cloned Event api-15 - Posts a cloned event to a specific node.
- OH_
ArkUI_ ⚠Pointer Event_ SetCloned Event Action Type api-15 - Sets the action type of a cloned event.
- OH_
ArkUI_ ⚠Pointer Event_ SetCloned Event Changed Finger Id api-15 - Sets the touch point ID of a cloned pointer event.
- OH_
ArkUI_ ⚠Pointer Event_ SetCloned Event Finger IdBy Index api-15 - Sets the touch point ID of a specific contact point of a cloned event.
- OH_
ArkUI_ ⚠Pointer Event_ SetCloned Event Local Position api-15 - Sets the X and Y coordinates of a cloned event relative to the upper left corner of the current component.
- OH_
ArkUI_ ⚠Pointer Event_ SetCloned Event Local Position ByIndex api-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_ ⚠Pointer Event_ SetIntercept HitTest Mode - 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_ ⚠Pointer Event_ SetStop Propagation - 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_ ⚠UIInput Event_ GetAction - Obtains the action type of this UI input event.
- OH_
ArkUI_ ⚠UIInput Event_ GetDevice Id api-14 - Obtains the ID of device that triggers UI input event.
- OH_
ArkUI_ ⚠UIInput Event_ GetEvent Target Global PositionX api-17 - Obtains the global X coordinate of the component hit by an event.
- OH_
ArkUI_ ⚠UIInput Event_ GetEvent Target Global PositionY api-17 - Obtains the global Y coordinate of the component hit by an event.
- OH_
ArkUI_ ⚠UIInput Event_ GetEvent Target Height api-17 - Obtains the height of the component hit by an event.
- OH_
ArkUI_ ⚠UIInput Event_ GetEvent Target PositionX api-17 - Obtains the X coordinate of the component hit by an event.
- OH_
ArkUI_ ⚠UIInput Event_ GetEvent Target PositionY api-17 - Obtains the Y coordinate of the component hit by an event.
- OH_
ArkUI_ ⚠UIInput Event_ GetEvent Target Width api-17 - Obtains the width of the component hit by an event.
- OH_
ArkUI_ ⚠UIInput Event_ GetEvent Time - Obtains the time when this UI input event occurs.
- OH_
ArkUI_ ⚠UIInput Event_ GetLatest Status api-20 - Use this method to obtain the execution status of the latest UI input related method.
- OH_
ArkUI_ ⚠UIInput Event_ GetModifier KeyStates api-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_ ⚠UIInput Event_ GetPressed Keys api-14 - Obtains all keys that are pressed from UI input event. Only supports key events currently.
- OH_
ArkUI_ ⚠UIInput Event_ GetSource Type - Obtains the source type of a UI input event.
- OH_
ArkUI_ ⚠UIInput Event_ GetTarget Display Id api-15 - Obtains the ID of the screen where the UI input event occurs.
- OH_
ArkUI_ ⚠UIInput Event_ GetTool Type - Obtains the tool type of a UI input event.
- OH_
ArkUI_ ⚠UIInput Event_ GetType - Obtains the type of a UI input event.