1# Native XComponent 2 3 4## Overview 5 6Describes the surface and touch event held by the ArkUI XComponent, which can be used for the EGL/OpenGL ES and media data input and displayed on the ArkUI XComponent. For details, see [Native XComponent](../../ui/napi-xcomponent-guidelines.md). 7 8> **NOTE** 9> 10> The APIs of this module are supported since API version 8. Updates will be marked with a superscript to indicate their earliest API version. 11 12## Summary 13 14 15### Files 16 17| Name | Description | 18| ---------------------------------------- | ---------------------------------------- | 19| [native_interface_xcomponent.h](native__interface__xcomponent_8h.md) | Declares the APIs for accessing **NativeXComponent**.<br>**File to include**: <ace/xcomponent/native_interface_xcomponent.h><br>**Library**: libace_ndk.z.so| 20| [native_xcomponent_key_event.h](native__xcomponent__key__event_8h.md) | Declares the enums used to access **NativeXComponent** key events.<br>**File to include**: <ace/xcomponent/native_xcomponent_key_event.h><br>**Library**: libace_ndk.z.so| 21 22 23### Structs 24 25| Name | Description | 26| ---------------------------------------- | --------------------- | 27| [OH_NativeXComponent_TouchPoint](_o_h___native_x_component___touch_point.md) | Describes the touch point of the touch event. | 28| [OH_NativeXComponent_TouchEvent](_o_h___native_x_component___touch_event.md) | Describes the touch event. | 29| [OH_NativeXComponent_MouseEvent](_o_h___native_x_component___mouse_event.md) | Describes the mouse event. | 30| [OH_NativeXComponent_Callback](_o_h___native_x_component___callback.md) | Registers callbacks for the surface lifecycle and touch event.| 31| [OH_NativeXComponent_MouseEvent_Callback](_o_h___native_x_component___mouse_event___callback.md) | Registers callbacks for the mouse event. | 32| [OH_NativeXComponent_ExpectedRateRange](_o_h___native_x_component___expected_rate_range.md) | Defines the expected frame rate range. | 33 34 35### Types 36 37| Name | Description | 38| ---------------------------------------- | ------------------------------------ | 39| [OH_NativeXComponent](#oh_nativexcomponent) | Provides an encapsulated **OH_NativeXComponent** instance. | 40| [OH_NativeXComponent_Callback](#oh_nativexcomponent_callback) | Registers callbacks for the surface lifecycle and touch event. | 41| [OH_NativeXComponent_MouseEvent_Callback](#oh_nativexcomponent_mouseevent_callback) | Registers callbacks for the mouse event. | 42| [OH_NativeXComponent_KeyEvent](#oh_nativexcomponent_keyevent) | Provides an encapsulated **OH_NativeXComponent_KeyEvent** instance.| 43 44 45### Enums 46 47| Name | Description | 48| ---------------------------------------- | ---------- | 49| { OH_NATIVEXCOMPONENT_RESULT_SUCCESS = 0, OH_NATIVEXCOMPONENT_RESULT_FAILED = -1, OH_NATIVEXCOMPONENT_RESULT_BAD_PARAMETER = -2 } | Enumerates the API access states.| 50| [OH_NativeXComponent_TouchEventType](#oh_nativexcomponent_toucheventtype) {<br>OH_NATIVEXCOMPONENT_DOWN = 0, OH_NATIVEXCOMPONENT_UP, OH_NATIVEXCOMPONENT_MOVE, OH_NATIVEXCOMPONENT_CANCEL,<br>OH_NATIVEXCOMPONENT_UNKNOWN<br>} | Enumerates the touch event types. | 51| [OH_NativeXComponent_TouchPointToolType](#oh_nativexcomponent_touchpointtooltype) {<br>OH_NATIVEXCOMPONENT_TOOL_TYPE_UNKNOWN = 0, OH_NATIVEXCOMPONENT_TOOL_TYPE_FINGER, OH_NATIVEXCOMPONENT_TOOL_TYPE_PEN, OH_NATIVEXCOMPONENT_TOOL_TYPE_RUBBER,<br>OH_NATIVEXCOMPONENT_TOOL_TYPE_BRUSH, OH_NATIVEXCOMPONENT_TOOL_TYPE_PENCIL, OH_NATIVEXCOMPONENT_TOOL_TYPE_AIRBRUSH, OH_NATIVEXCOMPONENT_TOOL_TYPE_MOUSE,<br>OH_NATIVEXCOMPONENT_TOOL_TYPE_LENS<br>} | Enumerates the touch point tool types. | 52| [OH_NativeXComponent_EventSourceType](#oh_nativexcomponent_eventsourcetype) {<br>OH_NATIVEXCOMPONENT_SOURCE_TYPE_UNKNOWN = 0, OH_NATIVEXCOMPONENT_SOURCE_TYPE_MOUSE, OH_NATIVEXCOMPONENT_SOURCE_TYPE_TOUCHSCREEN, OH_NATIVEXCOMPONENT_SOURCE_TYPE_TOUCHPAD,<br>OH_NATIVEXCOMPONENT_SOURCE_TYPE_JOYSTICK, OH_NATIVEXCOMPONENT_SOURCE_TYPE_KEYBOARD<br>} | Enumerates the touch event source types. | 53| [OH_NativeXComponent_MouseEventAction](#oh_nativexcomponent_mouseeventaction) { OH_NATIVEXCOMPONENT_MOUSE_NONE = 0, OH_NATIVEXCOMPONENT_MOUSE_PRESS, OH_NATIVEXCOMPONENT_MOUSE_RELEASE, OH_NATIVEXCOMPONENT_MOUSE_MOVE } | Enumerates the mouse event actions. | 54| [OH_NativeXComponent_MouseEventButton](#oh_nativexcomponent_mouseeventbutton) {<br>OH_NATIVEXCOMPONENT_NONE_BUTTON = 0, OH_NATIVEXCOMPONENT_LEFT_BUTTON = 0x01, OH_NATIVEXCOMPONENT_RIGHT_BUTTON = 0x02, OH_NATIVEXCOMPONENT_MIDDLE_BUTTON = 0x04,<br>OH_NATIVEXCOMPONENT_BACK_BUTTON = 0x08, OH_NATIVEXCOMPONENT_FORWARD_BUTTON = 0x10<br>} | Enumerates the mouse event buttons. | 55| [OH_NativeXComponent_KeyCode](#oh_nativexcomponent_keycode) {<br>KEY_UNKNOWN = -1, KEY_FN = 0, KEY_HOME = 1, KEY_BACK = 2,KEY_MEDIA_PLAY_PAUSE = 10, KEY_MEDIA_STOP = 11, KEY_MEDIA_NEXT = 12, KEY_MEDIA_PREVIOUS = 13,<br>KEY_MEDIA_REWIND = 14, KEY_MEDIA_FAST_FORWARD = 15, KEY_VOLUME_UP = 16, KEY_VOLUME_DOWN = 17,<br>KEY_POWER = 18, KEY_CAMERA = 19, KEY_VOLUME_MUTE = 22, KEY_MUTE = 23,KEY_BRIGHTNESS_UP = 40, KEY_BRIGHTNESS_DOWN = 41, KEY_0 = 2000, KEY_1 = 2001,<br>KEY_2 = 2002, KEY_3 = 2003, KEY_4 = 2004, KEY_5 = 2005,<br>KEY_6 = 2006, KEY_7 = 2007, KEY_8 = 2008, KEY_9 = 2009,<br>KEY_STAR = 2010, KEY_POUND = 2011, KEY_DPAD_UP = 2012, KEY_DPAD_DOWN = 2013,KEY_DPAD_LEFT = 2014, KEY_DPAD_RIGHT = 2015, KEY_DPAD_CENTER = 2016,<br>KEY_A = 2017,<br>KEY_B = 2018, KEY_C = 2019, KEY_D = 2020, KEY_E = 2021,<br>KEY_F = 2022, KEY_G = 2023, KEY_H = 2024, KEY_I = 2025,<br>KEY_J = 2026, KEY_K = 2027, KEY_L = 2028, KEY_M = 2029,<br>KEY_N = 2030, KEY_O = 2031, KEY_P = 2032, KEY_Q = 2033,<br>KEY_R = 2034, KEY_S = 2035, KEY_T = 2036, KEY_U = 2037,<br>KEY_V = 2038, KEY_W = 2039, KEY_X = 2040, KEY_Y = 2041,<br>KEY_Z = 2042, KEY_COMMA = 2043, KEY_PERIOD = 2044, KEY_ALT_LEFT = 2045,<br>KEY_ALT_RIGHT = 2046, KEY_SHIFT_LEFT = 2047, KEY_SHIFT_RIGHT = 2048, KEY_TAB = 2049,<br>KEY_SPACE = 2050, KEY_SYM = 2051, KEY_EXPLORER = 2052, KEY_ENVELOPE = 2053,<br>KEY_ENTER = 2054, KEY_DEL = 2055, KEY_GRAVE = 2056, KEY_MINUS = 2057,<br>KEY_EQUALS = 2058, KEY_LEFT_BRACKET = 2059, KEY_RIGHT_BRACKET = 2060, KEY_BACKSLASH = 2061,<br>KEY_SEMICOLON = 2062, KEY_APOSTROPHE = 2063, KEY_SLASH = 2064, KEY_AT = 2065,<br>KEY_PLUS = 2066, KEY_MENU = 2067, KEY_PAGE_UP = 2068, KEY_PAGE_DOWN = 2069,<br>KEY_ESCAPE = 2070, KEY_FORWARD_DEL = 2071, KEY_CTRL_LEFT = 2072, KEY_CTRL_RIGHT = 2073,<br>KEY_CAPS_LOCK = 2074, KEY_SCROLL_LOCK = 2075, KEY_META_LEFT = 2076, KEY_META_RIGHT = 2077,<br>KEY_FUNCTION = 2078, KEY_SYSRQ = 2079, KEY_BREAK = 2080, KEY_MOVE_HOME = 2081,<br>KEY_MOVE_END = 2082, KEY_INSERT = 2083, KEY_FORWARD = 2084, KEY_MEDIA_PLAY = 2085,<br>KEY_MEDIA_PAUSE = 2086, KEY_MEDIA_CLOSE = 2087, KEY_MEDIA_EJECT = 2088, KEY_MEDIA_RECORD = 2089,<br>KEY_F1 = 2090, KEY_F2 = 2091, KEY_F3 = 2092, KEY_F4 = 2093,<br>KEY_F5 = 2094, KEY_F6 = 2095, KEY_F7 = 2096, KEY_F8 = 2097,<br>KEY_F9 = 2098, KEY_F10 = 2099, KEY_F11 = 2100, KEY_F12 = 2101,<br>KEY_NUM_LOCK = 2102, KEY_NUMPAD_0 = 2103, KEY_NUMPAD_1 = 2104, KEY_NUMPAD_2 = 2105,<br>KEY_NUMPAD_3 = 2106, KEY_NUMPAD_4 = 2107, KEY_NUMPAD_5 = 2108, KEY_NUMPAD_6 = 2109,<br>KEY_NUMPAD_7 = 2110, KEY_NUMPAD_8 = 2111, KEY_NUMPAD_9 = 2112, KEY_NUMPAD_DIVIDE = 2113,<br>KEY_NUMPAD_MULTIPLY = 2114, KEY_NUMPAD_SUBTRACT = 2115, KEY_NUMPAD_ADD = 2116, KEY_NUMPAD_DOT = 2117,<br>KEY_NUMPAD_COMMA = 2118, KEY_NUMPAD_ENTER = 2119, KEY_NUMPAD_EQUALS = 2120, KEY_NUMPAD_LEFT_PAREN = 2121,<br>KEY_NUMPAD_RIGHT_PAREN = 2122, KEY_VIRTUAL_MULTITASK = 2210, KEY_SLEEP = 2600, KEY_ZENKAKU_HANKAKU = 2601,<br>KEY_102ND = 2602, KEY_RO = 2603, KEY_KATAKANA = 2604, KEY_HIRAGANA = 2605,<br>KEY_HENKAN = 2606, KEY_KATAKANA_HIRAGANA = 2607, KEY_MUHENKAN = 2608, KEY_LINEFEED = 2609,<br>KEY_MACRO = 2610, KEY_NUMPAD_PLUSMINUS = 2611, KEY_SCALE = 2612, KEY_HANGUEL = 2613,<br>KEY_HANJA = 2614, KEY_YEN = 2615, KEY_STOP = 2616, KEY_AGAIN = 2617,<br>KEY_PROPS = 2618, KEY_UNDO = 2619, KEY_COPY = 2620, KEY_OPEN = 2621,<br>KEY_PASTE = 2622, KEY_FIND = 2623, KEY_CUT = 2624, KEY_HELP = 2625,<br>KEY_CALC = 2626, KEY_FILE = 2627, KEY_BOOKMARKS = 2628, KEY_NEXT = 2629,<br>KEY_PLAYPAUSE = 2630, KEY_PREVIOUS = 2631, KEY_STOPCD = 2632, KEY_CONFIG = 2634,<br>KEY_REFRESH = 2635, KEY_EXIT = 2636, KEY_EDIT = 2637, KEY_SCROLLUP = 2638,<br>KEY_SCROLLDOWN = 2639, KEY_NEW = 2640, KEY_REDO = 2641, KEY_CLOSE = 2642,<br>KEY_PLAY = 2643, KEY_BASSBOOST = 2644, KEY_PRINT = 2645, KEY_CHAT = 2646,<br>KEY_FINANCE = 2647, KEY_CANCEL = 2648, KEY_KBDILLUM_TOGGLE = 2649, KEY_KBDILLUM_DOWN = 2650,<br>KEY_KBDILLUM_UP = 2651, KEY_SEND = 2652, KEY_REPLY = 2653, KEY_FORWARDMAIL = 2654,<br>KEY_SAVE = 2655, KEY_DOCUMENTS = 2656, KEY_VIDEO_NEXT = 2657, KEY_VIDEO_PREV = 2658,<br>KEY_BRIGHTNESS_CYCLE = 2659, KEY_BRIGHTNESS_ZERO = 2660, KEY_DISPLAY_OFF = 2661, KEY_BTN_MISC = 2662,<br>KEY_GOTO = 2663, KEY_INFO = 2664, KEY_PROGRAM = 2665, KEY_PVR = 2666,<br>KEY_SUBTITLE = 2667, KEY_FULL_SCREEN = 2668, KEY_KEYBOARD = 2669, KEY_ASPECT_RATIO = 2670,<br>KEY_PC = 2671, KEY_TV = 2672, KEY_TV2 = 2673, KEY_VCR = 2674,<br>KEY_VCR2 = 2675, KEY_SAT = 2676, KEY_CD = 2677, KEY_TAPE = 2678,<br>KEY_TUNER = 2679, KEY_PLAYER = 2680, KEY_DVD = 2681, KEY_AUDIO = 2682,<br>KEY_VIDEO = 2683, KEY_MEMO = 2684, KEY_CALENDAR = 2685, KEY_RED = 2686,<br>KEY_GREEN = 2687, KEY_YELLOW = 2688, KEY_BLUE = 2689, KEY_CHANNELUP = 2690,<br>KEY_CHANNELDOWN = 2691, KEY_LAST = 2692, KEY_RESTART = 2693, KEY_SLOW = 2694,<br>KEY_SHUFFLE = 2695, KEY_VIDEOPHONE = 2696, KEY_GAMES = 2697, KEY_ZOOMIN = 2698,<br>KEY_ZOOMOUT = 2699, KEY_ZOOMRESET = 2700, KEY_WORDPROCESSOR = 2701, KEY_EDITOR = 2702,<br>KEY_SPREADSHEET = 2703, KEY_GRAPHICSEDITOR = 2704, KEY_PRESENTATION = 2705, KEY_DATABASE = 2706,<br>KEY_NEWS = 2707, KEY_VOICEMAIL = 2708, KEY_ADDRESSBOOK = 2709, KEY_MESSENGER = 2710,<br>KEY_BRIGHTNESS_TOGGLE = 2711, KEY_SPELLCHECK = 2712, KEY_COFFEE = 2713, KEY_MEDIA_REPEAT = 2714,<br>KEY_IMAGES = 2715, KEY_BUTTONCONFIG = 2716, KEY_TASKMANAGER = 2717, KEY_JOURNAL = 2718,<br>KEY_CONTROLPANEL = 2719, KEY_APPSELECT = 2720, KEY_SCREENSAVER = 2721, KEY_ASSISTANT = 2722,<br>KEY_KBD_LAYOUT_NEXT = 2723, KEY_BRIGHTNESS_MIN = 2724, KEY_BRIGHTNESS_MAX = 2725, KEY_KBDINPUTASSIST_PREV = 2726,<br>KEY_KBDINPUTASSIST_NEXT = 2727, KEY_KBDINPUTASSIST_PREVGROUP = 2728, KEY_KBDINPUTASSIST_NEXTGROUP = 2729, KEY_KBDINPUTASSIST_ACCEPT = 2730,<br>KEY_KBDINPUTASSIST_CANCEL = 2731, KEY_FRONT = 2800, KEY_SETUP = 2801, KEY_WAKEUP = 2802,<br>KEY_SENDFILE = 2803, KEY_DELETEFILE = 2804, KEY_XFER = 2805, KEY_PROG1 = 2806,<br>KEY_PROG2 = 2807, KEY_MSDOS = 2808, KEY_SCREENLOCK = 2809, KEY_DIRECTION_ROTATE_DISPLAY = 2810,<br>KEY_CYCLEWINDOWS = 2811, KEY_COMPUTER = 2812, KEY_EJECTCLOSECD = 2813, KEY_ISO = 2814,<br>KEY_MOVE = 2815, KEY_F13 = 2816, KEY_F14 = 2817, KEY_F15 = 2818,<br>KEY_F16 = 2819, KEY_F17 = 2820, KEY_F18 = 2821, KEY_F19 = 2822,<br>KEY_F20 = 2823, KEY_F21 = 2824, KEY_F22 = 2825, KEY_F23 = 2826,<br>KEY_F24 = 2827, KEY_PROG3 = 2828, KEY_PROG4 = 2829, KEY_DASHBOARD = 2830,<br>KEY_SUSPEND = 2831, KEY_HP = 2832, KEY_SOUND = 2833, KEY_QUESTION = 2834,<br>KEY_CONNECT = 2836, KEY_SPORT = 2837, KEY_SHOP = 2838, KEY_ALTERASE = 2839,<br>KEY_SWITCHVIDEOMODE = 2841, KEY_BATTERY = 2842, KEY_BLUETOOTH = 2843, KEY_WLAN = 2844,<br>KEY_UWB = 2845, KEY_WWAN_WIMAX = 2846, KEY_RFKILL = 2847, KEY_CHANNEL = 3001,<br>KEY_BTN_0 = 3100, KEY_BTN_1 = 3101, KEY_BTN_2 = 3102, KEY_BTN_3 = 3103,<br>KEY_BTN_4 = 3104, KEY_BTN_5 = 3105, KEY_BTN_6 = 3106, KEY_BTN_7 = 3107,<br>KEY_BTN_8 = 3108, KEY_BTN_9 = 3109<br>} | Enumerates the mouse event key codes. | 56| [OH_NativeXComponent_KeyAction](#oh_nativexcomponent_keyaction) { OH_NATIVEXCOMPONENT_KEY_ACTION_UNKNOWN = -1, OH_NATIVEXCOMPONENT_KEY_ACTION_DOWN = 0, OH_NATIVEXCOMPONENT_KEY_ACTION_UP } | Enumerates the key event actions. | 57 58 59### Functions 60 61| Name | Description | 62| ---------------------------------------- | -------------------------------------- | 63| [OH_NativeXComponent_GetXComponentId](#oh_nativexcomponent_getxcomponentid) ([OH_NativeXComponent](#oh_nativexcomponent) \*component, char \*id, uint64_t \*size) | Obtains the ID of the ArkUI XComponent. | 64| [OH_NativeXComponent_GetXComponentSize](#oh_nativexcomponent_getxcomponentsize) ([OH_NativeXComponent](#oh_nativexcomponent) \*component, const void \*window, uint64_t \*width, uint64_t \*height) | Obtains the size of the surface held by the ArkUI XComponent. | 65| [OH_NativeXComponent_GetXComponentOffset](#oh_nativexcomponent_getxcomponentoffset) ([OH_NativeXComponent](#oh_nativexcomponent) \*component, const void \*window, double \*x, double \*y) | Obtains the offset of the ArkUI XComponent relative to the upper left vertex of the screen.| 66| [OH_NativeXComponent_GetTouchEvent](#oh_nativexcomponent_gettouchevent) ([OH_NativeXComponent](#oh_nativexcomponent) \*component, const void \*window, [OH_NativeXComponent_TouchEvent](_o_h___native_x_component___touch_event.md) \*touchEvent) | Obtains the touch event scheduled by the ArkUI XComponent. | 67| [OH_NativeXComponent_GetTouchPointToolType](#oh_nativexcomponent_gettouchpointtooltype) ([OH_NativeXComponent](#oh_nativexcomponent) \*component, uint32_t pointIndex, [OH_NativeXComponent_TouchPointToolType](#oh_nativexcomponent_touchpointtooltype) \*toolType) | Obtains the ArkUI XComponent touch point tool type. | 68| [OH_NativeXComponent_GetTouchPointTiltX](#oh_nativexcomponent_gettouchpointtiltx) ([OH_NativeXComponent](#oh_nativexcomponent) \*component, uint32_t pointIndex, float \*tiltX) | Obtains the angle between the Y-Z plane of the ArkUI XComponent touch point and the x-axis. | 69| [OH_NativeXComponent_GetTouchPointTiltY](#oh_nativexcomponent_gettouchpointtilty) ([OH_NativeXComponent](#oh_nativexcomponent) \*component, uint32_t pointIndex, float \*tiltY) | Obtains the angle between the X-Z plane of the ArkUI XComponent touch point and the y-axis. | 70| [OH_NativeXComponent_GetMouseEvent](#oh_nativexcomponent_getmouseevent) ([OH_NativeXComponent](#oh_nativexcomponent) \*component, const void \*window, [OH_NativeXComponent_MouseEvent](_o_h___native_x_component___mouse_event.md) \*mouseEvent) | Obtains the mouse event scheduled by ArkUI XComponent. | 71| [OH_NativeXComponent_RegisterCallback](#oh_nativexcomponent_registercallback) ([OH_NativeXComponent](#oh_nativexcomponent) \*component, [OH_NativeXComponent_Callback](_o_h___native_x_component___callback.md) \*callback) | Registers a callback for this **OH_NativeXComponent** instance. | 72| [OH_NativeXComponent_RegisterMouseEventCallback](#oh_nativexcomponent_registermouseeventcallback) ([OH_NativeXComponent](#oh_nativexcomponent) \*component, [OH_NativeXComponent_MouseEvent_Callback](_o_h___native_x_component___mouse_event___callback.md) \*callback) | Registers the mouse event callback for this **OH_NativeXComponent** instance. | 73| [OH_NativeXComponent_RegisterFocusEventCallback](#oh_nativexcomponent_registerfocuseventcallback) ([OH_NativeXComponent](#oh_nativexcomponent) \*component, void(\*callback)([OH_NativeXComponent](#oh_nativexcomponent) \*component, void \*window)) | Registers the focus obtaining event callback for this **OH_NativeXComponent** instance. | 74| [OH_NativeXComponent_RegisterKeyEventCallback](#oh_nativexcomponent_registerkeyeventcallback) ([OH_NativeXComponent](#oh_nativexcomponent) \*component, void(\*callback)([OH_NativeXComponent](#oh_nativexcomponent) \*component, void \*window)) | Registers the key event callback for this **OH_NativeXComponent** instance. | 75| [OH_NativeXComponent_RegisterBlurEventCallback](#oh_nativexcomponent_registerblureventcallback) ([OH_NativeXComponent](#oh_nativexcomponent) \*component, void(\*callback)([OH_NativeXComponent](#oh_nativexcomponent) \*component, void \*window)) | Registers the focus loss event callback for this **OH_NativeXComponent** instance. | 76| [OH_NativeXComponent_GetKeyEvent](#oh_nativexcomponent_getkeyevent) ([OH_NativeXComponent](#oh_nativexcomponent) \*component, [OH_NativeXComponent_KeyEvent](#oh_nativexcomponent_keyevent) \*\*keyEvent) | Obtains the key event scheduled by the ArkUI XComponent. | 77| [OH_NativeXComponent_GetKeyEventAction](#oh_nativexcomponent_getkeyeventaction) ([OH_NativeXComponent_KeyEvent](#oh_nativexcomponent_keyevent) \*keyEvent, [OH_NativeXComponent_KeyAction](#oh_nativexcomponent_keyaction) \*action) | Obtains the action of the specified key event. | 78| [OH_NativeXComponent_GetKeyEventCode](#oh_nativexcomponent_getkeyeventcode) ([OH_NativeXComponent_KeyEvent](#oh_nativexcomponent_keyevent) \*keyEvent, [OH_NativeXComponent_KeyCode](#oh_nativexcomponent_keycode) \*code) | Obtains the key code of the specified key event. | 79| [OH_NativeXComponent_GetKeyEventSourceType](#oh_nativexcomponent_getkeyeventsourcetype) ([OH_NativeXComponent_KeyEvent](#oh_nativexcomponent_keyevent) \*keyEvent, [OH_NativeXComponent_EventSourceType](#oh_nativexcomponent_eventsourcetype) \*sourceType) | Obtains the source type of the specified key event. | 80| [OH_NativeXComponent_GetKeyEventDeviceId](#oh_nativexcomponent_getkeyeventdeviceid) ([OH_NativeXComponent_KeyEvent](#oh_nativexcomponent_keyevent) \*keyEvent, int64_t \*deviceId) | Obtains the device ID of the specified key event. | 81| [OH_NativeXComponent_GetKeyEventTimeStamp](#oh_nativexcomponent_getkeyeventtimestamp) ([OH_NativeXComponent_KeyEvent](#oh_nativexcomponent_keyevent) \*keyEvent, int64_t \*timeStamp) | Obtains the timestamp of the specified key event. | 82| [OH_NativeXComponent_SetExpectedFrameRateRange](#oh_nativexcomponent_setexpectedframeraterange) ([OH_NativeXComponent](#oh_nativexcomponent) \*component, [OH_NativeXComponent_ExpectedRateRange](_o_h___native_x_component___expected_rate_range.md) \*range) | Sets the expected frame rate range. | 83| [OH_NativeXComponent_RegisterOnFrameCallback](#oh_nativexcomponent_registeronframecallback) ([OH_NativeXComponent](#oh_nativexcomponent) \*component, void(\*callback)([OH_NativeXComponent](#oh_nativexcomponent) \*component, uint64_t timestamp, uint64_t targetTimestamp)) | Registers the display update callback for this **OH_NativeXComponent** instance and enables the callback for each frame.| 84| [OH_NativeXComponent_UnregisterOnFrameCallback](#oh_nativexcomponent_unregisteronframecallback) ([OH_NativeXComponent](#oh_nativexcomponent) \*component) | Deregisters the display update callback for this **OH_NativeXComponent** instance and disables the callback for each frame.| 85| int32_t [OH_NativeXComponent_AttachNativeRootNode](#oh_nativexcomponent_attachnativerootnode) ([OH_NativeXComponent](#oh_nativexcomponent) \*component, [ArkUI_NodeHandle](_ark_u_i___native_module.md#arkui_nodehandle) root) | Attaches the UI component created through the native API of ArkUI to this **OH_NativeXComponent** instance. | 86| int32_t [OH_NativeXComponent_DetachNativeRootNode](#oh_nativexcomponent_detachnativerootnode) ([OH_NativeXComponent](#oh_nativexcomponent) \*component, [ArkUI_NodeHandle](_ark_u_i___native_module.md#arkui_nodehandle) root) | Detaches the native component of ArkUI from this **OH_NativeXComponent** instance. | 87 88### Variables 89 90| Name | Description | 91| ---------------------------------------- | ------------------------------ | 92| **OH_XCOMPONENT_ID_LEN_MAX** = 128 | Maximum length of the ArkUI XComponent ID. | 93| **OH_MAX_TOUCH_POINTS_NUMBER** = 10 | Maximum number of identifiable touch points in a touch event. | 94| [OH_NativeXComponent_TouchPoint::id](#id-12) = 0 | Unique identifier of the finger. | 95| [OH_NativeXComponent_TouchPoint::screenX](#screenx-13) = 0.0 | X coordinate of the touch point relative to the left edge of the application window where the XComponent is located.| 96| [OH_NativeXComponent_TouchPoint::screenY](#screeny-13) = 0.0 | Y coordinate of the touch point relative to the left edge of the application window where the XComponent is located.| 97| [OH_NativeXComponent_TouchPoint::x](#x-13) = 0.0 | X coordinate of the touch point relative to the left edge of the XComponent. | 98| [OH_NativeXComponent_TouchPoint::y](#y-13) = 0.0 | Y coordinate of the touch point relative to the upper edge of the XComponent. | 99| [OH_NativeXComponent_TouchPoint::type](#type-12) = OH_NativeXComponent_TouchEventType::OH_NATIVEXCOMPONENT_UNKNOWN | Touch type of the touch event. | 100| [OH_NativeXComponent_TouchPoint::size](#size-12) = 0.0 | Contact area between the finger pad and the screen. | 101| [OH_NativeXComponent_TouchPoint::force](#force-12) = 0.0 | Pressure of the touch event. | 102| [OH_NativeXComponent_TouchPoint::timeStamp](#timestamp-12) = 0 | Timestamp of the touch point. | 103| [OH_NativeXComponent_TouchPoint::isPressed](#ispressed) = false | Whether the current point is pressed. | 104| [OH_NativeXComponent_TouchEvent::id](#id-22) = 0 | Unique identifier of the finger. | 105| [OH_NativeXComponent_TouchEvent::screenX](#screenx-23) = 0.0 | X coordinate of the touch point relative to the left edge of the screen. | 106| [OH_NativeXComponent_TouchEvent::screenY](#screeny-23) = 0.0 | Y coordinate of the touch point relative to the upper edge of the screen. | 107| [OH_NativeXComponent_TouchEvent::x](#x-23) = 0.0 | X coordinate of the touch point relative to the left edge of the XComponent. | 108| [OH_NativeXComponent_TouchEvent::y](#y-23) = 0.0 | Y coordinate of the touch point relative to the upper edge of the XComponent. | 109| [OH_NativeXComponent_TouchEvent::type](#type-22) = OH_NativeXComponent_TouchEventType::OH_NATIVEXCOMPONENT_UNKNOWN | Touch type of the touch event. | 110| [OH_NativeXComponent_TouchEvent::size](#size-22) = 0.0 | Contact area between the finger pad and the screen. | 111| [OH_NativeXComponent_TouchEvent::force](#force-22) = 0.0 | Pressure of the touch event. | 112| [OH_NativeXComponent_TouchEvent::deviceId](#deviceid) = 0 | ID of the device where the current touch event is triggered. | 113| [OH_NativeXComponent_TouchEvent::timeStamp](#timestamp-22) = 0 | Timestamp of the touch event. | 114| [OH_NativeXComponent_TouchEvent::touchPoints](#touchpoints) [OH_MAX_TOUCH_POINTS_NUMBER] | Array of the touch points. | 115| [OH_NativeXComponent_TouchEvent::numPoints](#numpoints) = 0 | Number of current touch points. | 116| [OH_NativeXComponent_MouseEvent::x](#x-33) = 0.0 | X coordinate of the clicked point relative to the upper left corner of the component. | 117| [OH_NativeXComponent_MouseEvent::y](#y-33)= 0.0 | Y coordinate of the clicked point relative to the upper left corner of the component. | 118| [OH_NativeXComponent_MouseEvent::screenX](#screenx-33)= 0.0 | X coordinate of the clicked point relative to the upper left corner of the screen. | 119| [OH_NativeXComponent_MouseEvent::screenY](#screeny-33)= 0.0 | Y coordinate of the clicked point relative to the upper left corner of the screen. | 120| [OH_NativeXComponent_MouseEvent::timestamp](#timestamp)= 0 | Timestamp of the mouse event. | 121| [OH_NativeXComponent_MouseEvent::action](#action)= [OH_NativeXComponent_MouseEventAction::OH_NATIVEXCOMPONENT_MOUSE_NONE](#oh_nativexcomponent_mouseeventaction) | Action of the mouse event. | 122| [OH_NativeXComponent_MouseEvent::button](#button)= [OH_NativeXComponent_MouseEventButton::OH_NATIVEXCOMPONENT_NONE_BUTTON](#oh_nativexcomponent_mouseeventbutton) | Enumerates the mouse event buttons. | 123| [OH_NativeXComponent_Callback::OnSurfaceCreated](#onsurfacecreated) | Invoked when a surface is created. | 124| [OH_NativeXComponent_Callback::OnSurfaceChanged](#onsurfacechanged) | Invoked when the surface changes. | 125| [OH_NativeXComponent_Callback::OnSurfaceDestroyed](#onsurfacedestroyed) | Invoked when the surface is destroyed. | 126| [OH_NativeXComponent_Callback::DispatchTouchEvent](#dispatchtouchevent) | Invoked when a touch event is triggered. | 127| [OH_NativeXComponent_MouseEvent_Callback::DispatchMouseEvent](#dispatchmouseevent) | Invoked when a mouse event is triggered. | 128| [OH_NativeXComponent_MouseEvent_Callback::DispatchHoverEvent](#dispatchhoverevent) | Invoked when a hover event is triggered. | 129 130 131## Type Description 132 133 134### OH_NativeXComponent 135 136``` 137typedef struct OH_NativeXComponent OH_NativeXComponent 138``` 139 140**Description** 141 142Provides an encapsulated **OH_NativeXComponent** instance. 143 144**Since** 145 1468 147 148 149### OH_NativeXComponent_Callback 150 151``` 152typedef struct OH_NativeXComponent_Callback OH_NativeXComponent_Callback 153``` 154 155**Description** 156 157Registers callbacks for the surface lifecycle and touch event. 158 159**Since** 160 1618 162 163 164### OH_NativeXComponent_KeyEvent 165 166``` 167typedef struct OH_NativeXComponent_KeyEvent OH_NativeXComponent_KeyEvent 168``` 169 170**Description** 171 172Provides an encapsulated **OH_NativeXComponent_KeyEvent** instance. 173 174**Since** 175 17610 177 178 179### OH_NativeXComponent_MouseEvent_Callback 180 181``` 182typedef struct OH_NativeXComponent_MouseEvent_Callback OH_NativeXComponent_MouseEvent_Callback 183``` 184 185**Description** 186 187Registers callbacks for the mouse event. 188 189**Since** 190 1919 192 193 194## Enum Description 195 196 197### anonymous enum 198 199``` 200anonymous enum 201``` 202 203**Description** 204 205Enumerates the API access states. 206 207| Value | Description | 208| ---------------------------------------- | ----- | 209| OH_NATIVEXCOMPONENT_RESULT_SUCCESS | Success.| 210| OH_NATIVEXCOMPONENT_RESULT_FAILED | Failure.| 211| OH_NATIVEXCOMPONENT_RESULT_BAD_PARAMETER | Invalid parameter.| 212 213**Since** 214 2158 216 217 218### OH_NativeXComponent_EventSourceType 219 220``` 221enum OH_NativeXComponent_EventSourceType 222``` 223 224**Description** 225 226Enumerates the touch event source types. 227 228| Value | Description | 229| ------------------------------------------- | ------------------------------------------------------ | 230| OH_NATIVEXCOMPONENT_SOURCE_TYPE_UNKNOWN | Unknown source type. | 231| OH_NATIVEXCOMPONENT_SOURCE_TYPE_MOUSE | Source that generates a mouse multi-click event. | 232| OH_NATIVEXCOMPONENT_SOURCE_TYPE_TOUCHSCREEN | Source that generates a touchscreen multi-touch event. | 233| OH_NATIVEXCOMPONENT_SOURCE_TYPE_TOUCHPAD | Source that generates a touchpad multi-touch event. | 234| OH_NATIVEXCOMPONENT_SOURCE_TYPE_JOYSTICK | Source that generates a joystick multi-touch event. | 235| OH_NATIVEXCOMPONENT_SOURCE_TYPE_KEYBOARD<sup>10+</sup> | Source that generates a key event. | 236 237**Since** 238 2399 240 241 242### OH_NativeXComponent_KeyAction 243 244``` 245enum OH_NativeXComponent_KeyAction 246``` 247 248**Description** 249 250Enumerates the key event actions. 251 252| Value | Description | 253| -------------------------------------- | -------- | 254| OH_NATIVEXCOMPONENT_KEY_ACTION_UNKNOWN | Unknown key event action.| 255| OH_NATIVEXCOMPONENT_KEY_ACTION_DOWN | Button press. | 256| OH_NATIVEXCOMPONENT_KEY_ACTION_UP | Button release. | 257 258**Since** 259 26010 261 262 263### OH_NativeXComponent_KeyCode 264 265``` 266enum OH_NativeXComponent_KeyCode 267``` 268 269**Description** 270 271Enumerates the mouse event key codes. 272 273| Value | Description | 274| ---------------------------- | --------------------------- | 275| KEY_UNKNOWN | Unknown key. | 276| KEY_FN | Function (Fn) key. | 277| KEY_HOME | Function (Home) key. | 278| KEY_BACK | Back key. | 279| KEY_MEDIA_PLAY_PAUSE | Multimedia key - play/pause. | 280| KEY_MEDIA_STOP | Multimedia key - stop. | 281| KEY_MEDIA_NEXT | Multimedia key - next song. | 282| KEY_MEDIA_PREVIOUS | Multimedia key - previous song. | 283| KEY_MEDIA_REWIND | Multimedia key - rewind. | 284| KEY_MEDIA_FAST_FORWARD | Multimedia key - fast-forward. | 285| KEY_VOLUME_UP | Volume Up key. | 286| KEY_VOLUME_DOWN | Volume Down key. | 287| KEY_POWER | Power key. | 288| KEY_CAMERA | Camera key. | 289| KEY_VOLUME_MUTE | Speaker Mute key. | 290| KEY_MUTE | Microphone Mute key. | 291| KEY_BRIGHTNESS_UP | Brightness key - turn up. | 292| KEY_BRIGHTNESS_DOWN | Brightness key - turn down. | 293| KEY_0 | Key **0**. | 294| KEY_1 | Key **1**. | 295| KEY_2 | Key **2**. | 296| KEY_3 | Key **3**. | 297| KEY_4 | Key **4**. | 298| KEY_5 | Key **5**. | 299| KEY_6 | Key **6**. | 300| KEY_7 | Key **7**. | 301| KEY_8 | Key **8**. | 302| KEY_9 | Key **9**. | 303| KEY_STAR | Key **\***. | 304| KEY_POUND | Key **\#**. | 305| KEY_DPAD_UP | Navigation key - up. | 306| KEY_DPAD_DOWN | Navigation key - down. | 307| KEY_DPAD_LEFT | Navigation key - left. | 308| KEY_DPAD_RIGHT | Navigation key - right. | 309| KEY_DPAD_CENTER | Navigation key - OK. | 310| KEY_A | Key **A**. | 311| KEY_B | Key **B**. | 312| KEY_C | Key **C**. | 313| KEY_D | Key **D**. | 314| KEY_E | Key **E**. | 315| KEY_F | Key **F**. | 316| KEY_G | Key **G**. | 317| KEY_H | Key **H**. | 318| KEY_I | Key **I**. | 319| KEY_J | Key **J**. | 320| KEY_K | Key **K**. | 321| KEY_L | Key **L**. | 322| KEY_M | Key **M**. | 323| KEY_N | Key **N**. | 324| KEY_O | Key **O**. | 325| KEY_P | Key **P**. | 326| KEY_Q | Key **Q**. | 327| KEY_R | Key **R**. | 328| KEY_S | Key **S**. | 329| KEY_T | Key **T**. | 330| KEY_U | Key **U**. | 331| KEY_V | Key **V**. | 332| KEY_W | Key **W**. | 333| KEY_X | Key **X**. | 334| KEY_Y | Key **Y**. | 335| KEY_Z | Key **Z**. | 336| KEY_COMMA | Key **,**. | 337| KEY_PERIOD | Key **.**. | 338| KEY_ALT_LEFT | Left Alt key. | 339| KEY_ALT_RIGHT | Right Alt key. | 340| KEY_SHIFT_LEFT | Left Shift key. | 341| KEY_SHIFT_RIGHT | Right Shift key. | 342| KEY_TAB | Tab key. | 343| KEY_SPACE | Space key. | 344| KEY_SYM | Symbol key. | 345| KEY_EXPLORER | Explorer key, which is used to start the explorer application. | 346| KEY_ENVELOPE | Email key, which is used to start the email application. | 347| KEY_ENTER | Enter key. | 348| KEY_DEL | Delete key. | 349| KEY_GRAVE | Key **`**. | 350| KEY_MINUS | Key **-**. | 351| KEY_EQUALS | Key **=**. | 352| KEY_LEFT_BRACKET | Key **[**. | 353| KEY_RIGHT_BRACKET | Key **]**. | 354| KEY_BACKSLASH | Key **\**. | 355| KEY_SEMICOLON | Key **;**. | 356| KEY_APOSTROPHE | Key **'**. | 357| KEY_SLASH | Key **/**. | 358| KEY_AT | Key **\@**. | 359| KEY_PLUS | Key **+**. | 360| KEY_MENU | Menu key. | 361| KEY_PAGE_UP | Page Up key. | 362| KEY_PAGE_DOWN | Page Down key. | 363| KEY_ESCAPE | ESC key. | 364| KEY_FORWARD_DEL | Delete key. | 365| KEY_CTRL_LEFT | Left Ctrl key. | 366| KEY_CTRL_RIGHT | Right Ctrl key. | 367| KEY_CAPS_LOCK | Caps Lock key. | 368| KEY_SCROLL_LOCK | Scroll Lock key. | 369| KEY_META_LEFT | Left Meta key. | 370| KEY_META_RIGHT | Right Meta key. | 371| KEY_FUNCTION | Function key. | 372| KEY_SYSRQ | System Request/Print Screen key. | 373| KEY_BREAK | Break/Pause key. | 374| KEY_MOVE_HOME | Move to Home key. | 375| KEY_MOVE_END | Move to End key. | 376| KEY_INSERT | Insert key. | 377| KEY_FORWARD | Forward key. | 378| KEY_MEDIA_PLAY | Multimedia key - play. | 379| KEY_MEDIA_PAUSE | Multimedia key - pause. | 380| KEY_MEDIA_CLOSE | Multimedia key - close. | 381| KEY_MEDIA_EJECT | Multimedia key - eject. | 382| KEY_MEDIA_RECORD | Multimedia key - record. | 383| KEY_F1 | F1 key. | 384| KEY_F2 | F2 key. | 385| KEY_F3 | F3 key. | 386| KEY_F4 | F4 key. | 387| KEY_F5 | F5 key. | 388| KEY_F6 | F6 key. | 389| KEY_F7 | F7 key. | 390| KEY_F8 | F8 key. | 391| KEY_F9 | F9 key. | 392| KEY_F10 | F10 key. | 393| KEY_F11 | F11 key. | 394| KEY_F12 | F12 key. | 395| KEY_NUM_LOCK | Number Lock key. | 396| KEY_NUMPAD_0 | Key **0** on numeric keypad. | 397| KEY_NUMPAD_1 | Key **1** on numeric keypad. | 398| KEY_NUMPAD_2 | Key **2** on numeric keypad. | 399| KEY_NUMPAD_3 | Key **3** on numeric keypad. | 400| KEY_NUMPAD_4 | Key **4** on numeric keypad. | 401| KEY_NUMPAD_5 | Key **5** on numeric keypad. | 402| KEY_NUMPAD_6 | Key **6** on numeric keypad. | 403| KEY_NUMPAD_7 | Key **7** on numeric keypad. | 404| KEY_NUMPAD_8 | Key **8** on numeric keypad. | 405| KEY_NUMPAD_9 | Key **9** on numeric keypad. | 406| KEY_NUMPAD_DIVIDE | Key **/** on numeric keypad. | 407| KEY_NUMPAD_MULTIPLY | Key ***** on numeric keypad. | 408| KEY_NUMPAD_SUBTRACT | Key **-** on numeric keypad. | 409| KEY_NUMPAD_ADD | Key **+** on numeric keypad. | 410| KEY_NUMPAD_DOT | Key **.** on numeric keypad. | 411| KEY_NUMPAD_COMMA | Key **,** on numeric keypad. | 412| KEY_NUMPAD_ENTER | Enter key on numeric keypad. | 413| KEY_NUMPAD_EQUALS | Key **=** on numeric keypad. | 414| KEY_NUMPAD_LEFT_PAREN | Key **(** on numeric keypad. | 415| KEY_NUMPAD_RIGHT_PAREN | Key **)** on numeric keypad. | 416| KEY_VIRTUAL_MULTITASK | Multi-task key. | 417| KEY_SLEEP | Sleep key. | 418| KEY_ZENKAKU_HANKAKU | Zenkaku/Hankaku key. | 419| KEY_102ND | 102nd key. | 420| KEY_RO | Ro key. | 421| KEY_KATAKANA | Katakana key. | 422| KEY_HIRAGANA | Hiragana key. | 423| KEY_HENKAN | Henkan key. | 424| KEY_KATAKANA_HIRAGANA | Katakana/Hiragana key. | 425| KEY_MUHENKAN | Muhenkan key. | 426| KEY_LINEFEED | Linefeed key. | 427| KEY_MACRO | Macro key. | 428| KEY_NUMPAD_PLUSMINUS | Plus/Minus key on the numeric keypad. | 429| KEY_SCALE | Scale key. | 430| KEY_HANGUEL | Hanguel key. | 431| KEY_HANJA | Hanja key. | 432| KEY_YEN | Yen key. | 433| KEY_STOP | Stop key. | 434| KEY_AGAIN | Again key. | 435| KEY_PROPS | Props key. | 436| KEY_UNDO | Undo key. | 437| KEY_COPY | Copy key. | 438| KEY_OPEN | Open key. | 439| KEY_PASTE | Paste key. | 440| KEY_FIND | Find key. | 441| KEY_CUT | Cut key. | 442| KEY_HELP | Help key. | 443| KEY_CALC | Calc key, which is used to start the calculator application. | 444| KEY_FILE | File key. | 445| KEY_BOOKMARKS | Bookmarks key. | 446| KEY_NEXT | Next key. | 447| KEY_PLAYPAUSE | Play/Pause key. | 448| KEY_PREVIOUS | Previous key. | 449| KEY_STOPCD | Stop CD key. | 450| KEY_CONFIG | Config key. | 451| KEY_REFRESH | Refresh key. | 452| KEY_EXIT | Exit key. | 453| KEY_EDIT | Edit key. | 454| KEY_SCROLLUP | Scroll Up key. | 455| KEY_SCROLLDOWN | Scroll Down key. | 456| KEY_NEW | New key. | 457| KEY_REDO | Redo key. | 458| KEY_CLOSE | Close key. | 459| KEY_PLAY | Play key. | 460| KEY_BASSBOOST | Bass Boost key. | 461| KEY_PRINT | Print key. | 462| KEY_CHAT | Chat key. | 463| KEY_FINANCE | Finance key. | 464| KEY_CANCEL | Cancel key. | 465| KEY_KBDILLUM_TOGGLE | Keyboard Illumination Toggle key. | 466| KEY_KBDILLUM_DOWN | Keyboard Illumination Up key. | 467| KEY_KBDILLUM_UP | Keyboard Illumination Down key. | 468| KEY_SEND | Send key. | 469| KEY_REPLY | Reply key. | 470| KEY_FORWARDMAIL | Forward Mail key. | 471| KEY_SAVE | Save key. | 472| KEY_DOCUMENTS | Documents key. | 473| KEY_VIDEO_NEXT | Next Video key. | 474| KEY_VIDEO_PREV | Previous Video key. | 475| KEY_BRIGHTNESS_CYCLE | Brightness Cycle key. | 476| KEY_BRIGHTNESS_ZERO | Brightness Zero key. | 477| KEY_DISPLAY_OFF | Display Off Key. | 478| KEY_BTN_MISC | Misc Button key. | 479| KEY_GOTO | Goto key. | 480| KEY_INFO | Info key. | 481| KEY_PROGRAM | Program key. | 482| KEY_PVR | PVR key. | 483| KEY_SUBTITLE | Subtitle key. | 484| KEY_FULL_SCREEN | Full Screen key. | 485| KEY_KEYBOARD | Keyboard. | 486| KEY_ASPECT_RATIO | Aspect Ratio key. | 487| KEY_PC | Port Control key. | 488| KEY_TV | TV key. | 489| KEY_TV2 | TV key 2. | 490| KEY_VCR | VCR key. | 491| KEY_VCR2 | VCR key 2. | 492| KEY_SAT | SAT key. | 493| KEY_CD | CD key. | 494| KEY_TAPE | Tape key. | 495| KEY_TUNER | Tuner key. | 496| KEY_PLAYER | Player key. | 497| KEY_DVD | DVD key. | 498| KEY_AUDIO | Audio key. | 499| KEY_VIDEO | Video key. | 500| KEY_MEMO | Memo key. | 501| KEY_CALENDAR | Calendar key. | 502| KEY_RED | Red indicator. | 503| KEY_GREEN | Green indicator. | 504| KEY_YELLOW | Yellow indicator. | 505| KEY_BLUE | Blue indicator. | 506| KEY_CHANNELUP | Channel Up key. | 507| KEY_CHANNELDOWN | Channel Down key. | 508| KEY_LAST | Last key. | 509| KEY_RESTART | Restart key. | 510| KEY_SLOW | Slow key. | 511| KEY_SHUFFLE | Shuffle key. | 512| KEY_VIDEOPHONE | Videophone key. | 513| KEY_GAMES | Games key. | 514| KEY_ZOOMIN | Zoom in key. | 515| KEY_ZOOMOUT | Zoom out key. | 516| KEY_ZOOMRESET | Zoom Reset key. | 517| KEY_WORDPROCESSOR | Word Processor key. | 518| KEY_EDITOR | Editor key. | 519| KEY_SPREADSHEET | Spreadsheet key. | 520| KEY_GRAPHICSEDITOR | Graphics Editor key. | 521| KEY_PRESENTATION | Presentation key. | 522| KEY_DATABASE | Database key. | 523| KEY_NEWS | News key. | 524| KEY_VOICEMAIL | Voicemail key. | 525| KEY_ADDRESSBOOK | Address book key. | 526| KEY_MESSENGER | Messenger key. | 527| KEY_BRIGHTNESS_TOGGLE | Brightness Toggle key. | 528| KEY_SPELLCHECK | Spell Check key. | 529| KEY_COFFEE | Coffee key, which is used to launch screen lock or screen saver. | 530| KEY_MEDIA_REPEAT | Media Repeat key. | 531| KEY_IMAGES | Images key. | 532| KEY_BUTTONCONFIG | Button Configuration key. | 533| KEY_TASKMANAGER | Task Manager key. | 534| KEY_JOURNAL | Log key. | 535| KEY_CONTROLPANEL | Control Panel key. | 536| KEY_APPSELECT | App Select key. | 537| KEY_SCREENSAVER | Screen Saver key. | 538| KEY_ASSISTANT | Assistant key. | 539| KEY_KBD_LAYOUT_NEXT | Next Keyboard Layout key. | 540| KEY_BRIGHTNESS_MIN | Min Brightness key. | 541| KEY_BRIGHTNESS_MAX | Max Brightness key. | 542| KEY_KBDINPUTASSIST_PREV | Keyboard Input-assisted Previous key. | 543| KEY_KBDINPUTASSIST_NEXT | Keyboard Input-assisted Next key. | 544| KEY_KBDINPUTASSIST_PREVGROUP | Keyboard Input-assisted Previous key. | 545| KEY_KBDINPUTASSIST_NEXTGROUP | Keyboard Input-assisted Next key. | 546| KEY_KBDINPUTASSIST_ACCEPT | Keyboard Input-assisted Accept key. | 547| KEY_KBDINPUTASSIST_CANCEL | Keyboard Input-assisted Cancel key. | 548| KEY_FRONT | Front key, which is used to launch the windshield defogger. | 549| KEY_SETUP | Setup key. | 550| KEY_WAKEUP | Wakeup key. | 551| KEY_SENDFILE | Send File key. | 552| KEY_DELETEFILE | Delete File key. | 553| KEY_XFER | XFER key, which is used to start file transfer. | 554| KEY_PROG1 | Program key 1. | 555| KEY_PROG2 | Program key 2. | 556| KEY_MSDOS | MS-DOS key. | 557| KEY_SCREENLOCK | Screen Lock key. | 558| KEY_DIRECTION_ROTATE_DISPLAY | Directional Rotation Display key. | 559| KEY_CYCLEWINDOWS | Windows Cycle key. | 560| KEY_COMPUTER | Keys. | 561| KEY_EJECTCLOSECD | Eject CD key. | 562| KEY_ISO | ISO key. | 563| KEY_MOVE | Move key. | 564| KEY_F13 | F13 key. | 565| KEY_F14 | F14 key. | 566| KEY_F15 | F15 key. | 567| KEY_F16 | F16 key. | 568| KEY_F17 | F17 key. | 569| KEY_F18 | F18 key. | 570| KEY_F19 | F19 key. | 571| KEY_F20 | F20 key. | 572| KEY_F21 | F21 key. | 573| KEY_F22 | F22 key. | 574| KEY_F23 | F23 key. | 575| KEY_F24 | F24 key. | 576| KEY_PROG3 | Program key 3. | 577| KEY_PROG4 | Program key 4. | 578| KEY_DASHBOARD | Dashboard. | 579| KEY_SUSPEND | Suspend key. | 580| KEY_HP | HP key. | 581| KEY_SOUND | Sound key. | 582| KEY_QUESTION | Question key. | 583| KEY_CONNECT | Connect key. | 584| KEY_SPORT | Sport key. | 585| KEY_SHOP | Shop key. | 586| KEY_ALTERASE | Alternate key. | 587| KEY_SWITCHVIDEOMODE | Switch Video Mode key (monitor, LCD, and TV, etc.).| 588| KEY_BATTERY | Battery key. | 589| KEY_BLUETOOTH | Bluetooth key. | 590| KEY_WLAN | WLAN key. | 591| KEY_UWB | Ultra-wideband key. | 592| KEY_WWAN_WIMAX | WWAN WiMAX key. | 593| KEY_RFKILL | RF Kill key. | 594| KEY_CHANNEL | Channel key. | 595| KEY_BTN_0 | Button 0. | 596| KEY_BTN_1 | Button 1. | 597| KEY_BTN_2 | Button 2. | 598| KEY_BTN_3 | Button 3. | 599| KEY_BTN_4 | Button 4. | 600| KEY_BTN_5 | Button 5. | 601| KEY_BTN_6 | Button 6. | 602| KEY_BTN_7 | Button 7. | 603| KEY_BTN_8 | Button 8. | 604| KEY_BTN_9 | Button 9. | 605 606**Since** 607 60810 609 610 611### OH_NativeXComponent_MouseEventAction 612 613``` 614enum OH_NativeXComponent_MouseEventAction 615``` 616 617**Description** 618 619Enumerates the mouse event actions. 620 621| Value | Description | 622| --------------------------------- | ---------------- | 623| OH_NATIVEXCOMPONENT_MOUSE_NONE | Invalid mouse event. | 624| OH_NATIVEXCOMPONENT_MOUSE_PRESS | Mouse button press. | 625| OH_NATIVEXCOMPONENT_MOUSE_RELEASE | Mouse button release. | 626| OH_NATIVEXCOMPONENT_MOUSE_MOVE | Mouse movement.| 627 628**Since** 629 6309 631 632 633### OH_NativeXComponent_MouseEventButton 634 635``` 636enum OH_NativeXComponent_MouseEventButton 637``` 638 639**Description** 640 641Enumerates the mouse event buttons. 642 643| Value | Description | 644| ---------------------------------- | ----------------- | 645| OH_NATIVEXCOMPONENT_NONE_BUTTON | No button. | 646| OH_NATIVEXCOMPONENT_LEFT_BUTTON | Left mouse button. | 647| OH_NATIVEXCOMPONENT_RIGHT_BUTTON | Right mouse button. | 648| OH_NATIVEXCOMPONENT_MIDDLE_BUTTON | Middle mouse button. | 649| OH_NATIVEXCOMPONENT_BACK_BUTTON | Back button on the left of the mouse.| 650| OH_NATIVEXCOMPONENT_FORWARD_BUTTON | Forward key on the left of the mouse.| 651 652**Since** 653 6549 655 656 657### OH_NativeXComponent_TouchEventType 658 659``` 660enum OH_NativeXComponent_TouchEventType 661``` 662 663**Description** 664 665Enumerates the touch event types. 666 667| Value | Description | 668| --------------------------- | --------------------- | 669| OH_NATIVEXCOMPONENT_DOWN | The touch event is triggered when a finger is pressed. | 670| OH_NATIVEXCOMPONENT_UP | The touch event is triggered when a finger is lifted. | 671| OH_NATIVEXCOMPONENT_MOVE | The touch event is triggered when a finger is moved on the screen.| 672| OH_NATIVEXCOMPONENT_CANCEL | The event is triggered when a touch event is canceled. | 673| OH_NATIVEXCOMPONENT_UNKNOWN | Invalid touch type. | 674 675**Since** 676 6778 678 679 680### OH_NativeXComponent_TouchPointToolType 681 682``` 683enum OH_NativeXComponent_TouchPointToolType 684``` 685 686**Description** 687 688Enumerates the touch point tool types. 689 690| Value | Description | 691| -------------------------------------- | -------- | 692| OH_NATIVEXCOMPONENT_TOOL_TYPE_UNKNOWN | Unknown tool type.| 693| OH_NATIVEXCOMPONENT_TOOL_TYPE_FINGER | Finger. | 694| OH_NATIVEXCOMPONENT_TOOL_TYPE_PEN | Stylus. | 695| OH_NATIVEXCOMPONENT_TOOL_TYPE_RUBBER | Rubber. | 696| OH_NATIVEXCOMPONENT_TOOL_TYPE_BRUSH | Brush. | 697| OH_NATIVEXCOMPONENT_TOOL_TYPE_PENCIL | Pencil. | 698| OH_NATIVEXCOMPONENT_TOOL_TYPE_AIRBRUSH | Air brush. | 699| OH_NATIVEXCOMPONENT_TOOL_TYPE_MOUSE | Mouse. | 700| OH_NATIVEXCOMPONENT_TOOL_TYPE_LENS | Lens. | 701 702**Since** 703 7049 705 706 707## Function Description 708 709### OH_NativeXComponent_AttachNativeRootNode() 710 711``` 712int32_t OH_NativeXComponent_AttachNativeRootNode (OH_NativeXComponent * component, ArkUI_NodeHandle root ) 713``` 714**Description** 715 716Attaches the UI component created through the native API of ArkUI to this **OH_NativeXComponent** instance. 717 718**Since**: 12 719 720**Parameters** 721 722| Name| Description| 723| -------- | -------- | 724| component | Pointer to the **OH_NativeXComponent** instance. | 725| root | Pointer to the component instance created through the native API. | 726 727**Returns** 728 729**0**: success 730 731**401**: parameter error 732 733 734### OH_NativeXComponent_DetachNativeRootNode() 735 736``` 737int32_t OH_NativeXComponent_DetachNativeRootNode (OH_NativeXComponent * component, ArkUI_NodeHandle root ) 738``` 739**Description** 740 741Detaches the native component of ArkUI from this **OH_NativeXComponent** instance. 742 743**Since**: 12 744 745**Parameters** 746 747| Name| Description| 748| -------- | -------- | 749| component | Pointer to the **OH_NativeXComponent** instance. | 750| root | Pointer to the component instance created through the native API. | 751 752**Returns** 753 754**0**: success 755 756**401**: parameter error 757 758 759 760### OH_NativeXComponent_GetKeyEvent() 761 762``` 763int32_t OH_NativeXComponent_GetKeyEvent (OH_NativeXComponent * component, OH_NativeXComponent_KeyEvent ** keyEvent ) 764``` 765 766**Description** 767 768Obtains the key event scheduled by ArkUI XComponent. 769 770**Parameters** 771 772| Name | Description | 773| --------- | ----------------------------- | 774| component | Pointer to the **OH_NativeXComponent** instance.| 775| keyEvent | Pointer to the current key event. | 776 777**Returns** 778 779Returns the status code of the execution. 780 781**Since** 782 78310 784 785 786### OH_NativeXComponent_GetKeyEventAction() 787 788``` 789int32_t OH_NativeXComponent_GetKeyEventAction (OH_NativeXComponent_KeyEvent * keyEvent, OH_NativeXComponent_KeyAction * action ) 790``` 791 792**Description** 793 794Obtains the action of the specified key event. 795 796**Parameters** 797 798| Name | Description | 799| -------- | -------------------------------------- | 800| keyEvent | Pointer to the **OH_NativeXComponent_KeyEvent** instance.| 801| action | Pointer to the key event action. | 802 803**Returns** 804 805Returns the status code of the execution. 806 807**Since** 808 80910 810 811 812### OH_NativeXComponent_GetKeyEventCode() 813 814``` 815int32_t OH_NativeXComponent_GetKeyEventCode (OH_NativeXComponent_KeyEvent * keyEvent, OH_NativeXComponent_KeyCode * code ) 816``` 817 818**Description** 819 820Obtains the key code of the specified key event. 821 822**Parameters** 823 824| Name | Description | 825| -------- | -------------------------------------- | 826| keyEvent | Pointer to the **OH_NativeXComponent_KeyEvent** instance.| 827| code | Pointer to the key code of the key event. | 828 829**Returns** 830 831Returns the status code of the execution. 832 833**Since** 834 83510 836 837 838### OH_NativeXComponent_GetKeyEventDeviceId() 839 840``` 841int32_t OH_NativeXComponent_GetKeyEventDeviceId (OH_NativeXComponent_KeyEvent * keyEvent, int64_t * deviceId ) 842``` 843 844**Description** 845 846Obtains the device ID of the specified key event. 847 848**Parameters** 849 850| Name | Description | 851| -------- | -------------------------------------- | 852| keyEvent | Pointer to the **OH_NativeXComponent_KeyEvent** instance.| 853| deviceId | Pointer to the device ID of the key event. | 854 855**Returns** 856 857Returns the status code of the execution. 858 859**Since** 860 86110 862 863 864### OH_NativeXComponent_GetKeyEventSourceType() 865 866``` 867int32_t OH_NativeXComponent_GetKeyEventSourceType (OH_NativeXComponent_KeyEvent * keyEvent, OH_NativeXComponent_EventSourceType * sourceType ) 868``` 869 870**Description** 871 872Obtains the source type of the specified key event. 873 874**Parameters** 875 876| Name | Description | 877| ---------- | -------------------------------------- | 878| keyEvent | Pointer to the **OH_NativeXComponent_KeyEvent** instance.| 879| sourceType | Pointer to the source type of the key event. | 880 881**Returns** 882 883Returns the status code of the execution. 884 885**Since** 886 88710 888 889 890### OH_NativeXComponent_GetKeyEventTimeStamp() 891 892``` 893int32_t OH_NativeXComponent_GetKeyEventTimeStamp (OH_NativeXComponent_KeyEvent * keyEvent, int64_t * timeStamp ) 894``` 895 896**Description** 897 898Obtains the timestamp of the specified key event. 899 900**Parameters** 901 902| Name | Description | 903| --------- | -------------------------------------- | 904| keyEvent | Pointer to the **OH_NativeXComponent_KeyEvent** instance.| 905| timeStamp | Pointer to the timestamp of the key event. | 906 907**Returns** 908 909Returns the status code of the execution. 910 911**Since** 912 91310 914 915 916### OH_NativeXComponent_GetMouseEvent() 917 918``` 919int32_t OH_NativeXComponent_GetMouseEvent (OH_NativeXComponent * component, const void * window, OH_NativeXComponent_MouseEvent * mouseEvent ) 920``` 921 922**Description** 923 924Obtains the mouse event scheduled by ArkUI XComponent. 925 926**Parameters** 927 928| Name | Description | 929| ---------- | ----------------------------- | 930| component | Pointer to the **OH_NativeXComponent** instance.| 931| window | Handle to the **NativeWindow** instance. | 932| mouseEvent | Pointer to the current mouse event. | 933 934**Returns** 935 936Returns the status code of the execution. 937 938**Since** 939 9409 941 942 943### OH_NativeXComponent_GetTouchEvent() 944 945``` 946int32_t OH_NativeXComponent_GetTouchEvent (OH_NativeXComponent * component, const void * window, OH_NativeXComponent_TouchEvent * touchEvent ) 947``` 948 949**Description** 950 951Obtains the touch event scheduled by the ArkUI XComponent. 952 953**Parameters** 954 955| Name | Description | 956| ---------- | ----------------------------- | 957| component | Pointer to the **OH_NativeXComponent** instance.| 958| window | Handle to the **NativeWindow** instance. | 959| touchEvent | Pointer to the current touch event. | 960 961**Returns** 962 963Returns the status code of the execution. 964 965**Since** 966 9678 968 969 970### OH_NativeXComponent_GetTouchPointTiltX() 971 972``` 973int32_t OH_NativeXComponent_GetTouchPointTiltX (OH_NativeXComponent * component, uint32_t pointIndex, float * tiltX ) 974``` 975 976**Description** 977 978Obtains the angle between the Y-Z plane of the ArkUI XComponent touch point and the x-axis. 979 980**Parameters** 981 982| Name | Description | 983| ---------- | ----------------------------- | 984| component | Pointer to the **OH_NativeXComponent** instance.| 985| pointIndex | Pointer to the index of the touch point. | 986| tiltX | Pointer to the angle between the Y-Z plane of the touch point and the x-axis. | 987 988**Returns** 989 990Returns the status code of the execution. 991 992**Since** 993 9949 995 996 997### OH_NativeXComponent_GetTouchPointTiltY() 998 999``` 1000int32_t OH_NativeXComponent_GetTouchPointTiltY (OH_NativeXComponent * component, uint32_t pointIndex, float * tiltY ) 1001``` 1002 1003**Description** 1004 1005Obtains the angle between the X-Z plane of the ArkUI XComponent touch point and the x-axis. 1006 1007**Parameters** 1008 1009| Name | Description | 1010| ---------- | ----------------------------- | 1011| component | Pointer to the **OH_NativeXComponent** instance.| 1012| pointIndex | Pointer to the index of the touch point. | 1013| tiltY | Pointer to the angle between the X-Z plane of the touch point and the y-axis. | 1014 1015**Returns** 1016 1017Returns the status code of the execution. 1018 1019**Since** 1020 10219 1022 1023 1024### OH_NativeXComponent_GetTouchPointToolType() 1025 1026``` 1027int32_t OH_NativeXComponent_GetTouchPointToolType (OH_NativeXComponent * component, uint32_t pointIndex, OH_NativeXComponent_TouchPointToolType * toolType ) 1028``` 1029 1030**Description** 1031 1032Obtains the ArkUI XComponent touch point tool type. 1033 1034**Parameters** 1035 1036| Name | Description | 1037| ---------- | ----------------------------- | 1038| component | Pointer to the **OH_NativeXComponent** instance.| 1039| pointIndex | Pointer to the index of the touch point. | 1040| toolType | Pointer to the tool type. | 1041 1042**Returns** 1043 1044Returns the status code of the execution. 1045 1046**Since** 1047 10489 1049 1050 1051### OH_NativeXComponent_GetXComponentId() 1052 1053``` 1054int32_t OH_NativeXComponent_GetXComponentId (OH_NativeXComponent * component, char * id, uint64_t * size ) 1055``` 1056 1057**Description** 1058 1059Obtain the ID of ArkUI XComponent. 1060 1061**Parameters** 1062 1063| Name | Description | 1064| --------- | ------------------------------------------------------------ | 1065| component | Pointer to the **OH_NativeXComponent** instance. | 1066| id | Pointer to the character buffer for storing the ID of the **OH_NativeXComponent** instance. Note that null terminators will be attached to the character buffer, so the size of the character buffer should be at least one unit greater than the length of the real ID. The recommended size is [OH_XCOMPONENT_ID_LEN_MAX + 1].| 1067| size | Pointer to the ID length, which is used to receive the ID length information. | 1068 1069**Returns** 1070 1071Returns the status code of the execution. 1072 1073**Since** 1074 10758 1076 1077 1078### OH_NativeXComponent_GetXComponentOffset() 1079 1080``` 1081int32_t OH_NativeXComponent_GetXComponentOffset (OH_NativeXComponent * component, const void * window, double * x, double * y ) 1082``` 1083 1084**Description** 1085 1086Obtains the offset of the ArkUI XComponent relative to the upper left vertex of the screen. 1087 1088**Parameters** 1089 1090| Name | Description | 1091| --------- | ----------------------------- | 1092| component | Pointer to the **OH_NativeXComponent** instance.| 1093| window | Handle to the **NativeWindow** instance. | 1094| x | Pointer to the x coordinate of the current surface. | 1095| y | Pointer to the y coordinate of the current surface. | 1096 1097**Returns** 1098 1099Returns the status code of the execution. 1100 1101**Since** 1102 11038 1104 1105 1106### OH_NativeXComponent_GetXComponentSize() 1107 1108``` 1109int32_t OH_NativeXComponent_GetXComponentSize (OH_NativeXComponent * component, const void * window, uint64_t * width, uint64_t * height ) 1110``` 1111 1112**Description** 1113 1114Obtains the size of the surface held by the ArkUI XComponent. 1115 1116**Parameters** 1117 1118| Name | Description | 1119| --------- | ----------------------------- | 1120| component | Pointer to the **OH_NativeXComponent** instance.| 1121| window | Handle to the **NativeWindow** instance. | 1122| width | Pointer to the width of the current surface. | 1123| height | Pointer to the height of the current surface. | 1124 1125**Returns** 1126 1127Returns the status code of the execution. 1128 1129**Since** 1130 11318 1132 1133 1134### OH_NativeXComponent_RegisterBlurEventCallback() 1135 1136``` 1137int32_t OH_NativeXComponent_RegisterBlurEventCallback (OH_NativeXComponent * component, void(*callback)(OH_NativeXComponent *component, void *window)) 1138``` 1139 1140**Description** 1141 1142Registers the focus loss event callback for this **OH_NativeXComponent** instance. 1143 1144**Parameters** 1145 1146| Name | Description | 1147| --------- | ----------------------------- | 1148| component | Pointer to the **OH_NativeXComponent** instance.| 1149| callback | Pointer to the focus loss event callback. | 1150 1151**Returns** 1152 1153Returns the status code of the execution. 1154 1155**Since** 1156 115710 1158 1159 1160### OH_NativeXComponent_RegisterCallback() 1161 1162``` 1163int32_t OH_NativeXComponent_RegisterCallback (OH_NativeXComponent * component, OH_NativeXComponent_Callback * callback ) 1164``` 1165 1166**Description** 1167 1168Registers a callback for this **OH_NativeXComponent** instance. 1169 1170**Parameters** 1171 1172| Name | Description | 1173| --------- | ----------------------------- | 1174| component | Pointer to the **OH_NativeXComponent** instance.| 1175| callback | Pointer to the surface lifecycle and touch event callback. | 1176 1177**Returns** 1178 1179Returns the status code of the execution. 1180 1181**Since** 1182 11838 1184 1185 1186### OH_NativeXComponent_RegisterFocusEventCallback() 1187 1188``` 1189int32_t OH_NativeXComponent_RegisterFocusEventCallback (OH_NativeXComponent * component, void(*callback)(OH_NativeXComponent *component, void *window)) 1190``` 1191 1192**Description** 1193 1194Registers the focus obtaining event callback for this **OH_NativeXComponent** instance. 1195 1196**Parameters** 1197 1198| Name | Description | 1199| --------- | ----------------------------- | 1200| component | Pointer to the **OH_NativeXComponent** instance.| 1201| callback | Pointer to the focus obtaining event callback. | 1202 1203**Returns** 1204 1205Returns the status code of the execution. 1206 1207**Since** 1208 120910 1210 1211 1212### OH_NativeXComponent_RegisterKeyEventCallback() 1213 1214``` 1215int32_t OH_NativeXComponent_RegisterKeyEventCallback (OH_NativeXComponent * component, void(*callback)(OH_NativeXComponent *component, void *window)) 1216``` 1217 1218**Description** 1219 1220Registers the key event callback for this **OH_NativeXComponent** instance. 1221 1222**Parameters** 1223 1224| Name | Description | 1225| --------- | ----------------------------- | 1226| component | Pointer to the **OH_NativeXComponent** instance.| 1227| callback | Pointer to the key event callback. | 1228 1229**Returns** 1230 1231Returns the status code of the execution. 1232 1233**Since** 1234 123510 1236 1237 1238### OH_NativeXComponent_RegisterMouseEventCallback() 1239 1240``` 1241int32_t OH_NativeXComponent_RegisterMouseEventCallback (OH_NativeXComponent * component, OH_NativeXComponent_MouseEvent_Callback * callback ) 1242``` 1243 1244**Description** 1245 1246Registers the mouse event callback for this **OH_NativeXComponent** instance. 1247 1248**Parameters** 1249 1250| Name | Description | 1251| --------- | ----------------------------- | 1252| component | Pointer to the **OH_NativeXComponent** instance.| 1253| callback | Pointer to the mouse event callback. | 1254 1255**Returns** 1256 1257Returns the status code of the execution. 1258 1259**Since** 1260 12619 1262 1263### OH_NativeXComponent_RegisterOnFrameCallback() 1264 1265``` 1266int32_t OH_NativeXComponent_RegisterOnFrameCallback (OH_NativeXComponent* component, void (*callback)(OH_NativeXComponent *component, uint64_t timestamp, uint64_t targetTimestamp)) 1267``` 1268**Description** 1269 1270Registers the display update callback for this **OH_NativeXComponent** instance and enables the callback for each frame. 1271 1272**Parameters** 1273 1274| Name| Description| 1275| -------- | -------- | 1276| component | Pointer to the **OH_NativeXComponent** instance. | 1277| callback | Pointer to the display update callback. | 1278 1279**Returns** 1280 1281Returns the status code of the execution. 1282 1283**Since** 1284 128511 1286 1287 1288### OH_NativeXComponent_SetExpectedFrameRateRange() 1289 1290``` 1291int32_t OH_NativeXComponent_SetExpectedFrameRateRange (OH_NativeXComponent * component, OH_NativeXComponent_ExpectedRateRange * range ) 1292``` 1293**Description** 1294 1295Sets the expected frame rate range. 1296 1297**Parameters** 1298 1299| Name| Description| 1300| -------- | -------- | 1301| component | Pointer to the **OH_NativeXComponent** instance. | 1302| range | Pointer to the expected frame rate range.| 1303 1304**Returns** 1305 1306Returns the status code of the execution. 1307 1308**Since** 1309 131011 1311 1312 1313### OH_NativeXComponent_UnregisterOnFrameCallback() 1314 1315``` 1316int32_t OH_NativeXComponent_UnregisterOnFrameCallback (OH_NativeXComponent * component) 1317``` 1318**Description** 1319 1320Deregisters the display update callback for this **OH_NativeXComponent** instance and disables the callback for each frame. 1321 1322**Parameters** 1323 1324| Name| Description| 1325| -------- | -------- | 1326| component | Pointer to the **OH_NativeXComponent** instance. | 1327 1328**Returns** 1329 1330Returns the status code of the execution. 1331 1332**Since** 1333 133411 1335<!-- --> 1336 1337## Variable Description 1338 1339 1340### OH_XCOMPONENT_ID_LEN_MAX 1341 1342``` 1343const uint32_t OH_XCOMPONENT_ID_LEN_MAX = 128 1344``` 1345 1346 1347**Description** 1348 1349 1350Maximum length of the ArkUI XComponent ID. 1351 1352 1353**Since** 1354 1355 13568 1357 1358 1359### OH_MAX_TOUCH_POINTS_NUMBER 1360 1361``` 1362const uint32_t OH_MAX_TOUCH_POINTS_NUMBER = 10 1363``` 1364 1365**Description** 1366 1367Maximum number of identifiable touch points in a touch event. 1368 1369**Since** 1370 13718 1372 1373 1374### action 1375 1376``` 1377OH_NativeXComponent_MouseEventAction OH_NativeXComponent_MouseEvent::action 1378``` 1379 1380**Description** 1381 1382Action of the mouse event. 1383 1384**Since** 1385 13868 1387 1388 1389### button 1390 1391``` 1392OH_NativeXComponent_MouseEventButton OH_NativeXComponent_MouseEvent::button 1393``` 1394 1395**Description** 1396 1397Mouse event button. 1398 1399**Since** 1400 14018 1402 1403 1404### deviceId 1405 1406``` 1407int64_t OH_NativeXComponent_TouchEvent::deviceId = 0 1408``` 1409 1410**Description** 1411 1412ID of the device where the current touch event is triggered. 1413 1414**Since** 1415 14168 1417 1418 1419### DispatchHoverEvent 1420 1421``` 1422void(* OH_NativeXComponent_MouseEvent_Callback::DispatchHoverEvent) (OH_NativeXComponent *component, bool isHover) 1423``` 1424 1425**Description** 1426 1427Invoked when a hover event is triggered. 1428 1429**Since** 1430 14318 1432 1433 1434### DispatchMouseEvent 1435 1436``` 1437void(* OH_NativeXComponent_MouseEvent_Callback::DispatchMouseEvent) (OH_NativeXComponent *component, void *window) 1438``` 1439 1440**Description** 1441 1442Invoked when a mouse event is triggered. 1443 1444**Since** 1445 14468 1447 1448 1449### DispatchTouchEvent 1450 1451``` 1452void(* OH_NativeXComponent_Callback::DispatchTouchEvent) (OH_NativeXComponent *component, void *window) 1453``` 1454 1455**Description** 1456 1457Invoked when a touch event is triggered. 1458 1459**Since** 1460 14618 1462 1463 1464### force [1/2] 1465 1466``` 1467float OH_NativeXComponent_TouchPoint::force = 0.0 1468``` 1469 1470**Description** 1471 1472Pressure of the touch event. 1473 1474**Since** 1475 14768 1477 1478 1479### force [2/2] 1480 1481``` 1482float OH_NativeXComponent_TouchEvent::force = 0.0 1483``` 1484 1485**Description** 1486 1487Pressure of the touch event. 1488 1489**Since** 1490 14918 1492 1493 1494### id [1/2] 1495 1496``` 1497int32_t OH_NativeXComponent_TouchPoint::id = 0 1498``` 1499 1500**Description** 1501 1502Unique identifier of the finger. 1503 1504**Since** 1505 15068 1507 1508 1509### id [2/2] 1510 1511``` 1512int32_t OH_NativeXComponent_TouchEvent::id = 0 1513``` 1514 1515**Description** 1516 1517Unique identifier of the finger. 1518 1519**Since** 1520 15218 1522 1523 1524### isPressed 1525 1526``` 1527bool OH_NativeXComponent_TouchPoint::isPressed = false 1528``` 1529 1530**Description** 1531 1532Whether the current point is pressed. 1533 1534**Since** 1535 15368 1537 1538 1539### numPoints 1540 1541``` 1542uint32_t OH_NativeXComponent_TouchEvent::numPoints = 0 1543``` 1544 1545**Description** 1546 1547Number of current touch points. 1548 1549**Since** 1550 15518 1552 1553 1554### OnSurfaceChanged 1555 1556``` 1557void(* OH_NativeXComponent_Callback::OnSurfaceChanged) (OH_NativeXComponent *component, void *window) 1558``` 1559 1560**Description** 1561 1562Invoked when the surface changes. 1563 1564**Since** 1565 15668 1567 1568 1569### OnSurfaceCreated 1570 1571``` 1572void(* OH_NativeXComponent_Callback::OnSurfaceCreated) (OH_NativeXComponent *component, void *window) 1573``` 1574 1575**Description** 1576 1577Invoked when a surface is created. 1578 1579**Since** 1580 15818 1582 1583 1584### OnSurfaceDestroyed 1585 1586``` 1587void(* OH_NativeXComponent_Callback::OnSurfaceDestroyed) (OH_NativeXComponent *component, void *window) 1588``` 1589 1590**Description** 1591 1592Invoked when the surface is destroyed. 1593 1594**Since** 1595 15968 1597 1598 1599### screenX [1/3] 1600 1601``` 1602float OH_NativeXComponent_TouchPoint::screenX = 0.0 1603``` 1604 1605**Description** 1606 1607X coordinate of the touch point relative to the left edge of the application window where the XComponent is located. 1608 1609**Since** 1610 16118 1612 1613 1614### screenX [2/3] 1615 1616``` 1617float OH_NativeXComponent_TouchEvent::screenX = 0.0 1618``` 1619 1620**Description** 1621 1622X coordinate of the touch point relative to the left edge of the screen. 1623 1624**Since** 1625 16268 1627 1628 1629### screenX [3/3] 1630 1631``` 1632float OH_NativeXComponent_MouseEvent::screenX 1633``` 1634 1635**Description** 1636 1637X coordinate of the clicked point relative to the upper left corner of the screen. 1638 1639**Since** 1640 16418 1642 1643 1644### screenY [1/3] 1645 1646``` 1647float OH_NativeXComponent_TouchPoint::screenY = 0.0 1648``` 1649 1650**Description** 1651 1652Y coordinate of the touch point relative to the left edge of the application window where the XComponent is located. 1653 1654**Since** 1655 16568 1657 1658 1659### screenY [2/3] 1660 1661``` 1662float OH_NativeXComponent_TouchEvent::screenY = 0.0 1663``` 1664 1665**Description** 1666 1667Y coordinate of the touch point relative to the upper edge of the screen. 1668 1669**Since** 1670 16718 1672 1673 1674### screenY [3/3] 1675 1676``` 1677float OH_NativeXComponent_MouseEvent::screenY 1678``` 1679 1680**Description** 1681 1682Y coordinate of the clicked point relative to the upper left corner of the screen. 1683 1684**Since** 1685 16868 1687 1688 1689### size [1/2] 1690 1691``` 1692double OH_NativeXComponent_TouchPoint::size = 0.0 1693``` 1694 1695**Description** 1696 1697Contact area between the finger pad and the screen. 1698 1699**Since** 1700 17018 1702 1703 1704### size [2/2] 1705 1706``` 1707double OH_NativeXComponent_TouchEvent::size = 0.0 1708``` 1709 1710**Description** 1711 1712Contact area between the finger pad and the screen. 1713 1714**Since** 1715 17168 1717 1718 1719### timeStamp [1/2] 1720 1721``` 1722long long OH_NativeXComponent_TouchPoint::timeStamp = 0 1723``` 1724 1725**Description** 1726 1727Timestamp of the touch point. 1728 1729**Since** 1730 17318 1732 1733 1734### timeStamp [2/2] 1735 1736``` 1737long long OH_NativeXComponent_TouchEvent::timeStamp = 0 1738``` 1739 1740**Description** 1741 1742Timestamp of the touch point. 1743 1744**Since** 1745 17468 1747 1748 1749### timestamp 1750 1751``` 1752int64_t OH_NativeXComponent_MouseEvent::timestamp 1753``` 1754 1755**Description** 1756 1757Timestamp of the mouse event. 1758 1759**Since** 1760 17618 1762 1763 1764### touchPoints 1765 1766``` 1767OH_NativeXComponent_TouchPoint OH_NativeXComponent_TouchEvent::touchPoints[OH_MAX_TOUCH_POINTS_NUMBER] 1768``` 1769 1770**Description** 1771 1772Array of the touch points. 1773 1774**Since** 1775 17768 1777 1778 1779### type [1/2] 1780 1781``` 1782OH_NativeXComponent_TouchEventType OH_NativeXComponent_TouchPoint::type = OH_NativeXComponent_TouchEventType::OH_NATIVEXCOMPONENT_UNKNOWN 1783``` 1784 1785**Description** 1786 1787Touch type of the touch point. 1788 1789**Since** 1790 17918 1792 1793 1794### type [2/2] 1795 1796``` 1797OH_NativeXComponent_TouchEventType OH_NativeXComponent_TouchEvent::type = OH_NativeXComponent_TouchEventType::OH_NATIVEXCOMPONENT_UNKNOWN 1798``` 1799 1800**Description** 1801 1802Touch type of the touch point. 1803 1804**Since** 1805 18068 1807 1808 1809### x [1/3] 1810 1811``` 1812float OH_NativeXComponent_TouchPoint::x = 0.0 1813``` 1814 1815**Description** 1816 1817X coordinate of the touch point relative to the left edge of the XComponent. 1818 1819**Since** 1820 18218 1822 1823 1824### x [2/3] 1825 1826``` 1827float OH_NativeXComponent_TouchEvent::x = 0.0 1828``` 1829 1830**Description** 1831 1832X coordinate of the touch point relative to the left edge of the XComponent. 1833 1834**Since** 1835 18368 1837 1838 1839### x [3/3] 1840 1841``` 1842float OH_NativeXComponent_MouseEvent::x 1843``` 1844 1845**Description** 1846 1847X coordinate of the clicked point relative to the upper left corner of the component. 1848 1849**Since** 1850 18518 1852 1853 1854### y [1/3] 1855 1856``` 1857float OH_NativeXComponent_TouchPoint::y = 0.0 1858``` 1859 1860**Description** 1861 1862Y coordinate of the touch point relative to the upper edge of the XComponent. 1863 1864**Since** 1865 18668 1867 1868 1869### y [2/3] 1870 1871``` 1872float OH_NativeXComponent_TouchEvent::y = 0.0 1873``` 1874 1875**Description** 1876 1877Y coordinate of the touch point relative to the upper edge of the XComponent. 1878 1879**Since** 1880 18818 1882 1883 1884### y [3/3] 1885 1886``` 1887float OH_NativeXComponent_MouseEvent::y 1888``` 1889 1890**Description** 1891 1892Y coordinate of the clicked point relative to the upper left corner of the component. 1893 1894**Since** 1895 18968 1897 1898### expected 1899 1900``` 1901int32_t OH_NativeXComponent_ExpectedRateRange::expected 1902``` 1903**Description** 1904 1905Expected frame rate range. 1906 1907**Since** 1908 190911 1910 1911### max 1912 1913``` 1914int32_t OH_NativeXComponent_ExpectedRateRange::max 1915``` 1916**Description** 1917 1918Maximum value of the expected frame rate range. 1919 1920**Since** 1921 192211 1923 1924 1925### min 1926 1927``` 1928int32_t OH_NativeXComponent_ExpectedRateRange::min 1929``` 1930**Description** 1931 1932Minimum value of the expected frame rate range. 1933 1934**Since** 1935 193611 1937<!--no_check-->