harmony 鸿蒙Introduction to Input Kit

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

Introduction to Input Kit

Function Description

Input Kit provides services for a plurality of input devices, such as the touchpad, touchscreen, mouse, and keyboard. It normalizes various input events to ensure unified and smooth experience for users when interacting with different input devices.

In addition to the basic input event services, Input Kit provides APIs for you to implement functions such as obtaining the device list and changing the mouse pointer style.

How Input Kit Works

As a basic service provided by the system for applications, Input Kit fulfills input device management as well as input event management, receiving, preprocessing, and distribution, and reports the input events to applications through the inner SDK and JSkit. The operation mechanism is as follows:

MMI-operation

Constraints

  1. Before using the following functions, declare the corresponding permissions.
API Description Permission
setShieldStatus(shieldMode: ShieldMode, isShield: boolean): void Sets the shortcut key shield status. The value true means to shield shortcut keys, and the value false means the opposite. ohos.permission.INPUT_CONTROL_DISPATCHING
getShieldStatus(shieldMode: ShieldMode): boolean Obtains the shortcut key shield status. The value true means to shield shortcut keys, and the value false means the opposite. ohos.permission.INPUT_CONTROL_DISPATCHING
  1. The APIs provided by the inputConsumer, inputEventClient, inputMonitor, and shortKey modules are system APIs. Wherein, the APIs provided by the inputMonitor module require the ohos.permission.INPUT_MONITORING permission.

你可能感兴趣的鸿蒙文章

harmony 鸿蒙Input Kit (Multimodal Input)

harmony 鸿蒙Combination Key Development

harmony 鸿蒙Input Device Development

harmony 鸿蒙Event Injection Development

harmony 鸿蒙Input Monitor Development

harmony 鸿蒙Event Interception Development (C/C++)

harmony 鸿蒙Event Listening Development (C/C++)

harmony 鸿蒙Mouse Pointer Development

harmony 鸿蒙Shortcut Key Development

0  赞