openharmony 鸿蒙 capi-hid-ddk-types-h

2026-08-25 浏览 (1)

hid_ddk_types.h

Overview

Defines the enum variables and structs used in the HID DDK.

File to include: <hid/hid_ddk_types.h>

Library: libhid.z.so

System capability: SystemCapability.Driver.HID.Extension

Since: 11

Related module: HidDdk

Summary

Structs

Nametypedef KeywordDescription
Hid_EmitItemHid_EmitItemRepresents the event information.
Hid_DeviceHid_DeviceDefines a struct for basic device information.
Hid_EventTypeArrayHid_EventTypeArrayDefines a struct for an array of event types.
Hid_KeyCodeArrayHid_KeyCodeArrayDefines a struct for the key code array.
Hid_AbsAxesArrayHid_AbsAxesArrayDefines an array of absolute coordinates.
Hid_RelAxesArrayHid_RelAxesArrayDefines an array of relative coordinates.
Hid_MscEventArrayHid_MscEventArrayDefines an array of miscellaneous events.
Hid_EventPropertiesHid_EventPropertiesDefines a struct for the event properties of a device.
Hid_RawDevInfoHid_RawDevInfoDefines the raw device information.
Hid_DeviceHandleHid_DeviceHandleDefines the opaque USB HID device structure.

Enums

Nametypedef KeywordDescription
Hid_DevicePropHid_DevicePropEnumerates the properties of input devices.
Hid_EventTypeHid_EventTypeEnumerates the event types.
Hid_SynEventHid_SynEventEnumerates sync events.
Hid_KeyCodeHid_KeyCodeEnumerates the key codes.
Hid_AbsAxesHid_AbsAxesEnumerates the absolute coordinates.
Hid_RelAxesHid_RelAxesEnumerates the relative coordinates.
Hid_MscEventHid_MscEventEnumerates miscellaneous input events.
Hid_DdkErrCodeHid_DdkErrCodeEnumerates the HID DDK error codes.
Hid_ReportTypeHid_ReportTypeDefines the report (data packets exchanged between the HID device and the host) type.

Macros

NameDescription
HID_MAX_REPORT_BUFFER_SIZE (16 * 1024 - 1)Defines the maximum size of the report buffer.

Enum Description

Hid_DeviceProp

enum Hid_DeviceProp

Description

Enumerates the properties of input devices.

Since: 11

EnumDescription
HID_PROP_POINTER = 0x00Pointer device.
HID_PROP_DIRECT = 0x01Direct input device.
HID_PROP_BUTTON_PAD = 0x02Touch device with bottom keys.
HID_PROP_SEMI_MT = 0x03Full multi-touch device.
HID_PROP_TOP_BUTTON_PAD = 0x04Touch device with top soft keys.
HID_PROP_POINTING_STICK = 0x05Pointing stick.
HID_PROP_ACCELEROMETER = 0x06Accelerometer.

Hid_EventType

enum Hid_EventType

Description

Enumerates the event types.

Since: 11

EnumDescription
HID_EV_SYN = 0x00Sync event.
HID_EV_KEY = 0x01Key event.
HID_EV_REL = 0x02Relative coordinate event.
HID_EV_ABS = 0x03Absolute coordinate event.
HID_EV_MSC = 0x04Miscellaneous event.

Hid_SynEvent

enum Hid_SynEvent

Description

Enumerates sync events.

Since: 11

EnumDescription
HID_SYN_REPORT = 0End of an event.
HID_SYN_CONFIG = 1Configuration synchronization.
HID_SYN_MT_REPORT = 2End of a multi-touch ABS data packet.
HID_SYN_DROPPED = 3Event discarded.

Hid_KeyCode

enum Hid_KeyCode

Description

Enumerates the key codes.

Since: 11

EnumDescription
HID_KEY_A = 30Key A
HID_KEY_B = 48Key B
HID_KEY_C = 46Key C
HID_KEY_D = 32Key D
HID_KEY_E = 18Key E
HID_KEY_F = 33Key F
HID_KEY_G = 34Key G
HID_KEY_H = 35Key H
HID_KEY_I = 23Key I
HID_KEY_J = 36Key J
HID_KEY_K = 37Key K
HID_KEY_L = 38Key L
HID_KEY_M = 50Key M
HID_KEY_N = 49Key N
HID_KEY_O = 24Key O
HID_KEY_P = 25Key P
HID_KEY_Q = 16Key Q
HID_KEY_R = 19Key R
HID_KEY_S = 31Key S
HID_KEY_T = 20Key T
HID_KEY_U = 22Key U
HID_KEY_V = 47Key V
HID_KEY_W = 17Key W
HID_KEY_X = 45Key X
HID_KEY_Y = 21Key Y
HID_KEY_Z = 44Key Z
HID_KEY_ESC = 1Key Esc
HID_KEY_0 = 11Key 0
HID_KEY_1 = 2Key 1
HID_KEY_2 = 3Key 2
HID_KEY_3 = 4Key 3
HID_KEY_4 = 5Key 4
HID_KEY_5 = 6Key 5
HID_KEY_6 = 7Key 6
HID_KEY_7 = 8Key 7
HID_KEY_8 = 9Key 8
HID_KEY_9 = 10Key 9
HID_KEY_GRAVE = 41Key grave (`)
HID_KEY_MINUS = 12Key -
HID_KEY_EQUALS = 13Key =
HID_KEY_BACKSPACE = 14Key Backspace
HID_KEY_LEFT_BRACKET = 26Key [
HID_KEY_RIGHT_BRACKET = 27Key ]
HID_KEY_ENTER = 28Key Enter
HID_KEY_LEFT_SHIFT = 42Left Shift
HID_KEY_BACKSLASH = 43Key |
HID_KEY_SEMICOLON = 39Key ;
HID_KEY_APOSTROPHE = 40Key '
HID_KEY_SPACE = 57Key Space
HID_KEY_SLASH = 53Key /
HID_KEY_COMMA = 51Key comma (,)
HID_KEY_PERIOD = 52Key period (.)
HID_KEY_RIGHT_SHIFT = 54Right Shift
HID_KEY_NUMPAD_0 = 82Numeral 0 on the numeric keypad
HID_KEY_NUMPAD_1 = 79Numeral 1 on the numeric keypad
HID_KEY_NUMPAD_2 = 80Numeral 2 on the numeric keypad
HID_KEY_NUMPAD_3 = 81Numeral 3 on the numeric keypad
HID_KEY_NUMPAD_4 = 75Numeral 4 on the numeric keypad
HID_KEY_NUMPAD_5 = 76Numeral 5 on the numeric keypad
HID_KEY_NUMPAD_6 = 77Numeral 6 on the numeric keypad
HID_KEY_NUMPAD_7 = 71Numeral 7 on the numeric keypad
HID_KEY_NUMPAD_8 = 72Numeral 8 on the numeric keypad
HID_KEY_NUMPAD_9 = 73Numeral 9 on the numeric keypad
HID_KEY_NUMPAD_DIVIDE = 70Slash key (/) on the numeric keypad
HID_KEY_NUMPAD_MULTIPLY = 55Asterisk key (*) on the numeric keypad
HID_KEY_NUMPAD_SUBTRACT = 74Minus key (-) on the numeric keypad
HID_KEY_NUMPAD_ADD = 78Plus key (+) on the numeric keypad
HID_KEY_NUMPAD_DOT = 83Decimal point (.) on the numeric keypad
HID_KEY_SYSRQ = 99SYSRQ key
HID_KEY_DELETE = 111Delete key
HID_KEY_MUTE = 113Mute key
HID_KEY_VOLUME_DOWN = 114Volume Down key
HID_KEY_VOLUME_UP = 115Volume Up key
HID_KEY_BRIGHTNESS_DOWN = 224Brightness Down key
HID_KEY_BRIGHTNESS_UP = 225Brightness Up key
HID_BTN_0 = 0x100Button 0
HID_BTN_1 = 0x101Button 1
HID_BTN_2 = 0x102Button 2
HID_BTN_3 = 0x103Button 3
HID_BTN_4 = 0x104Button 4
HID_BTN_5 = 0x105Button 5
HID_BTN_6 = 0x106Button 6
HID_BTN_7 = 0x107Button 7
HID_BTN_8 = 0x108Button 8
HID_BTN_9 = 0x109Button 9
HID_BTN_LEFT = 0x110Left mouse button
HID_BTN_RIGHT = 0x111Right mouse button
HID_BTN_MIDDLE = 0x112Middle mouse button
HID_BTN_SIDE = 0x113Side mouse button
HID_BTN_EXTRA = 0x114Extra mouse button
HID_BTN_FORWARD = 0x115Mouse forward button
HID_BTN_BACKWARD = 0x116Mouse backward button
HID_BTN_TASK = 0x117Mouse task button
HID_BTN_TOOL_PEN = 0x140Pen
HID_BTN_TOOL_RUBBER = 0x141Eraser
HID_BTN_TOOL_BRUSH = 0x142Brush
HID_BTN_TOOL_PENCIL = 0x143Pencil
HID_BTN_TOOL_AIRBRUSH = 0x144Air brush
HID_BTN_TOOL_FINGER = 0x145Finger
HID_BTN_TOOL_MOUSE = 0x146Mouse
HID_BTN_TOOL_LENS = 0x147Lens
HID_BTN_TOOL_QUINT_TAP = 0x148Five-finger touch
HID_BTN_STYLUS3 = 0x149Stylus 3
HID_BTN_TOUCH = 0x14aTouch
HID_BTN_STYLUS = 0x14bStylus
HID_BTN_STYLUS2 = 0x14cStylus 2
HID_BTN_TOOL_DOUBLE_TAP = 0x14dTwo-finger touch
HID_BTN_TOOL_TRIPLE_TAP = 0x14eThree-finger touch
HID_BTN_TOOL_QUAD_TAP = 0x14fFour-finger touch
HID_BTN_WHEEL = 0x150Scroll wheel

Hid_AbsAxes

enum Hid_AbsAxes

Description

Enumerates the absolute coordinates.

Since: 11

EnumDescription
HID_ABS_X = 0x00X axis
HID_ABS_Y = 0x01Y axis
HID_ABS_Z = 0x02Z axis
HID_ABS_RX = 0x03X axis of the right analog stick
HID_ABS_RY = 0x04Y axis of the right analog stick
HID_ABS_RZ = 0x05Z axis of the right analog stick
HID_ABS_THROTTLE = 0x06Throttle
HID_ABS_RUDDER = 0x07Rudder
HID_ABS_WHEEL = 0x08Scroll wheel
HID_ABS_GAS = 0x09Gas
HID_ABS_BRAKE = 0x0aBrake
HID_ABS_HAT0X = 0x10HAT0X
HID_ABS_HAT0Y = 0x11HAT0Y
HID_ABS_HAT1X = 0x12HAT1X
HID_ABS_HAT1Y = 0x13HAT1Y
HID_ABS_HAT2X = 0x14HAT2X
HID_ABS_HAT2Y = 0x15HAT2Y
HID_ABS_HAT3X = 0x16HAT3X
HID_ABS_HAT3Y = 0x17HAT3Y
HID_ABS_PRESSURE = 0x18Pressure
HID_ABS_DISTANCE = 0x19Distance
HID_ABS_TILT_X = 0x1aTilt of X axis
HID_ABS_TILT_Y = 0x1bTilt of Y axis
HID_ABS_TOOL_WIDTH = 0x1cWidth of the touch tool
HID_ABS_VOLUME = 0x20Volume
HID_ABS_MISC = 0x28Others

Hid_RelAxes

enum Hid_RelAxes

Description

Enumerates the relative coordinates.

Since: 11

EnumDescription
HID_REL_X = 0x00X axis
HID_REL_Y = 0x01Y axis
HID_REL_Z = 0x02Z axis
HID_REL_RX = 0x03X axis of the right analog stick
HID_REL_RY = 0x04Y axis of the right analog stick
HID_REL_RZ = 0x05Z axis of the right analog stick
HID_REL_HWHEEL = 0x06Horizontal scroll wheel
HID_REL_DIAL = 0x07Scale
HID_REL_WHEEL = 0x08Scroll wheel
HID_REL_MISC = 0x09Others
HID_REL_RESERVED = 0x0aReserved
HID_REL_WHEEL_HI_RES = 0x0bHigh-resolution scroll wheel
HID_REL_HWHEEL_HI_RES = 0x0cHigh-resolution horizontal scroll wheel

Hid_MscEvent

enum Hid_MscEvent

Description

Enumerates miscellaneous input events.

Since: 11

EnumDescription
HID_MSC_SERIAL = 0x00Serial number
HID_MSC_PULSE_LED = 0x01Pulse
HID_MSC_GESTURE = 0x02Gesture
HID_MSC_RAW = 0x03Start event
HID_MSC_SCAN = 0x04Scan
HID_MSC_TIMESTAMP = 0x05Timestamp

Hid_DdkErrCode

enum Hid_DdkErrCode

Description

Enumerates the HID DDK error codes.

Since: 11

EnumDescription
HID_DDK_SUCCESS = 0Operation success.
HID_DDK_NO_PERM = 201No permission. The value is changed from -6 to 201 since API version 16.
HID_DDK_INVALID_PARAMETER = 401Invalid parameter. The value is changed from -2 to 401 since API version 16.
HID_DDK_FAILURE = 27300001Operation failed. The value is changed from -1 to 27300001 since API version 16.
HID_DDK_NULL_PTR = 27300002Null pointer. The value is changed from -4 to 27300002 since API version 16.
HID_DDK_INVALID_OPERATION = 27300003Invalid operation. The value is changed from -3 to 27300003 since API version 16.
HID_DDK_TIMEOUT = 27300004Timeout. The value is changed from -5 to 27300004 since API version 16.
HID_DDK_INIT_ERROR = 27300005DDK initialization error.
Since: 18
HID_DDK_SERVICE_ERROR = 27300006Service communication error.
Since: 18
HID_DDK_MEMORY_ERROR = 27300007Memory errors, such as memory data copy failure and memory allocation failure.
Since: 18
HID_DDK_IO_ERROR = 27300008I/O operation error.
Since: 18
HID_DDK_DEVICE_NOT_FOUND = 27300009Device not found.
Since: 18

Hid_ReportType

enum Hid_ReportType

Description

Defines the report (data packets exchanged between the HID device and the host) type.

Since: 18

EnumDescription
HID_INPUT_REPORT = 0Input report.
HID_OUTPUT_REPORT = 1Output report.
HID_FEATURE_REPORT = 2Feature report.

HID_MAX_REPORT_BUFFER_SIZE

HID_MAX_REPORT_BUFFER_SIZE (16 * 1024 - 1)

Description

Defines the maximum size of the report buffer.

Since: 18

你可能感兴趣的鸿蒙文章

openharmony 鸿蒙 capi-scsiperipheralddk-scsiperipheral-request

openharmony 鸿蒙 capi-usbddk-usbconfigdescriptor

openharmony 鸿蒙 capi-hidddk

openharmony 鸿蒙 capi-usbddk

openharmony 鸿蒙 capi-hidddk-hid-absaxesarray

openharmony 鸿蒙 capi-scsiperipheralddk-scsiperipheral-response

openharmony 鸿蒙 capi-scsi-peripheral-api-h

openharmony 鸿蒙 capi-hidddk-hid-relaxesarray

openharmony 鸿蒙 js-apis-driver-deviceManager

openharmony 鸿蒙 capi-hidddk-hid-eventtypearray

  • 所属分类: 后端技术
  • 本文标签: 软件 鸿蒙
  • 版权声明: 本文链接 https://seaxiang.com/blog/E6InI7ni