1/* 2 * Copyright (c) 2022 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 16export const Action = { 17 CANCEL: 0, 18 MOVE: 1, 19 BUTTON_DOWN: 2, 20 BUTTON_UP: 3, 21 AXIS_BEGIN: 4, 22 AXIS_UPDATE: 5, 23 AXIS_END: 6, 24} 25 26export const Button = { 27 LEFT: 0, 28 MIDDLE: 1, 29 RIGHT: 2, 30 SIDE: 3, 31 EXTRA: 4, 32 FORWARD: 5, 33 BACK: 6, 34 TASK: 7, 35} 36 37export const Axis = { 38 SCROLL_VERTICAL: 0, 39 SCROLL_HORIZONTAL: 1, 40 PINCH: 2, 41} 42 43export function mockMouseEvent() { 44 const AxisValue = { 45 axis: '[PC preview] unknow axis', 46 value: '[PC preview] unknow value', 47 } 48 const MouseEvent = { 49 action: '[PC preview] unknow action', 50 screenX: '[PC preview] unknow screenX', 51 screenY: '[PC preview] unknow screenY', 52 windowX: '[PC preview] unknow windowX', 53 windowY: '[PC preview] unknow windowY', 54 rawDeltaX: '[PC preview] unknow rawDeltaX', 55 rawDeltaY: '[PC preview] unknow rawDeltaY', 56 button: '[PC preview] unknow button', 57 pressedButtons: ['[PC preview] unknow pressedButtons'], 58 axes: ['[PC preview] unknow axes'], 59 pressedKeys: ['[PC preview] unknow pressedKeys'], 60 ctrlKey: '[PC preview] unknow ctrlKey', 61 altKey: '[PC preview] unknow altKey', 62 shiftKey: '[PC preview] unknow shiftKey', 63 logoKey: '[PC preview] unknow logoKey', 64 fnKey: '[PC preview] unknow fnKey', 65 capsLock: '[PC preview] unknow capsLock', 66 numLock: '[PC preview] unknow numLock', 67 scrollLock: '[PC preview] unknow scrollLock', 68 } 69 const mouseEvent = { 70 Action, 71 Button, 72 Axis, 73 } 74 return mouseEvent; 75}