1# oh_input_manager.h
2
3
4## Overview
5
6Provides functions such as event injection and status query.
7
8**System capability**: SystemCapability.MultimodalInput.Input.Core
9
10**Library**: libohinput.so
11
12**Since**: 12
13
14**Related module**: [Input](input.md)
15
16
17## Summary
18
19
20### Structs
21
22| Name| Description|
23| -------- | -------- |
24| struct  [Input_InterceptorEventCallback](_input___interceptor_event_callback.md) | Defines the structure of the interceptor for callback events, including mouse events, touch events, and axis events. |
25| struct  [Input_DeviceListener](_input___device_listener.md) | Defines a listener for device hot swap events. |
26
27
28### Types
29
30| Name| Description|
31| -------- | -------- |
32| typedef enum [Input_KeyStateAction](input.md#input_keystateaction) [Input_KeyStateAction](input.md#input_keystateaction) | Provides the enum values of the key status. |
33| typedef enum [Input_KeyEventAction](input.md#input_keyeventaction) [Input_KeyEventAction](input.md#input_keyeventaction) | Provides the enum values of the key event type. |
34| typedef enum [Input_MouseEventAction](input.md#input_mouseeventaction) [Input_MouseEventAction](input.md#input_mouseeventaction) | Provides the enum values of mouse actions. |
35| typedef enum [InputEvent_MouseAxis](input.md#inputevent_mouseaxis) [InputEvent_MouseAxis](input.md#inputevent_mouseaxis) | Provides the enum values of mouse axis event types. |
36| typedef enum [Input_MouseEventButton](input.md#input_mouseeventbutton) [Input_MouseEventButton](input.md#input_mouseeventbutton) | Provides the enum values of mouse buttons. |
37| typedef enum [Input_TouchEventAction](input.md#input_toucheventaction) [Input_TouchEventAction](input.md#input_toucheventaction) | Provides the enum values of touch actions. |
38| typedef enum [InputEvent_SourceType](input.md#inputevent_sourcetype) [InputEvent_SourceType](input.md#inputevent_sourcetype) | Provides the enum values of event source types. |
39| typedef enum [Input_KeyboardType](input.md#input_keyboardtype) [Input_KeyboardType](input.md#input_keyboardtype) | Provides the enum values of keyboard types of the input device. |
40| typedef struct [Input_KeyState](input.md#input_keystate) [Input_KeyState](input.md#input_keystate) | Defines key information, which identifies a key pressing behavior. For example, the Ctrl key information contains the key value and key type. |
41| typedef struct [Input_KeyEvent](input.md#input_keyevent) [Input_KeyEvent](input.md#input_keyevent) | Defines the key event to be injected. |
42| typedef struct [Input_MouseEvent](input.md#input_mouseevent) [Input_MouseEvent](input.md#input_mouseevent) | Defines the mouse event to be injected. |
43| typedef struct [Input_TouchEvent](input.md#input_touchevent) [Input_TouchEvent](input.md#input_touchevent) | Defines the touch event to be injected. |
44| typedef struct [Input_AxisEvent](input.md#input_axisevent) [Input_AxisEvent](input.md#input_axisevent) | Defines an axis event. |
45| typedef enum [Input_Result](input.md#input_result) [Input_Result](input.md#input_result) | Provides the enum values of error codes. |
46| typedef void(\* [Input_KeyEventCallback](input.md#input_keyeventcallback)) (const [Input_KeyEvent](input.md#input_keyevent) \*keyEvent) | Defines a lifecycle callback for **keyEvent**. If the callback is triggered, **keyEvent** will be destroyed. |
47| typedef void(\* [Input_MouseEventCallback](input.md#input_mouseeventcallback)) (const [Input_MouseEvent](input.md#input_mouseevent) \*mouseEvent) | Defines a lifecycle callback for **mouseEvent**. If the callback is triggered, **mouseEvent** will be destroyed. |
48| typedef void(\* [Input_TouchEventCallback](input.md#input_toucheventcallback)) (const [Input_TouchEvent](input.md#input_touchevent) \*touchEvent) | Defines a lifecycle callback for **touchEvent**. If the callback is triggered, **touchEvent** will be destroyed. |
49| typedef void(\* [Input_AxisEventCallback](input.md#input_axiseventcallback)) (const [Input_AxisEvent](input.md#input_axisevent) \*axisEvent) | Defines a lifecycle callback for **axisEvent**. If the callback is triggered, **axisEvent** will be destroyed. |
50| typedef void(\* [Input_HotkeyCallback](input.md#input_hotkeycallback)) ([Input_Hotkey](input.md#input_hotkey) \*hotkey) | Defines the callback used to return shortcut key events. |
51| typedef void(\* [Input_DeviceAddedCallback](input.md#input_deviceaddedcallback)) (int32_t deviceId) | Defines a callback used to receive device insertion events. |
52| typedef void(\* [Input_DeviceRemovedCallback](input.md#input_deviceremovedcallback)) (int32_t deviceId) | Defines a callback used to receive device removal events. |
53| typedef struct [Input_InterceptorEventCallback](_input___interceptor_event_callback.md) [Input_InterceptorEventCallback](input.md#input_interceptoreventcallback) | Defines the structure of the interceptor for callback events, including mouse events, touch events, and axis events. |
54| typedef struct [Input_DeviceListener](_input___device_listener.md) [Input_DeviceListener](input.md#input_devicelistener) | Defines a listener for device hot swap events. |
55| typedef struct [Input_InterceptorOptions](input.md#input_interceptoroptions) [Input_InterceptorOptions](input.md#input_interceptoroptions) | Defines event interception options. |
56| typedef struct [Input_Hotkey](input.md#input_hotkey) [Input_Hotkey](input.md#input_hotkey) | Defines the shortcut key structure. |
57| typedef struct [Input_DeviceInfo](input.md#input_deviceinfo) [Input_DeviceInfo](input.md#input_deviceinfo) | Defines the input device information. |
58
59
60### Enums
61
62| Name| Description|
63| -------- | -------- |
64| [Input_KeyStateAction](input.md#input_keystateaction) {<br>[KEY_DEFAULT](input.md) = -1, [KEY_PRESSED](input.md) = 0, [KEY_RELEASED](input.md) = 1, [KEY_SWITCH_ON](input.md) = 2,<br>[KEY_SWITCH_OFF](input.md) = 3<br>} | Provides the enum values of the key status. |
65| [Input_KeyEventAction](input.md#input_keyeventaction) { [KEY_ACTION_CANCEL](input.md) = 0, [KEY_ACTION_DOWN](input.md) = 1, [KEY_ACTION_UP](input.md) = 2 } | Provides the enum values of the key event type. |
66| [Input_MouseEventAction](input.md#input_mouseeventaction) {<br>[MOUSE_ACTION_CANCEL](input.md) = 0, [MOUSE_ACTION_MOVE](input.md) = 1, [MOUSE_ACTION_BUTTON_DOWN](input.md) = 2, [MOUSE_ACTION_BUTTON_UP](input.md) = 3,<br>[MOUSE_ACTION_AXIS_BEGIN](input.md) = 4, [MOUSE_ACTION_AXIS_UPDATE](input.md) = 5, [MOUSE_ACTION_AXIS_END](input.md) = 6<br>} | Provides the enum values of mouse actions. |
67| [InputEvent_MouseAxis](input.md#inputevent_mouseaxis) { [MOUSE_AXIS_SCROLL_VERTICAL](input.md) = 0, [MOUSE_AXIS_SCROLL_HORIZONTAL](input.md) = 1 } | Provides the enum values of mouse axis event types. |
68| [Input_MouseEventButton](input.md#input_mouseeventbutton) {<br>[MOUSE_BUTTON_NONE](input.md) = -1, [MOUSE_BUTTON_LEFT](input.md) = 0, [MOUSE_BUTTON_MIDDLE](input.md) = 1, [MOUSE_BUTTON_RIGHT](input.md) = 2,<br>[MOUSE_BUTTON_FORWARD](input.md) = 3, [MOUSE_BUTTON_BACK](input.md) = 4<br>} | Provides the enum values of mouse buttons. |
69| [Input_TouchEventAction](input.md#input_toucheventaction) { [TOUCH_ACTION_CANCEL](input.md) = 0, [TOUCH_ACTION_DOWN](input.md) = 1, [TOUCH_ACTION_MOVE](input.md) = 2, [TOUCH_ACTION_UP](input.md) = 3 } | Provides the enum values of touch actions. |
70| [InputEvent_SourceType](input.md#inputevent_sourcetype) { [SOURCE_TYPE_MOUSE](input.md) = 1, [SOURCE_TYPE_TOUCHSCREEN](input.md) = 2, [SOURCE_TYPE_TOUCHPAD](input.md) = 3 } | Provides the enum values of event source types. |
71| [Input_KeyboardType](input.md#input_keyboardtype) {<br>[KEYBOARD_TYPE_NONE](input.md) = 0, [KEYBOARD_TYPE_UNKNOWN](input.md) = 1, [KEYBOARD_TYPE_ALPHABETIC](input.md) = 2, [KEYBOARD_TYPE_DIGITAL](input.md) = 3,<br>[KEYBOARD_TYPE_STYLUS](input.md) = 4, [KEYBOARD_TYPE_REMOTE_CONTROL](input.md) = 5<br>} | Provides the enum values of keyboard types of the input device. |
72| [Input_Result](input.md#input_result) {<br>[INPUT_SUCCESS](input.md) = 0, [INPUT_PERMISSION_DENIED](input.md) = 201, [INPUT_NOT_SYSTEM_APPLICATION](input.md) = 202, [INPUT_PARAMETER_ERROR](input.md) = 401,<br>[INPUT_SERVICE_EXCEPTION](input.md) = 3800001, [INPUT_REPEAT_INTERCEPTOR](input.md) = 4200001, [INPUT_OCCUPIED_BY_SYSTEM](input.md) = 4200002, [INPUT_OCCUPIED_BY_OTHER](input.md) = 4200003<br>} | Provides the enum values of error codes. |
73
74
75### Functions
76
77| Name| Description|
78| -------- | -------- |
79| [Input_Result](input.md#input_result) [OH_Input_GetKeyState](input.md#oh_input_getkeystate) (struct [Input_KeyState](input.md#input_keystate) \*keyState) | Queries an enum object of the key status. |
80| struct [Input_KeyState](input.md#input_keystate) \* [OH_Input_CreateKeyState](input.md#oh_input_createkeystate) () | Creates an enum object of the key status. |
81| void [OH_Input_DestroyKeyState](input.md#oh_input_destroykeystate) (struct [Input_KeyState](input.md#input_keystate) \*\*keyState) | Destroys an enum object of the key status. |
82| void [OH_Input_SetKeyCode](input.md#oh_input_setkeycode) (struct [Input_KeyState](input.md#input_keystate) \*keyState, int32_t keyCode) | Sets the key value of a key status enum object. |
83| int32_t [OH_Input_GetKeyCode](input.md#oh_input_getkeycode) (const struct [Input_KeyState](input.md#input_keystate) \*keyState) | Obtains the key value of a key status enum object. |
84| void [OH_Input_SetKeyPressed](input.md#oh_input_setkeypressed) (struct [Input_KeyState](input.md#input_keystate) \*keyState, int32_t keyAction) | Sets whether the key specific to a key status enum object is pressed. |
85| int32_t [OH_Input_GetKeyPressed](input.md#oh_input_getkeypressed) (const struct [Input_KeyState](input.md#input_keystate) \*keyState) | Checks whether the key specific to a key status enum object is pressed. |
86| void [OH_Input_SetKeySwitch](input.md#oh_input_setkeyswitch) (struct [Input_KeyState](input.md#input_keystate) \*keyState, int32_t keySwitch) | Sets the key switch of the key status enum object. |
87| int32_t [OH_Input_GetKeySwitch](input.md#oh_input_getkeyswitch) (const struct [Input_KeyState](input.md#input_keystate) \*keyState) | Obtains the key switch of the key status enum object. |
88| int32_t [OH_Input_InjectKeyEvent](input.md#oh_input_injectkeyevent) (const struct [Input_KeyEvent](input.md#input_keyevent) \*keyEvent) | Injects a key event. |
89| struct [Input_KeyEvent](input.md#input_keyevent) \* [OH_Input_CreateKeyEvent](input.md#oh_input_createkeyevent) () | Creates a key event object. |
90| void [OH_Input_DestroyKeyEvent](input.md#oh_input_destroykeyevent) (struct [Input_KeyEvent](input.md#input_keyevent) \*\*keyEvent) | Destroys a key event object. |
91| void [OH_Input_SetKeyEventAction](input.md#oh_input_setkeyeventaction) (struct [Input_KeyEvent](input.md#input_keyevent) \*keyEvent, int32_t action) | Sets the key event type. |
92| int32_t [OH_Input_GetKeyEventAction](input.md#oh_input_getkeyeventaction) (const struct [Input_KeyEvent](input.md#input_keyevent) \*keyEvent) | Obtains the key event type. |
93| void [OH_Input_SetKeyEventKeyCode](input.md#oh_input_setkeyeventkeycode) (struct [Input_KeyEvent](input.md#input_keyevent) \*keyEvent, int32_t keyCode) | Sets the key code value for a key event. |
94| int32_t [OH_Input_GetKeyEventKeyCode](input.md#oh_input_getkeyeventkeycode) (const struct [Input_KeyEvent](input.md#input_keyevent) \*keyEvent) | Obtains the key code value of a key event. |
95| void [OH_Input_SetKeyEventActionTime](input.md#oh_input_setkeyeventactiontime) (struct [Input_KeyEvent](input.md#input_keyevent) \*keyEvent, int64_t actionTime) | Sets the time when a key event occurs. |
96| int64_t [OH_Input_GetKeyEventActionTime](input.md#oh_input_getkeyeventactiontime) (const struct [Input_KeyEvent](input.md#input_keyevent) \*keyEvent) | Obtains the time when a key event occurs. |
97| int32_t [OH_Input_InjectMouseEvent](input.md#oh_input_injectmouseevent) (const struct [Input_MouseEvent](input.md#input_mouseevent) \*mouseEvent) | Injects a mouse event. |
98| struct [Input_MouseEvent](input.md#input_mouseevent) \* [OH_Input_CreateMouseEvent](input.md#oh_input_createmouseevent) () | Creates a mouse event object. |
99| void [OH_Input_DestroyMouseEvent](input.md#oh_input_destroymouseevent) (struct [Input_MouseEvent](input.md#input_mouseevent) \*\*mouseEvent) | Destroys a mouse event object. |
100| void [OH_Input_SetMouseEventAction](input.md#oh_input_setmouseeventaction) (struct [Input_MouseEvent](input.md#input_mouseevent) \*mouseEvent, int32_t action) | Sets the action for a mouse event. |
101| int32_t [OH_Input_GetMouseEventAction](input.md#oh_input_getmouseeventaction) (const struct [Input_MouseEvent](input.md#input_mouseevent) \*mouseEvent) | Obtains the action of a mouse event. |
102| void [OH_Input_SetMouseEventDisplayX](input.md#oh_input_setmouseeventdisplayx) (struct [Input_MouseEvent](input.md#input_mouseevent) \*mouseEvent, int32_t displayX) | Sets the X coordinate for a mouse event. |
103| int32_t [OH_Input_GetMouseEventDisplayX](input.md#oh_input_getmouseeventdisplayx) (const struct [Input_MouseEvent](input.md#input_mouseevent) \*mouseEvent) | Obtains the X coordinate of a mouse event.|
104| void [OH_Input_SetMouseEventDisplayY](input.md#oh_input_setmouseeventdisplayy) (struct [Input_MouseEvent](input.md#input_mouseevent) \*mouseEvent, int32_t displayY) | Sets the Y coordinate for a mouse event. |
105| int32_t [OH_Input_GetMouseEventDisplayY](input.md#oh_input_getmouseeventdisplayy) (const struct [Input_MouseEvent](input.md#input_mouseevent) \*mouseEvent) | Obtains the Y coordinate of a mouse event. |
106| void [OH_Input_SetMouseEventButton](input.md#oh_input_setmouseeventbutton) (struct [Input_MouseEvent](input.md#input_mouseevent) \*mouseEvent, int32_t button) | Sets the button for a mouse event. |
107| int32_t [OH_Input_GetMouseEventButton](input.md#oh_input_getmouseeventbutton) (const struct [Input_MouseEvent](input.md#input_mouseevent) \*mouseEvent) | Obtains the button of a mouse event. |
108| void [OH_Input_SetMouseEventAxisType](input.md#oh_input_setmouseeventaxistype) (struct [Input_MouseEvent](input.md#input_mouseevent) \*mouseEvent, int32_t axisType) | Sets the axis type for a mouse event. |
109| int32_t [OH_Input_GetMouseEventAxisType](input.md#oh_input_getmouseeventaxistype) (const struct [Input_MouseEvent](input.md#input_mouseevent) \*mouseEvent) | Obtains the axis type of a mouse event. |
110| void [OH_Input_SetMouseEventAxisValue](input.md#oh_input_setmouseeventaxisvalue) (struct [Input_MouseEvent](input.md#input_mouseevent) \*mouseEvent, float axisValue) | Sets the axis value for a mouse axis event. |
111| float [OH_Input_GetMouseEventAxisValue](input.md#oh_input_getmouseeventaxisvalue) (const struct [Input_MouseEvent](input.md#input_mouseevent) \*mouseEvent) | Obtains the axis value of a mouse axis event. |
112| void [OH_Input_SetMouseEventActionTime](input.md#oh_input_setmouseeventactiontime) (struct [Input_MouseEvent](input.md#input_mouseevent) \*mouseEvent, int64_t actionTime) | Sets the time when a mouse event occurs.|
113| int64_t [OH_Input_GetMouseEventActionTime](input.md#oh_input_getmouseeventactiontime) (const struct [Input_MouseEvent](input.md#input_mouseevent) \*mouseEvent) | Obtains the time when a mouse event occurs. |
114| int32_t [OH_Input_InjectTouchEvent](input.md#oh_input_injecttouchevent) (const struct [Input_TouchEvent](input.md#input_touchevent) \*touchEvent) | Injects a touch event. |
115| struct [Input_TouchEvent](input.md#input_touchevent) \* [OH_Input_CreateTouchEvent](input.md#oh_input_createtouchevent) () | Creates a touch event object. |
116| void [OH_Input_DestroyTouchEvent](input.md#oh_input_destroytouchevent) (struct [Input_TouchEvent](input.md#input_touchevent) \*\*touchEvent) | Destroys a touch event object. |
117| void [OH_Input_SetTouchEventAction](input.md#oh_input_settoucheventaction) (struct [Input_TouchEvent](input.md#input_touchevent) \*touchEvent, int32_t action) | Sets the action for a touch event. |
118| int32_t [OH_Input_GetTouchEventAction](input.md#oh_input_gettoucheventaction) (const struct [Input_TouchEvent](input.md#input_touchevent) \*touchEvent) | Obtains the action of a touch event. |
119| void [OH_Input_SetTouchEventFingerId](input.md#oh_input_settoucheventfingerid) (struct [Input_TouchEvent](input.md#input_touchevent) \*touchEvent, int32_t id) | Sets the finger ID for a touch event. |
120| int32_t [OH_Input_GetTouchEventFingerId](input.md#oh_input_gettoucheventfingerid) (const struct [Input_TouchEvent](input.md#input_touchevent) \*touchEvent) | Obtains the finger ID of a touch event. |
121| void [OH_Input_SetTouchEventDisplayX](input.md#oh_input_settoucheventdisplayx) (struct [Input_TouchEvent](input.md#input_touchevent) \*touchEvent, int32_t displayX) | Sets the X coordinate for a touch event. |
122| int32_t [OH_Input_GetTouchEventDisplayX](input.md#oh_input_gettoucheventdisplayx) (const struct [Input_TouchEvent](input.md#input_touchevent) \*touchEvent) | Obtains the X coordinate of a touch event. |
123| void [OH_Input_SetTouchEventDisplayY](input.md#oh_input_settoucheventdisplayy) (struct [Input_TouchEvent](input.md#input_touchevent) \*touchEvent, int32_t displayY) | Sets the Y coordinate for a touch event. |
124| int32_t [OH_Input_GetTouchEventDisplayY](input.md#oh_input_gettoucheventdisplayy) (const struct [Input_TouchEvent](input.md#input_touchevent) \*touchEvent) | Obtains the Y coordinate of a touch event. |
125| void [OH_Input_SetTouchEventActionTime](input.md#oh_input_settoucheventactiontime) (struct [Input_TouchEvent](input.md#input_touchevent) \*touchEvent, int64_t actionTime) | Sets the time when a touch event occurs. |
126| int64_t [OH_Input_GetTouchEventActionTime](input.md#oh_input_gettoucheventactiontime) (const struct [Input_TouchEvent](input.md#input_touchevent) \*touchEvent) | Obtains the time when a touch event occurs. |
127| void [OH_Input_CancelInjection](input.md#oh_input_cancelinjection) () | Stops event injection and revokes authorization. |
128| [Input_AxisEvent](input.md#input_axisevent) \* [OH_Input_CreateAxisEvent](input.md#oh_input_createaxisevent) (void) | Creates an axis event object. |
129| [Input_Result](input.md#input_result) [OH_Input_DestroyAxisEvent](input.md#oh_input_destroyaxisevent) ([Input_AxisEvent](input.md#input_axisevent) \*\*axisEvent) | Destroys an axis event object. |
130| [Input_Result](input.md#input_result) [OH_Input_SetAxisEventAction](input.md#oh_input_setaxiseventaction) ([Input_AxisEvent](input.md#input_axisevent) \*axisEvent, [InputEvent_AxisAction](input.md#inputevent_axisaction) action) | Sets the action for an axis event. |
131| [Input_Result](input.md#input_result) [OH_Input_GetAxisEventAction](input.md#oh_input_getaxiseventaction) (const [Input_AxisEvent](input.md#input_axisevent) \*axisEvent, [InputEvent_AxisAction](input.md#inputevent_axisaction) \*action) | Obtains the action of an axis event. |
132| [Input_Result](input.md#input_result) [OH_Input_SetAxisEventDisplayX](input.md#oh_input_setaxiseventdisplayx) ([Input_AxisEvent](input.md#input_axisevent) \*axisEvent, float displayX) | Sets the X coordinate for an axis event. |
133| [Input_Result](input.md#input_result) [OH_Input_GetAxisEventDisplayX](input.md#oh_input_getaxiseventdisplayx) (const [Input_AxisEvent](input.md#input_axisevent) \*axisEvent, float \*displayX) | Obtains the X coordinate of an axis event. |
134| [Input_Result](input.md#input_result) [OH_Input_SetAxisEventDisplayY](input.md#oh_input_setaxiseventdisplayy) ([Input_AxisEvent](input.md#input_axisevent) \*axisEvent, float displayY) | Sets the Y coordinate for an axis event. |
135| [Input_Result](input.md#input_result) [OH_Input_GetAxisEventDisplayY](input.md#oh_input_getaxiseventdisplayy) (const [Input_AxisEvent](input.md#input_axisevent) \*axisEvent, float \*displayY) | Obtains the Y coordinate of an axis event. |
136| [Input_Result](input.md#input_result) [OH_Input_SetAxisEventAxisValue](input.md#oh_input_setaxiseventaxisvalue) ([Input_AxisEvent](input.md#input_axisevent) \*axisEvent, [InputEvent_AxisType](input.md#inputevent_axistype) axisType, double axisValue) | Sets the axis value of the axis type specified by the axis event. |
137| [Input_Result](input.md#input_result) [OH_Input_GetAxisEventAxisValue](input.md#oh_input_getaxiseventaxisvalue) (const [Input_AxisEvent](input.md#input_axisevent) \*axisEvent, [InputEvent_AxisType](input.md#inputevent_axistype) axisType, double \*axisValue) | Obtains the axis value for the specified axis type of the axis event. |
138| [Input_Result](input.md#input_result) [OH_Input_SetAxisEventActionTime](input.md#oh_input_setaxiseventactiontime) ([Input_AxisEvent](input.md#input_axisevent) \*axisEvent, int64_t actionTime) | Sets the time when an axis event occurs. |
139| [Input_Result](input.md#input_result) [OH_Input_GetAxisEventActionTime](input.md#oh_input_getaxiseventactiontime) (const [Input_AxisEvent](input.md#input_axisevent) \*axisEvent, int64_t \*actionTime) | Obtains the time when an axis event occurs. |
140| [Input_Result](input.md#input_result) [OH_Input_SetAxisEventType](input.md#oh_input_setaxiseventtype) ([Input_AxisEvent](input.md#input_axisevent) \*axisEvent, [InputEvent_AxisEventType](input.md#inputevent_axiseventtype) axisEventType) | Sets the axis event type. |
141| [Input_Result](input.md#input_result) [OH_Input_GetAxisEventType](input.md#oh_input_getaxiseventtype) (const [Input_AxisEvent](input.md#input_axisevent) \*axisEvent, [InputEvent_AxisEventType](input.md#inputevent_axiseventtype) \*axisEventType) | Obtains the axis event type. |
142| [Input_Result](input.md#input_result) [OH_Input_SetAxisEventSourceType](input.md#oh_input_setaxiseventsourcetype) ([Input_AxisEvent](input.md#input_axisevent) \*axisEvent, [InputEvent_SourceType](input.md#inputevent_sourcetype) sourceType) | Sets the axis event source type. |
143| [Input_Result](input.md#input_result) [OH_Input_GetAxisEventSourceType](input.md#oh_input_getaxiseventsourcetype) (const [Input_AxisEvent](input.md#input_axisevent) \*axisEvent, [InputEvent_SourceType](input.md#inputevent_sourcetype) \*sourceType) | Obtains the axis event source type. |
144| [Input_Result](input.md#input_result) [OH_Input_AddKeyEventMonitor](input.md#oh_input_addkeyeventmonitor) ([Input_KeyEventCallback](input.md#input_keyeventcallback) callback) | Adds a listener for key events. |
145| [Input_Result](input.md#input_result) [OH_Input_AddMouseEventMonitor](input.md#oh_input_addmouseeventmonitor) ([Input_MouseEventCallback](input.md#input_mouseeventcallback) callback) | Adds a listener for mouse events, including mouse click and movement events, but not scroll wheel events. Scroll wheel events are axis events. |
146| [Input_Result](input.md#input_result) [OH_Input_AddTouchEventMonitor](input.md#oh_input_addtoucheventmonitor) ([Input_TouchEventCallback](input.md#input_toucheventcallback) callback) | Adds a listener for touch events. |
147| [Input_Result](input.md#input_result) [OH_Input_AddAxisEventMonitorForAll](input.md#oh_input_addaxiseventmonitorforall) ([Input_AxisEventCallback](input.md#input_axiseventcallback) callback) | Adds a listener for all types of axis events, which are defined in [InputEvent_AxisEventType](input.md#inputevent_axiseventtype). |
148| [Input_Result](input.md#input_result) [OH_Input_AddAxisEventMonitor](input.md#oh_input_addaxiseventmonitor) ([InputEvent_AxisEventType](input.md#inputevent_axiseventtype) axisEventType, [Input_AxisEventCallback](input.md#input_axiseventcallback) callback) | Adds a listener for the specified type of axis events, which are defined in [InputEvent_AxisEventType](input.md#inputevent_axiseventtype). |
149| [Input_Result](input.md#input_result) [OH_Input_RemoveKeyEventMonitor](input.md#oh_input_removekeyeventmonitor) ([Input_KeyEventCallback](input.md#input_keyeventcallback) callback) | Removes the listener for key events. |
150| [Input_Result](input.md#input_result) [OH_Input_RemoveMouseEventMonitor](input.md#oh_input_removemouseeventmonitor) ([Input_MouseEventCallback](input.md#input_mouseeventcallback) callback) | Removes the listener for mouse events. |
151| [Input_Result](input.md#input_result) [OH_Input_RemoveTouchEventMonitor](input.md#oh_input_removetoucheventmonitor) ([Input_TouchEventCallback](input.md#input_toucheventcallback) callback) | Removes the listener for touch events. |
152| [Input_Result](input.md#input_result) [OH_Input_RemoveAxisEventMonitorForAll](input.md#oh_input_removeaxiseventmonitorforall) ([Input_AxisEventCallback](input.md#input_axiseventcallback) callback) | Removes the listener for all types of axis events. |
153| [Input_Result](input.md#input_result) [OH_Input_RemoveAxisEventMonitor](input.md#oh_input_removeaxiseventmonitor) ([InputEvent_AxisEventType](input.md#inputevent_axiseventtype) axisEventType, [Input_AxisEventCallback](input.md#input_axiseventcallback) callback) | Removes the listener for the specified type of axis events, which are defined in [InputEvent_AxisEventType](input.md#inputevent_axiseventtype). |
154| [Input_Result](input.md#input_result) [OH_Input_AddKeyEventInterceptor](input.md#oh_input_addkeyeventinterceptor) ([Input_KeyEventCallback](input.md#input_keyeventcallback) callback, [Input_InterceptorOptions](input.md#input_interceptoroptions) \*option) | Adds an interceptor for key events. If multiple interceptors are added, only the first one takes effect. |
155| [Input_Result](input.md#input_result) [OH_Input_AddInputEventInterceptor](input.md#oh_input_addinputeventinterceptor) ([Input_InterceptorEventCallback](_input___interceptor_event_callback.md) \*callback [Input_InterceptorOptions](input.md#input_interceptoroptions) \*option) | Adds an interceptor for input events, including mouse, touch, and axis events. If multiple interceptors are added, only the first one takes effect. |
156| [Input_Result](input.md#input_result) [OH_Input_RemoveKeyEventInterceptor](input.md#oh_input_removekeyeventinterceptor) () | Removes the interceptor for key events. |
157| [Input_Result](input.md#input_result) [OH_Input_RemoveInputEventInterceptor](input.md#oh_input_removeinputeventinterceptor) () | Removes the interceptor for input events, including mouse, touch, and axis events. |
158| int32_t [OH_Input_GetIntervalSinceLastInput](input.md#oh_input_getintervalsincelastinput) (int64_t \*timeInterval) | Obtains the interval since the last system input event. |
159| [Input_Hotkey](input.md#input_hotkey) \* [OH_Input_CreateHotkey](input.md#oh_input_createhotkey) () | Creates a shortcut key object. |
160| void [OH_Input_DestroyHotkey](input.md#oh_input_destroyhotkey) ([Input_Hotkey](input.md#input_hotkey) \*\*hotkey) | Destroys a shortcut key object. |
161| void [OH_Input_SetPreKeys](input.md#oh_input_setprekeys) ([Input_Hotkey](input.md#input_hotkey) \*hotkey, int32_t \*preKeys, int32_t size) | Sets the modifier key. |
162| [Input_Result](input.md#input_result) [OH_Input_GetPreKeys](input.md#oh_input_getprekeys) (const [Input_Hotkey](input.md#input_hotkey) \*hotkey, int32_t \*\*preKeys, int32_t \*preKeyCount) | Obtains the modifier key. |
163| void [OH_Input_SetFinalKey](input.md#oh_input_setfinalkey) ([Input_Hotkey](input.md#input_hotkey) \*hotkey, int32_t finalKey) | Sets the modified key. |
164| [Input_Result](input.md#input_result) [OH_Input_GetFinalKey](input.md#oh_input_getfinalkey) (const [Input_Hotkey](input.md#input_hotkey) \*hotkey, int32_t \*finalKeyCode) | Obtains the modified key. |
165| [Input_Hotkey](input.md#input_hotkey) \*\* [OH_Input_CreateAllSystemHotkeys](input.md#oh_input_createallsystemhotkeys) (int32_t count) | Creates an array of [Input_Hotkey](input.md#input_hotkey) instances. |
166| void [OH_Input_DestroyAllSystemHotkeys](input.md#oh_input_destroyallsystemhotkeys) ([Input_Hotkey](input.md#input_hotkey) \*\*hotkeys, int32_t count) | Destroys the array of [Input_Hotkey](input.md#input_hotkey) instances and reclaims the memory. |
167| [Input_Result](input.md#input_result) [OH_Input_GetAllSystemHotkeys](input.md#oh_input_getallsystemhotkeys) ([Input_Hotkey](input.md#input_hotkey) \*\*hotkey, int32_t \*count) | Obtains all configured shortcut keys. |
168| void [OH_Input_SetRepeat](input.md#oh_input_setrepeat) ([Input_Hotkey](input.md#input_hotkey) \*hotkey, bool isRepeat) | Specifies whether to report repeated key events. |
169| [Input_Result](input.md#input_result) [OH_Input_GetRepeat](input.md#oh_input_getrepeat) (const [Input_Hotkey](input.md#input_hotkey) \*hotkey, bool \*isRepeat) | Checks whether to report repeated key events. |
170| [Input_Result](input.md#input_result) [OH_Input_AddHotkeyMonitor](input.md#oh_input_addhotkeymonitor) (const [Input_Hotkey](input.md#input_hotkey) \*hotkey, [Input_HotkeyCallback](input.md#input_hotkeycallback) callback) | Subscribes to shortcut key events. |
171| [Input_Result](input.md#input_result) [OH_Input_RemoveHotkeyMonitor](input.md#oh_input_removehotkeymonitor) (const [Input_Hotkey](input.md#input_hotkey) \*hotkey, [Input_HotkeyCallback](input.md#input_hotkeycallback) callback) | Unsubscribes from shortcut key events. |
172| [Input_Result](input.md#input_result) [OH_Input_GetDeviceIds](input.md#oh_input_getdeviceids) (int32_t \*deviceIds, int32_t inSize, int32_t \*outSize) | Obtains the IDs of all input devices. |
173| [Input_Result](input.md#input_result) [OH_Input_GetDevice](input.md#oh_input_getdevice) (int32_t deviceId, [Input_DeviceInfo](input.md#input_deviceinfo) \*\*deviceInfo) | Obtains information about the input device. |
174| [Input_DeviceInfo](input.md#input_deviceinfo) \* [OH_Input_CreateDeviceInfo](input.md#oh_input_createdeviceinfo) (void) | Creates a **deviceInfo** object. |
175| void [OH_Input_DestroyDeviceInfo](input.md#oh_input_destroydeviceinfo) ([Input_DeviceInfo](input.md#input_deviceinfo) \*\*deviceInfo) | Destroys a **deviceInfo** object. |
176| [Input_Result](input.md#input_result) [OH_Input_GetKeyboardType](input.md#oh_input_getkeyboardtype) (int32_t deviceId, int32_t \*keyboardType) | Obtains the keyboard type of the input device. |
177| [Input_Result](input.md#input_result) [OH_Input_GetDeviceId](input.md#oh_input_getdeviceid) ([Input_DeviceInfo](input.md#input_deviceinfo) \*deviceInfo, int32_t \*id) | Obtains the ID of an input device. |
178| [Input_Result](input.md#input_result) [OH_Input_GetDeviceName](input.md#oh_input_getdevicename) ([Input_DeviceInfo](input.md#input_deviceinfo) \*deviceInfo, char \*\*name) | Obtains the name of an input device. |
179| [Input_Result](input.md#input_result) [OH_Input_GetCapabilities](input.md#oh_input_getcapabilities) ([Input_DeviceInfo](input.md#input_deviceinfo) \*deviceInfo, int32_t \*capabilities) | Obtains the capabilities of an input device, for example, a touchscreen, touchpad, or keyboard. |
180| [Input_Result](input.md#input_result) [OH_Input_GetDeviceVersion](input.md#oh_input_getdeviceversion) ([Input_DeviceInfo](input.md#input_deviceinfo) \*deviceInfo, int32_t \*version) | Obtains the version information of an input device. |
181| [Input_Result](input.md#input_result) [OH_Input_GetDeviceProduct](input.md#oh_input_getdeviceproduct) ([Input_DeviceInfo](input.md#input_deviceinfo) \*deviceInfo, int32_t \*product) | Obtains the product information of an input device. |
182| [Input_Result](input.md#input_result) [OH_Input_GetDeviceVendor](input.md#oh_input_getdevicevendor) ([Input_DeviceInfo](input.md#input_deviceinfo) \*deviceInfo, int32_t \*vendor) | Obtains the vendor information of an input device. |
183| [Input_Result](input.md#input_result) [OH_Input_GetDeviceAddress](input.md#oh_input_getdeviceaddress) ([Input_DeviceInfo](input.md#input_deviceinfo) \*deviceInfo, char \*\*address) | Obtains the physical address of an input device. |
184| [Input_Result](input.md#input_result) [OH_Input_RegisterDeviceListener](input.md#oh_input_registerdevicelistener) ([Input_DeviceListener](_input___device_listener.md) \*listener) | Registers a listener for device hot swap events. |
185| [Input_Result](input.md#input_result) [OH_Input_UnregisterDeviceListener](input.md#oh_input_unregisterdevicelistener) ([Input_DeviceListener](_input___device_listener.md) \*listener) | Unregisters the listener for device hot swap events. |
186| [Input_Result](input.md#input_result) [OH_Input_UnregisterDeviceListeners](input.md#oh_input_unregisterdevicelisteners) () | Unregisters the listener for all device hot swap events. |
187