1 /* 2 * Copyright (c) 2023 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #include "mmi_keyevent_adapter.h" 17 18 #include "key_event.h" 19 20 namespace OHOS::NWeb { 21 namespace MMIAdapter { 22 const int32_t KeyEvent::KEYCODE_0 = OHOS::MMI::KeyEvent::KEYCODE_0; 23 const int32_t KeyEvent::KEYCODE_1 = OHOS::MMI::KeyEvent::KEYCODE_1; 24 const int32_t KeyEvent::KEYCODE_2 = OHOS::MMI::KeyEvent::KEYCODE_2; 25 const int32_t KeyEvent::KEYCODE_3 = OHOS::MMI::KeyEvent::KEYCODE_3; 26 const int32_t KeyEvent::KEYCODE_4 = OHOS::MMI::KeyEvent::KEYCODE_4; 27 const int32_t KeyEvent::KEYCODE_5 = OHOS::MMI::KeyEvent::KEYCODE_5; 28 const int32_t KeyEvent::KEYCODE_6 = OHOS::MMI::KeyEvent::KEYCODE_6; 29 const int32_t KeyEvent::KEYCODE_7 = OHOS::MMI::KeyEvent::KEYCODE_7; 30 const int32_t KeyEvent::KEYCODE_8 = OHOS::MMI::KeyEvent::KEYCODE_8; 31 const int32_t KeyEvent::KEYCODE_9 = OHOS::MMI::KeyEvent::KEYCODE_9; 32 const int32_t KeyEvent::KEYCODE_DPAD_UP = OHOS::MMI::KeyEvent::KEYCODE_DPAD_UP; 33 const int32_t KeyEvent::KEYCODE_DPAD_DOWN = OHOS::MMI::KeyEvent::KEYCODE_DPAD_DOWN; 34 const int32_t KeyEvent::KEYCODE_DPAD_LEFT = OHOS::MMI::KeyEvent::KEYCODE_DPAD_LEFT; 35 const int32_t KeyEvent::KEYCODE_DPAD_RIGHT = OHOS::MMI::KeyEvent::KEYCODE_DPAD_RIGHT; 36 const int32_t KeyEvent::KEYCODE_A = OHOS::MMI::KeyEvent::KEYCODE_A; 37 const int32_t KeyEvent::KEYCODE_B = OHOS::MMI::KeyEvent::KEYCODE_B; 38 const int32_t KeyEvent::KEYCODE_C = OHOS::MMI::KeyEvent::KEYCODE_C; 39 const int32_t KeyEvent::KEYCODE_D = OHOS::MMI::KeyEvent::KEYCODE_D; 40 const int32_t KeyEvent::KEYCODE_E = OHOS::MMI::KeyEvent::KEYCODE_E; 41 const int32_t KeyEvent::KEYCODE_F = OHOS::MMI::KeyEvent::KEYCODE_F; 42 const int32_t KeyEvent::KEYCODE_G = OHOS::MMI::KeyEvent::KEYCODE_G; 43 const int32_t KeyEvent::KEYCODE_H = OHOS::MMI::KeyEvent::KEYCODE_H; 44 const int32_t KeyEvent::KEYCODE_I = OHOS::MMI::KeyEvent::KEYCODE_I; 45 const int32_t KeyEvent::KEYCODE_J = OHOS::MMI::KeyEvent::KEYCODE_J; 46 const int32_t KeyEvent::KEYCODE_K = OHOS::MMI::KeyEvent::KEYCODE_K; 47 const int32_t KeyEvent::KEYCODE_L = OHOS::MMI::KeyEvent::KEYCODE_L; 48 const int32_t KeyEvent::KEYCODE_M = OHOS::MMI::KeyEvent::KEYCODE_M; 49 const int32_t KeyEvent::KEYCODE_N = OHOS::MMI::KeyEvent::KEYCODE_N; 50 const int32_t KeyEvent::KEYCODE_O = OHOS::MMI::KeyEvent::KEYCODE_O; 51 const int32_t KeyEvent::KEYCODE_P = OHOS::MMI::KeyEvent::KEYCODE_P; 52 const int32_t KeyEvent::KEYCODE_Q = OHOS::MMI::KeyEvent::KEYCODE_Q; 53 const int32_t KeyEvent::KEYCODE_R = OHOS::MMI::KeyEvent::KEYCODE_R; 54 const int32_t KeyEvent::KEYCODE_S = OHOS::MMI::KeyEvent::KEYCODE_S; 55 const int32_t KeyEvent::KEYCODE_T = OHOS::MMI::KeyEvent::KEYCODE_T; 56 const int32_t KeyEvent::KEYCODE_U = OHOS::MMI::KeyEvent::KEYCODE_U; 57 const int32_t KeyEvent::KEYCODE_V = OHOS::MMI::KeyEvent::KEYCODE_V; 58 const int32_t KeyEvent::KEYCODE_W = OHOS::MMI::KeyEvent::KEYCODE_W; 59 const int32_t KeyEvent::KEYCODE_X = OHOS::MMI::KeyEvent::KEYCODE_X; 60 const int32_t KeyEvent::KEYCODE_Y = OHOS::MMI::KeyEvent::KEYCODE_Y; 61 const int32_t KeyEvent::KEYCODE_Z = OHOS::MMI::KeyEvent::KEYCODE_Z; 62 const int32_t KeyEvent::KEYCODE_COMMA = OHOS::MMI::KeyEvent::KEYCODE_COMMA; 63 const int32_t KeyEvent::KEYCODE_PERIOD = OHOS::MMI::KeyEvent::KEYCODE_PERIOD; 64 const int32_t KeyEvent::KEYCODE_ALT_LEFT = OHOS::MMI::KeyEvent::KEYCODE_ALT_LEFT; 65 const int32_t KeyEvent::KEYCODE_ALT_RIGHT = OHOS::MMI::KeyEvent::KEYCODE_ALT_RIGHT; 66 const int32_t KeyEvent::KEYCODE_SHIFT_LEFT = OHOS::MMI::KeyEvent::KEYCODE_SHIFT_LEFT; 67 const int32_t KeyEvent::KEYCODE_SHIFT_RIGHT = OHOS::MMI::KeyEvent::KEYCODE_SHIFT_RIGHT; 68 const int32_t KeyEvent::KEYCODE_TAB = OHOS::MMI::KeyEvent::KEYCODE_TAB; 69 const int32_t KeyEvent::KEYCODE_SPACE = OHOS::MMI::KeyEvent::KEYCODE_SPACE; 70 const int32_t KeyEvent::KEYCODE_ENTER = OHOS::MMI::KeyEvent::KEYCODE_ENTER; 71 const int32_t KeyEvent::KEYCODE_DEL = OHOS::MMI::KeyEvent::KEYCODE_DEL; 72 const int32_t KeyEvent::KEYCODE_GRAVE = OHOS::MMI::KeyEvent::KEYCODE_GRAVE; 73 const int32_t KeyEvent::KEYCODE_MINUS = OHOS::MMI::KeyEvent::KEYCODE_MINUS; 74 const int32_t KeyEvent::KEYCODE_EQUALS = OHOS::MMI::KeyEvent::KEYCODE_EQUALS; 75 const int32_t KeyEvent::KEYCODE_LEFT_BRACKET = OHOS::MMI::KeyEvent::KEYCODE_LEFT_BRACKET; 76 const int32_t KeyEvent::KEYCODE_RIGHT_BRACKET = OHOS::MMI::KeyEvent::KEYCODE_RIGHT_BRACKET; 77 const int32_t KeyEvent::KEYCODE_BACKSLASH = OHOS::MMI::KeyEvent::KEYCODE_BACKSLASH; 78 const int32_t KeyEvent::KEYCODE_SEMICOLON = OHOS::MMI::KeyEvent::KEYCODE_SEMICOLON; 79 const int32_t KeyEvent::KEYCODE_APOSTROPHE = OHOS::MMI::KeyEvent::KEYCODE_APOSTROPHE; 80 const int32_t KeyEvent::KEYCODE_SLASH = OHOS::MMI::KeyEvent::KEYCODE_SLASH; 81 const int32_t KeyEvent::KEYCODE_PAGE_UP = OHOS::MMI::KeyEvent::KEYCODE_PAGE_UP; 82 const int32_t KeyEvent::KEYCODE_PAGE_DOWN = OHOS::MMI::KeyEvent::KEYCODE_PAGE_DOWN; 83 const int32_t KeyEvent::KEYCODE_ESCAPE = OHOS::MMI::KeyEvent::KEYCODE_ESCAPE; 84 const int32_t KeyEvent::KEYCODE_FORWARD_DEL = OHOS::MMI::KeyEvent::KEYCODE_FORWARD_DEL; 85 const int32_t KeyEvent::KEYCODE_CTRL_LEFT = OHOS::MMI::KeyEvent::KEYCODE_CTRL_LEFT; 86 const int32_t KeyEvent::KEYCODE_CTRL_RIGHT = OHOS::MMI::KeyEvent::KEYCODE_CTRL_RIGHT; 87 const int32_t KeyEvent::KEYCODE_CAPS_LOCK = OHOS::MMI::KeyEvent::KEYCODE_CAPS_LOCK; 88 const int32_t KeyEvent::KEYCODE_SCROLL_LOCK = OHOS::MMI::KeyEvent::KEYCODE_SCROLL_LOCK; 89 const int32_t KeyEvent::KEYCODE_META_LEFT = OHOS::MMI::KeyEvent::KEYCODE_META_LEFT; 90 const int32_t KeyEvent::KEYCODE_META_RIGHT = OHOS::MMI::KeyEvent::KEYCODE_META_RIGHT; 91 const int32_t KeyEvent::KEYCODE_SYSRQ = OHOS::MMI::KeyEvent::KEYCODE_SYSRQ; 92 const int32_t KeyEvent::KEYCODE_BREAK = OHOS::MMI::KeyEvent::KEYCODE_BREAK; 93 const int32_t KeyEvent::KEYCODE_MOVE_HOME = OHOS::MMI::KeyEvent::KEYCODE_MOVE_HOME; 94 const int32_t KeyEvent::KEYCODE_MOVE_END = OHOS::MMI::KeyEvent::KEYCODE_MOVE_END; 95 const int32_t KeyEvent::KEYCODE_INSERT = OHOS::MMI::KeyEvent::KEYCODE_INSERT; 96 const int32_t KeyEvent::KEYCODE_F1 = OHOS::MMI::KeyEvent::KEYCODE_F1; 97 const int32_t KeyEvent::KEYCODE_F2 = OHOS::MMI::KeyEvent::KEYCODE_F2; 98 const int32_t KeyEvent::KEYCODE_F3 = OHOS::MMI::KeyEvent::KEYCODE_F3; 99 const int32_t KeyEvent::KEYCODE_F4 = OHOS::MMI::KeyEvent::KEYCODE_F4; 100 const int32_t KeyEvent::KEYCODE_F5 = OHOS::MMI::KeyEvent::KEYCODE_F5; 101 const int32_t KeyEvent::KEYCODE_F6 = OHOS::MMI::KeyEvent::KEYCODE_F6; 102 const int32_t KeyEvent::KEYCODE_F7 = OHOS::MMI::KeyEvent::KEYCODE_F7; 103 const int32_t KeyEvent::KEYCODE_F8 = OHOS::MMI::KeyEvent::KEYCODE_F8; 104 const int32_t KeyEvent::KEYCODE_F9 = OHOS::MMI::KeyEvent::KEYCODE_F9; 105 const int32_t KeyEvent::KEYCODE_F10 = OHOS::MMI::KeyEvent::KEYCODE_F10; 106 const int32_t KeyEvent::KEYCODE_F11 = OHOS::MMI::KeyEvent::KEYCODE_F11; 107 const int32_t KeyEvent::KEYCODE_F12 = OHOS::MMI::KeyEvent::KEYCODE_F12; 108 const int32_t KeyEvent::KEYCODE_NUM_LOCK = OHOS::MMI::KeyEvent::KEYCODE_NUM_LOCK; 109 const int32_t KeyEvent::KEYCODE_NUMPAD_0 = OHOS::MMI::KeyEvent::KEYCODE_NUMPAD_0; 110 const int32_t KeyEvent::KEYCODE_NUMPAD_1 = OHOS::MMI::KeyEvent::KEYCODE_NUMPAD_1; 111 const int32_t KeyEvent::KEYCODE_NUMPAD_2 = OHOS::MMI::KeyEvent::KEYCODE_NUMPAD_2; 112 const int32_t KeyEvent::KEYCODE_NUMPAD_3 = OHOS::MMI::KeyEvent::KEYCODE_NUMPAD_3; 113 const int32_t KeyEvent::KEYCODE_NUMPAD_4 = OHOS::MMI::KeyEvent::KEYCODE_NUMPAD_4; 114 const int32_t KeyEvent::KEYCODE_NUMPAD_5 = OHOS::MMI::KeyEvent::KEYCODE_NUMPAD_5; 115 const int32_t KeyEvent::KEYCODE_NUMPAD_6 = OHOS::MMI::KeyEvent::KEYCODE_NUMPAD_6; 116 const int32_t KeyEvent::KEYCODE_NUMPAD_7 = OHOS::MMI::KeyEvent::KEYCODE_NUMPAD_7; 117 const int32_t KeyEvent::KEYCODE_NUMPAD_8 = OHOS::MMI::KeyEvent::KEYCODE_NUMPAD_8; 118 const int32_t KeyEvent::KEYCODE_NUMPAD_9 = OHOS::MMI::KeyEvent::KEYCODE_NUMPAD_9; 119 const int32_t KeyEvent::KEYCODE_NUMPAD_DIVIDE = OHOS::MMI::KeyEvent::KEYCODE_NUMPAD_DIVIDE; 120 const int32_t KeyEvent::KEYCODE_NUMPAD_MULTIPLY = OHOS::MMI::KeyEvent::KEYCODE_NUMPAD_MULTIPLY; 121 const int32_t KeyEvent::KEYCODE_NUMPAD_SUBTRACT = OHOS::MMI::KeyEvent::KEYCODE_NUMPAD_SUBTRACT; 122 const int32_t KeyEvent::KEYCODE_NUMPAD_ADD = OHOS::MMI::KeyEvent::KEYCODE_NUMPAD_ADD; 123 const int32_t KeyEvent::KEYCODE_NUMPAD_DOT = OHOS::MMI::KeyEvent::KEYCODE_NUMPAD_DOT; 124 const int32_t KeyEvent::KEYCODE_NUMPAD_ENTER = OHOS::MMI::KeyEvent::KEYCODE_NUMPAD_ENTER; 125 } // namespace MMIAdapter 126 } // namespace OHOS::NWeb 127