1 Star 0 Fork 5.3K

笛荡 / docs

forked from OpenHarmony / docs 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
input.md 31.28 KB
AI 代码解读
一键复制 编辑 原始数据 按行查看 历史
wenjun 提交于 2020-09-08 10:08 . add OpenHarmony 1.0 baseline

Input

Overview

Provides driver interfaces for the input service.

These driver interfaces can be used to open and close input device files, get input events, query device information, register callback functions, and control the feature status.

Since:

1.0

Version:

1.0

Summary

Files

File Name

Description

input_controller.h

Declares the driver interfaces for controlling the business process of input devices.

input_manager.h

Declares the driver interfaces for managing input devices.

input_reporter.h

Declares the driver interfaces for reporting data of input devices.

input_type.h

Declares types of input devices as well as the structure and enumeration types used by driver interfaces.

Data Structures

Data Structure Name

Description

InputController

Provides interfaces for controlling the business process of input devices.

InputManager

Provides interfaces for managing input devices.

IInputInterface

Defines interfaces for providing driver capabilities of input devices.

InputReporter

Provides interfaces for reporting event data of input devices.

InputExtraCmd

Defines the extra commands.

InputEventData

Describes the input event data.

InputReportEventCb

Describes the input event callback registered by the input service.

DeviceInfo

Describes basic device information of the input device.

Enumerations

Enumeration Name

Description

RetStatus { INPUT_SUCCESS, INPUT_EINVAL, INPUT_EFAULT, INPUT_ENOMEM, INPUT_ETIMEOUT, INPUT_EUNSUPPORT, INPUT_EUNKNOWN }

Enumerates return values.

InputDevType { INDEV_TYPE_TOUCH, INDEV_TYPE_KEY, INDEV_TYPE_KEYBOARD, INDEV_TYPE_MOUSE, INDEV_TYPE_BUTTON, INDEV_TYPE_CROWN, INDEV_TYPE_ENCODER, INDEV_TYPE_UNKNOWN }

Enumerates input device types.

PowerStatus { INPUT_RESUME, INPUT_SUSPEND, INPUT_LOW_POWER, INPUT_POWER_STATUS_UNKNOWN }

Enumerates power statuses.

CapacitanceTest { BASE_TEST, FULL_TEST, MMI_TEST, RUNNING_TEST, TEST_TYPE_UNKNOWN }

Enumerates types of capacitance tests.

Functions

Function Name

Description

GetInputInterface (IInputInterface **interface)

int

Gets all interfaces for performing operations on input devices.

Details

Enumeration Type Documentation

CapacitanceTest

enum [CapacitanceTest](input.md#gae96e484cfd64ea37b5b7782f57f38a21)

Description:

Enumerates types of capacitance tests.

Enumerator

Description

BASE_TEST

Basic capacitance test

FULL_TEST

Full capacitance self-test

MMI_TEST

Man-Machine Interface (MMI) capacitance test

RUNNING_TEST

Running capacitance test

TEST_TYPE_UNKNOWN

Unknown test type

InputDevType

enum [InputDevType](input.md#gaa8225ba155dfa1ef2c4119c832bc4dd3)

Description:

Enumerates input device types.

Enumerator

Description

INDEV_TYPE_TOUCH

Touchscreen

INDEV_TYPE_KEY

Physical key

INDEV_TYPE_KEYBOARD

Keyboard

INDEV_TYPE_MOUSE

Mouse

INDEV_TYPE_BUTTON

Virtual button

INDEV_TYPE_CROWN

Watch crown

INDEV_TYPE_ENCODER

Customized type of a specific function or event

INDEV_TYPE_UNKNOWN

Unknown input device type

PowerStatus

enum [PowerStatus](input.md#ga65e6bb4d942c22dba9975253b0a1d73f)

Description:

Enumerates power statuses.

Enumerator

Description

INPUT_RESUME

Resume status

INPUT_SUSPEND

Suspend status

INPUT_LOW_POWER

Low-power status

INPUT_POWER_STATUS_UNKNOWN

Unknown power status

RetStatus

enum [RetStatus](input.md#ga85d58a5185669daa4995e332b63eba7a)

Description:

Enumerates return values.

Enumerator

Description

INPUT_SUCCESS

Success

INPUT_EINVAL

Invalid value

INPUT_EFAULT

Runtime error

INPUT_ENOMEM

Failed to apply for memory

INPUT_ETIMEOUT

Execution timed out

INPUT_EUNSUPPORT

The feature is not supported

INPUT_EUNKNOWN

Unknown error

Function Documentation

GetInputInterface()

int GetInputInterface ([IInputInterface](iinputinterface.md) ** interface)

Description:

Gets all interfaces for performing operations on input devices.

You can call this function after the input service is started.

Parameters:

Name

Description

interface Indicates the double pointer to the interface for performing operations on input devices.

Returns:

Returns 0 if the operation is successful; returns an error code defined in RetStatus otherwise.

1
https://gitee.com/SolarBird/docs.git
git@gitee.com:SolarBird/docs.git
SolarBird
docs
docs
master

搜索帮助