Implementing Interaction Responses
The ArkUI framework offers a comprehensive set of APIs for handling input events from various peripherals. Beyond basic input handling, ArkUI also provides advanced APIs for responding to normalized user interactions such as gestures, drag and drop, and focus management.
Compared with raw input events, gestures are the preferred method for handling user interactions. Gestures abstract away device-specific differences and represent high-level interaction intent. For example, a click operation may be implemented by using a finger touch control, or may be completed by using a mouse click. An application only needs to connect to one TapGesture to support click interactions on various input equipment.
Interaction Mechanism Overview: explains the core concepts and principles behind ArkUI's interaction model.
Input Devices and Events: covers raw input events from different devices and how to process them.
Implementing Gesture Responses: explains how to handle standardized gesture interactions.
Supporting Unified Drag-and-Drop: guides you through implementing consistent drag and drop behavior across devices.
Supporting Focus Processing: shows how to manage component focus within the UI.
When developing UI components using the NDK, you can add interaction responses through the following resources:
- Binding Basic Input Events: Add basic input event responses to components using NDK APIs.
- Binding Gesture Events: Add gesture support to components for richer interaction.
- Binding Drag Events: Implement unified drag and drop functionality using NDK APIs.