hmos-multidevice-interaction-methods

Implements touch, mouse, keyboard, and stylus interaction adaptation for HarmonyOS multi-device apps.

2|Updated Jun 21, 2026
One-click install
npx skills add https://github.com/IsKenKenYa/skills --skill hmos-multidevice-interaction-methods-iskenkenya
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: hmos-multidevice-interaction-methods
Source: https://github.com/IsKenKenYa/skills/tree/main/skills/harmonyos/solutions/HMOS-technologies/multi-device/hmos-multidevice-interaction-methods
Command: npx skills add https://github.com/IsKenKenYa/skills --skill hmos-multidevice-interaction-methods-iskenkenya

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? HarmonyOS apps running across phones, tablets, 2-in-1 PCs, and TVs must handle touch, mouse, keyboard, and stylus input consistently, and this Skill provides interaction schemes and event unification strategies so one codebase serves all input methods. ## Core Features & Use Cases - Interaction Unification: Unify touch tap with mouse left-click, long-press with right-click context menus, and touch/mouse drag through shared ArkUI event handlers. - Mouse, Keyboard, and Stylus Adaptation: Implement hover feedback, right-click menus, Tab/arrow-key focus navigation, keyboard shortcuts, and stylus pressure-sensitive drawing. - Scenario Routing: Route requests through four scenes (INPUT-01 to INPUT-04) across REQ, DEV, FIX, and VAL phases with structured output fields. - Use Case: When building a desktop file manager page that needs mouse hover effects, right-click menus, keyboard focus navigation, and consistent touch behavior, this Skill guides the design, implementation, and verification plan. ## Quick Start Ask the agent to design a HarmonyOS desktop page that supports mouse hover, right-click menus, keyboard focus navigation, and unified touch interaction. ## Core Features & Use Cases See above for the full feature list.

Frequently Asked Questions about hmos-multidevice-interaction-methods

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I unify touch and mouse click events in HarmonyOS ArkUI?

Use the onClick event, which handles both touch taps and mouse left-clicks, and inspect event.sourceType (SourceType.TouchScreen or SourceType.Mouse) to distinguish the input source. For context menus, bindContextMenu with ResponseType.LongPress and ResponseType.RightClick unifies long-press and right-click.

How to implement keyboard focus navigation in HarmonyOS apps?

Set focusable(true) and use tabIndex for Tab-key order, or nextFocus with up/down/left/right component ids for arrow-key navigation. Customize focus appearance with the focusBox property or by tracking onFocus/onBlur state to change styles.

How do I detect stylus input and pressure in HarmonyOS?

In the onTouch callback, check event.sourceTool === SourceTool.Pen to distinguish stylus from finger touch, then read event.touches[0].pressure (range [0,1)) to adjust stroke width. Use canIUse('SystemCapability.Stylus.Handwrite') to verify device support first.

Does HarmonyOS support mouse hover effects on tablets and PCs?

Yes, ArkUI provides the hoverEffect attribute with Highlight, Scale, and None options, plus the onHover callback for fully custom hover styles. These apply when a mouse or trackpad is connected to tablets, 2-in-1 devices, or PCs.

Why is my stylus pressure sensitivity not working in HarmonyOS?

Common causes include reading pressure without checking sourceTool is Pen, not handling undefined pressure values, or the device lacking stylus capability. Verify support with canIUse('SystemCapability.Stylus.Handwrite') and guard pressure reads before computing line width.

When should I not use interaction unification in HarmonyOS?

Skip unification when a page targets only a single input method, such as a pure touch phone app with no mouse or keyboard attachment. The skill also excludes pure visual animation tuning and business-flow changes unrelated to input methods.