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

  1. enum[CapacitanceTest]($api-api-SmartVision-Devices-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

  1. enum[InputDevType]($api-api-SmartVision-Devices-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

  1. enum[PowerStatus]($api-api-SmartVision-Devices-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

  1. enum[RetStatus]($api-api-SmartVision-Devices-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()

  1. intGetInputInterface([IInputInterface]($api-api-SmartVision-Devices-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

interfaceIndicates 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.