diff --git a/api/@ohos.multimodalInput.axisEvent.d.ts b/api/@ohos.multimodalInput.axisEvent.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ba6df294c0de21c411a20bbda55fb2d7c3158269 --- /dev/null +++ b/api/@ohos.multimodalInput.axisEvent.d.ts @@ -0,0 +1,152 @@ +/* +* Copyright (c) 2022 Huawei Device Co., Ltd. +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +import { InputEvent } from "./@ohos.multimodalInput.inputEvent" +import { KeyCode } from "./@ohos.multimodalInput.keyCode" + +/** +* Action +* +* @since 9 +* @syscap SystemCapability.MultimodalInput.Input.Core +* @import import {Action} from '@ohos.multimodalInput.mouseEvent'; +*/ +export declare enum Action { + /** + * cancel + */ + CANCEL = 0, + + /** + * axis begin + */ + AXIS_BEGIN = 4, + + /** + * axis update + */ + AXIS_UPDATE = 5, + + /** + * axis end + */ + AXIS_END = 6, +} + +/** +* Axis +* +* @since 9 +* @syscap SystemCapability.MultimodalInput.Input.Core +* @import import {Axis} from '@ohos.multimodalInput.mouseEvent'; +*/ +export declare enum Axis { + /** + * scroll vertical + */ + SCROLL_VERTICAL = 0, + + /** + * scroll horizontal + */ + SCROLL_HORIZONTAL = 1, + + /** + * pinch + */ + PINCH = 2, +} + +/** +* AxisValue +* +* @since 9 +* @syscap SystemCapability.MultimodalInput.Input.Core +* @import import {AxisValue} from '@ohos.multimodalInput.mouseEvent'; +*/ +export declare interface AxisValue { + /** + * axis + */ + axis: Axis; + + /** + * value + */ + value: number +} + +/** +* MouseEvent +* +* @since 9 +* @syscap SystemCapability.MultimodalInput.Input.Core +* @import import {MouseEvent} from '@ohos.multimodalInput.mouseEvent'; +*/ +export declare interface MouseEvent extends InputEvent { + /** + * mouse action + */ + action: Action; + + /** + * axes data + */ + axes: AxisValue[]; + + /** + * List of keys that are currently in the pressed state. + */ + pressedKeys: KeyCode[]; + + /** + * whether ctrlKey is in pressed state. + */ + readonly ctrlKey: boolean; + + /** + * whether altKey is in pressed state. + */ + readonly altKey: boolean; + + /** + * whether shiftKey is in pressed state. + */ + readonly shiftKey: boolean; + + /** + * whether logoKey is in pressed state. + */ + readonly logoKey: boolean; + + /** + * whether fnKey is in pressed state. + */ + readonly fnKey: boolean; + + /** + * whether capsLock is in the active state. + */ + capsLock: boolean; + + /** + * whether numLock is in the active state. + */ + numLock: boolean; + + /** + * whether scrollLock is in the active state. + */ + scrollLock: boolean; +} \ No newline at end of file diff --git a/api/@ohos.multimodalInput.distributedInput.d.ts b/api/@ohos.multimodalInput.distributedInput.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f526134bc76624015e04414c429a811d50911c85 --- /dev/null +++ b/api/@ohos.multimodalInput.distributedInput.d.ts @@ -0,0 +1,104 @@ +/* +* Copyright (c) 2022 Huawei Device Co., Ltd. +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS; +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +import { AsyncCallback } from "./basic"; + +/** + * Distributed input management module for interface calls with distributed capabilities. + * + * @since 9 + * @syscap SystemCapability.MultimodalInput.Input.RemoteInputDevice + * @import import distributedInput from '@ohos.multimodalInput.distributedInput', + */ +declare namespace distributedInput { + enum InputSource { + /** + * mouse + */ + MOUSE = 0, + + /** + * keyboard + */ + KEYBOARD = 1, + + /** + * touch screen + */ + TOUCH_SCREEN = 2, + + /** + * touch pad + */ + TOUCH_PAD = 3, + } + + /** + * Example Query the input capability of a distributed device. + * + * @since 9 + * @syscap SystemCapability.MultimodalInput.Input.RemoteInputDevice + * @param deviceId Represents the ID of the device that queries the distributed input capability. + * @return - + */ + function getRemoteInputAbility(deviceId: number, callback: AsyncCallback>): void; + function getRemoteInputAbility(deviceId: number): Promise>; + + /** + * Prepare for distribution. + * + * @since 9 + * @syscap SystemCapability.MultimodalInput.Input.RemoteInputDevice + * @param deviceId Indicates the ID of the device to be distributed. + * @return - + */ + function prepareRemoteInput(deviceId: number, callback: AsyncCallback): void; + function prepareRemoteInput(deviceId: number): Promise; + + /** + * Cancel ready distributed. + * + * @since 9 + * @syscap SystemCapability.MultimodalInput.Input.RemoteInputDevice + * @param deviceId Indicates the ID of the device to be distributed. + * @return - + */ + function unprepareRemoteInput(deviceId: number, callback: AsyncCallback): void; + function unprepareRemoteInput(deviceId: number): Promise; + + /** + * Start distributed. + * + * @since 9 + * @syscap SystemCapability.MultimodalInput.Input.RemoteInputDevice + * @param deviceId Represents the ID of the device that started the distribution. + * @return - + */ + function startRemoteInput(deviceId: number, inputSources: Array, callback: AsyncCallback): void; + function startRemoteInput(deviceId: number, inputSources: Array): Promise; + + /** + * Stop distribution. + * + * @since 9 + * @syscap SystemCapability.MultimodalInput.Input.RemoteInputDevice + * @param deviceId Indicates the ID of the device that stopped distribution. + * @return - + */ + function stopRemoteInput(deviceId: number, inputSources: Array, callback: AsyncCallback): void; + function stopRemoteInput(deviceId: number, inputSources: Array): Promise; +} + +export default distributedInput; \ No newline at end of file diff --git a/api/@ohos.multimodalInput.inputDevice.d.ts b/api/@ohos.multimodalInput.inputDevice.d.ts index 8823d8574ef80dbe1081bb981aec62000879d8c2..b16a830ab450175affeab2eb2b3652c1ebca9fb8 100644 --- a/api/@ohos.multimodalInput.inputDevice.d.ts +++ b/api/@ohos.multimodalInput.inputDevice.d.ts @@ -1,5 +1,5 @@ /* -* Copyright (C) 2021 Huawei Device Co., Ltd. +* Copyright (c) 2021-2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,73 +13,282 @@ * limitations under the License. */ -import { AsyncCallback } from './basic'; +import { Callback, AsyncCallback } from "./basic"; +import { KeyCode } from "./@ohos.multimodalInput.keyCode" - /** - * The input device management module is configured to obtain an ID and device information of an input device. - * - * @since 8 - * @syscap SystemCapability.MultimodalInput.Input.InputDevice - * @import import inputDevice from '@ohos.multimodalInput.inputDevice'; - */ +/** +* The input device management module is configured to obtain an ID and device information of an input device. +* +* @since 8 +* @syscap SystemCapability.MultimodalInput.Input.InputDevice +* @import import inputDevice from '@ohos.multimodalInput.inputDevice'; +*/ declare namespace inputDevice { - type SourceType = 'keyboard' | 'mouse' | 'touchpad' | 'touchscreen' | 'joystick' | 'trackball'; - - type AxisType = 'NULL'; - - /** - * Defines axis information about events that can be reported by an input device. - * For example, a touchscreen may report information such as x, y, and pressure, - * which indicate the x-axis coordinate, y-axis coordinate, and pressure, respectively. - * - * @syscap SystemCapability.MultimodalInput.Input.InputDevice - * @param source Input source type of the axis. For example, if a mouse reports an x-axis event, the source of the x-axis is the mouse. - * @param axis Type of the axis. for example, the x-axis, y-axis, and pressure axis. - * @param max Maximum value of the data reported on this axis. - * @param min Minimum value of the data reported on this axis. - */ - interface AxisRange { - source: SourceType; - axis : AxisType; - max : number; - min: number; - } + type ChangedType = 'add' | 'remove'; + + type SourceType = 'keyboard' | 'mouse' | 'touchpad' | 'touchscreen' | 'joystick' | 'trackball'; + + /** + * @since 9 + */ + type AxisType = 'touchMajor' | 'touchMinor' | 'orientation' | 'x' | 'y' | 'pressure' | 'toolMinor' | 'touchMajor' | 'NULL'; + enum KeyboardType { /** - * Defines the information about an input device. - * - * @syscap SystemCapability.MultimodalInput.Input.InputDevice - * @param name Name of the input device. - * @param sources Source type supported by the input device. For example, if a keyboard is attached with a touchpad, the device has two input sources: keyboard and touchpad. + * none */ - interface InputDeviceData { - id: number; - name: string; - sources : Array; - axisRanges : Array; + NONE = 0, + + /** + * unknown + */ + UNKNOWN = 1, + + /** + * alphabetic keyboard + */ + ALPHABETIC_KEYBOARD = 2, + + /** + * digital keyboard + */ + DIGITAL_KEYBOARD = 3, + + /** + * handwriting pen + */ + HANDWRITING_PEN = 4, + + /** + * remote control + */ + REMOTE_CONTROL = 5, } + /** + * Defines the listener for input device events. + * + * @syscap SystemCapability.MultimodalInput.Input.InputDevice + * @param type Type of the input device event. The options are add and remove. + * @param deviceId ID of the input device for the reported input device event. + */ + interface DeviceListener { + type: ChangedType; + deviceId: number; + } + + /** + * Starts listening for an input device event. + * + * @since 9 + * @syscap SystemCapability.MultimodalInput.Input.InputDevice + * @param type Type of the input device event, which is **change**. + * @return Callback for the input device event. + */ + function on(type: "change", listener: Callback): void; + + /** + * Stops listening for an input device event. + * + * @since 9 + * @syscap SystemCapability.MultimodalInput.Input.InputDevice + * @param type Type of the input device event, which is **change**. + * @return Callback for the input device event. + */ + function off(type: "change", listener?: Callback): void; + + /** + * Defines axis information about events that can be reported by an input device. + * For example, a touchscreen may report information such as x, y, and pressure, + * which indicate the x-axis coordinate, y-axis coordinate, and pressure, respectively. + * + * @syscap SystemCapability.MultimodalInput.Input.InputDevice + * @param source Input source type of the axis. For example, if a mouse reports an x-axis event, the source of the x-axis is the mouse. + * @param axis Type of the axis. for example, the x-axis, y-axis, and pressure axis. + * @param max Maximum value of the data reported on this axis. + * @param min Minimum value of the data reported on this axis. + * @param fuzz fuzz value of the data reported on this axis. + * @param flat flat value of the data reported on this axis. + * @param resolution resolution value of the data reported on this axis. + */ + interface AxisRange { + /** + * @since 8 + */ + source: SourceType; + + /** + * @since 8 + */ + axis: AxisType; + + /** + * @since 8 + */ + max: number; + + /** + * @since 8 + */ + min: number; + + /** + * @since 9 + */ + fuzz: number; + + /** + * @since 9 + */ + flat: number; + + /** + * @since 9 + */ + resolution: number; + } + + /** + * Defines the information about an input device. + * + * @syscap SystemCapability.MultimodalInput.Input.InputDevice + * @param name Name of the input device. + * @param sources Source type supported by the input device. For example, if a keyboard is attached with a touchpad, the device has two input sources: keyboard and touchpad. + * @param axisRanges + * @param bus bus + * @param product product + * @param vendor vendor + * @param version version + * @param phys physical path + * @param uniq unique identifier + */ + interface InputDeviceData { /** - * Obtains the IDs of all input devices. - * * @since 8 - * @syscap SystemCapability.MultimodalInput.Input.InputDevice - * @param callback callback function, receive reported data */ - function getDeviceIds(callback: AsyncCallback>): void; - function getDeviceIds(): Promise>; + id: number; /** - * Obtain the information about an input device. - * * @since 8 - * @syscap SystemCapability.MultimodalInput.Input.InputDevice - * @param deviceId ID of the input device whose information is to be obtained. - * @param callback callback function, receive reported data */ - function getDevice(deviceId: number, callback: AsyncCallback): void; - function getDevice(deviceId: number): Promise; + name: string; + + /** + * @since 8 + */ + sources: Array; + + /** + * @since 8 + */ + axisRanges: Array; + + /** + * @since 9 + */ + bus: number; + + /** + * @since 9 + */ + product: number; + + /** + * @since 9 + */ + vendor: number; + + /** + * @since 9 + */ + version: number; + + /** + * @since 9 + */ + phys: string; + + /** + * @since 9 + */ + uniq: string; + } + + /** + * Obtains the IDs of all input devices. + * + * @since 8 + * @syscap SystemCapability.MultimodalInput.Input.InputDevice + * @param callback callback function, receive reported data + */ + function getDeviceIds(callback: AsyncCallback>): void; + function getDeviceIds(): Promise>; + + /** + * Obtain the information about an input device. + * + * @since 8 + * @syscap SystemCapability.MultimodalInput.Input.InputDevice + * @param deviceId ID of the input device whose information is to be obtained. + * @param callback callback function, receive reported data + */ + function getDevice(deviceId: number, callback: AsyncCallback): void; + function getDevice(deviceId: number): Promise; + + /** + * Checks whether the specified key codes of an input device are supported. + * + * @since 9 + * @syscap SystemCapability.MultimodalInput.Input.InputDevice + * @param deviceId ID of the input device. + * @param keys Key codes of the input device, You can query a maximum of five key codes at a time. + * @return Returns a result indicating whether the specified key codes are supported. + */ + function supportKeys(deviceId: number, keys: Array, callback: Callback>): void; + function supportKeys(deviceId: number, keys: Array): Promise>; + + /** + * Set the speed of cursor movement. + * + * @since 9 + * @syscap SystemCapability.MultimodalInput.Input.InputDevice + * @param speed Speed of cursor movement. + */ + function setPointerSpeed(speed: number, callback: AsyncCallback): void; + function setPointerSpeed(speed: number): Promise; + + /** + * Gets the cursor movement speed. + * + * @since 9 + * @syscap SystemCapability.MultimodalInput.Input.InputDevice + */ + function getPointerSpeed(callback: AsyncCallback): void; + function getPointerSpeed(): Promise; + + /** + * Query the keyboard type of the input device. + * + * @since 9 + * @syscap SystemCapability.MultimodalInput.Input.InputDevice + * @param deviceId input device id. + * @return Returns the keyboard type. + */ + function getKeyboardType(deviceId: number, callback: AsyncCallback): void; + function getKeyboardType(deviceId: number): Promise; + + /** + * Mouse position setting. + * + * @since 9 + * @syscap SystemCapability.MultimodalInput.Input.RemoteInputDevice + * @param x x coordinate + * @param y y coordinate + * @return - + */ + function setPointerLocation(x: number, y: number, callback: AsyncCallback): void; + function setPointerLocation(x: number, y: number): Promise; } export default inputDevice; \ No newline at end of file diff --git a/api/@ohos.multimodalInput.inputEvent.d.ts b/api/@ohos.multimodalInput.inputEvent.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d00e3677c9376d14fa81e15c841529ec8b6fd625 --- /dev/null +++ b/api/@ohos.multimodalInput.inputEvent.d.ts @@ -0,0 +1,49 @@ +/* +* Copyright (c) 2022 Huawei Device Co., Ltd. +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +/** +* InputEvent +* +* @since 9 +* @syscap SystemCapability.MultimodalInput.Input.Core +* @import import InputEvent from '@ohos.multimodalInput.inputEvent'; +*/ + +export declare interface InputEvent { + /** + * Event ID, generated on the server and globally unique. + */ + id: number; + + /** + * Id of the device that reports the input event. The value is an integer and is greater than or equal to 0. + */ + deviceId: number; + + /** + * Time of event. + */ + actionTime: number; + + /** + * Target screen ID, integer number, valid if the value is >=0 + */ + screenId: number; + + /** + * Target window ID, integer number, valid value >=0 + */ + windowId: number; +} \ No newline at end of file diff --git a/api/@ohos.multimodalInput.inputMonitor.d.ts b/api/@ohos.multimodalInput.inputMonitor.d.ts index a2139c9e504583556a021adc7e9bc4f8827507b8..1e8af33d908fdf15248bfe84ac8784187043a052 100644 --- a/api/@ohos.multimodalInput.inputMonitor.d.ts +++ b/api/@ohos.multimodalInput.inputMonitor.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2021-2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/api/@ohos.multimodalInput.keyCode.d.ts b/api/@ohos.multimodalInput.keyCode.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..7da279b403296627084bee2500c29478cabc7f5e --- /dev/null +++ b/api/@ohos.multimodalInput.keyCode.d.ts @@ -0,0 +1,355 @@ +/* +* Copyright (c) 2022 Huawei Device Co., Ltd. +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS; +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +/** +* KeyCode +* +* @since 9 +* @syscap SystemCapability.MultimodalInput.Input.Core +* @import import {KeyCode} from '@ohos.multimodalInput.keyCode', +*/ + +export declare enum KeyCode { + KEYCODE_FN = 0, + KEYCODE_UNKNOWN = -1, + KEYCODE_HOME = 1, + KEYCODE_BACK = 2, + KEYCODE_MEDIA_PLAY_PAUSE = 10, + KEYCODE_MEDIA_STOP = 11, + KEYCODE_MEDIA_NEXT = 12, + KEYCODE_MEDIA_PREVIOUS = 13, + KEYCODE_MEDIA_REWIND = 14, + KEYCODE_MEDIA_FAST_FORWARD = 15, + KEYCODE_VOLUME_UP = 16, + KEYCODE_VOLUME_DOWN = 17, + KEYCODE_POWER = 18, + KEYCODE_CAMERA = 19, + KEYCODE_VOLUME_MUTE = 22, + KEYCODE_MUTE = 23, + KEYCODE_BRIGHTNESS_UP = 40, + KEYCODE_BRIGHTNESS_DOWN = 41, + KEYCODE_0 = 2000, + KEYCODE_1 = 2001, + KEYCODE_2 = 2002, + KEYCODE_3 = 2003, + KEYCODE_4 = 2004, + KEYCODE_5 = 2005, + KEYCODE_6 = 2006, + KEYCODE_7 = 2007, + KEYCODE_8 = 2008, + KEYCODE_9 = 2009, + KEYCODE_STAR = 2010, + KEYCODE_POUND = 2011, + KEYCODE_DPAD_UP = 2012, + KEYCODE_DPAD_DOWN = 2013, + KEYCODE_DPAD_LEFT = 2014, + KEYCODE_DPAD_RIGHT = 2015, + KEYCODE_DPAD_CENTER = 2016, + KEYCODE_A = 2017, + KEYCODE_B = 2018, + KEYCODE_C = 2019, + KEYCODE_D = 2020, + KEYCODE_E = 2021, + KEYCODE_F = 2022, + KEYCODE_G = 2023, + KEYCODE_H = 2024, + KEYCODE_I = 2025, + KEYCODE_J = 2026, + KEYCODE_K = 2027, + KEYCODE_L = 2028, + KEYCODE_M = 2029, + KEYCODE_N = 2030, + KEYCODE_O = 2031, + KEYCODE_P = 2032, + KEYCODE_Q = 2033, + KEYCODE_R = 2034, + KEYCODE_S = 2035, + KEYCODE_T = 2036, + KEYCODE_U = 2037, + KEYCODE_V = 2038, + KEYCODE_W = 2039, + KEYCODE_X = 2040, + KEYCODE_Y = 2041, + KEYCODE_Z = 2042, + KEYCODE_COMMA = 2043, + KEYCODE_PERIOD = 2044, + KEYCODE_ALT_LEFT = 2045, + KEYCODE_ALT_RIGHT = 2046, + KEYCODE_SHIFT_LEFT = 2047, + KEYCODE_SHIFT_RIGHT = 2048, + KEYCODE_TAB = 2049, + KEYCODE_SPACE = 2050, + KEYCODE_SYM = 2051, + KEYCODE_EXPLORER = 2052, + KEYCODE_ENVELOPE = 2053, + KEYCODE_ENTER = 2054, + KEYCODE_DEL = 2055, + KEYCODE_GRAVE = 2056, + KEYCODE_MINUS = 2057, + KEYCODE_EQUALS = 2058, + KEYCODE_LEFT_BRACKET = 2059, + KEYCODE_RIGHT_BRACKET = 2060, + KEYCODE_BACKSLASH = 2061, + KEYCODE_SEMICOLON = 2062, + KEYCODE_APOSTROPHE = 2063, + KEYCODE_SLASH = 2064, + KEYCODE_AT = 2065, + KEYCODE_PLUS = 2066, + KEYCODE_MENU = 2067, + KEYCODE_PAGE_UP = 2068, + KEYCODE_PAGE_DOWN = 2069, + KEYCODE_ESCAPE = 2070, + KEYCODE_FORWARD_DEL = 2071, + KEYCODE_CTRL_LEFT = 2072, + KEYCODE_CTRL_RIGHT = 2073, + KEYCODE_CAPS_LOCK = 2074, + KEYCODE_SCROLL_LOCK = 2075, + KEYCODE_META_LEFT = 2076, + KEYCODE_META_RIGHT = 2077, + KEYCODE_FUNCTION = 2078, + KEYCODE_SYSRQ = 2079, + KEYCODE_BREAK = 2080, + KEYCODE_MOVE_HOME = 2081, + KEYCODE_MOVE_END = 2082, + KEYCODE_INSERT = 2083, + KEYCODE_FORWARD = 2084, + KEYCODE_MEDIA_PLAY = 2085, + KEYCODE_MEDIA_PAUSE = 2086, + KEYCODE_MEDIA_CLOSE = 2087, + KEYCODE_MEDIA_EJECT = 2088, + KEYCODE_MEDIA_RECORD = 2089, + KEYCODE_F1 = 2090, + KEYCODE_F2 = 2091, + KEYCODE_F3 = 2092, + KEYCODE_F4 = 2093, + KEYCODE_F5 = 2094, + KEYCODE_F6 = 2095, + KEYCODE_F7 = 2096, + KEYCODE_F8 = 2097, + KEYCODE_F9 = 2098, + KEYCODE_F10 = 2099, + KEYCODE_F11 = 2100, + KEYCODE_F12 = 2101, + KEYCODE_NUM_LOCK = 2102, + KEYCODE_NUMPAD_0 = 2103, + KEYCODE_NUMPAD_1 = 2104, + KEYCODE_NUMPAD_2 = 2105, + KEYCODE_NUMPAD_3 = 2106, + KEYCODE_NUMPAD_4 = 2107, + KEYCODE_NUMPAD_5 = 2108, + KEYCODE_NUMPAD_6 = 2109, + KEYCODE_NUMPAD_7 = 2110, + KEYCODE_NUMPAD_8 = 2111, + KEYCODE_NUMPAD_9 = 2112, + KEYCODE_NUMPAD_DIVIDE = 2113, + KEYCODE_NUMPAD_MULTIPLY = 2114, + KEYCODE_NUMPAD_SUBTRACT = 2115, + KEYCODE_NUMPAD_ADD = 2116, + KEYCODE_NUMPAD_DOT = 2117, + KEYCODE_NUMPAD_COMMA = 2118, + KEYCODE_NUMPAD_ENTER = 2119, + KEYCODE_NUMPAD_EQUALS = 2120, + KEYCODE_NUMPAD_LEFT_PAREN = 2121, + KEYCODE_NUMPAD_RIGHT_PAREN = 2122, + KEYCODE_VIRTUAL_MULTITASK = 2210, + KEYCODE_SLEEP = 2600, + KEYCODE_ZENKAKU_HANKAKU = 2601, + KEYCODE_102ND = 2602, + KEYCODE_RO = 2603, + KEYCODE_KATAKANA = 2604, + KEYCODE_HIRAGANA = 2605, + KEYCODE_HENKAN = 2606, + KEYCODE_KATAKANA_HIRAGANA = 2607, + KEYCODE_MUHENKAN = 2608, + KEYCODE_LINEFEED = 2609, + KEYCODE_MACRO = 2610, + KEYCODE_NUMPAD_PLUSMINUS = 2611, + KEYCODE_SCALE = 2612, + KEYCODE_HANGUEL = 2613, + KEYCODE_HANJA = 2614, + KEYCODE_YEN = 2615, + KEYCODE_STOP = 2616, + KEYCODE_AGAIN = 2617, + KEYCODE_PROPS = 2618, + KEYCODE_UNDO = 2619, + KEYCODE_COPY = 2620, + KEYCODE_OPEN = 2621, + KEYCODE_PASTE = 2622, + KEYCODE_FIND = 2623, + KEYCODE_CUT = 2624, + KEYCODE_HELP = 2625, + KEYCODE_CALC = 2626, + KEYCODE_FILE = 2627, + KEYCODE_BOOKMARKS = 2628, + KEYCODE_NEXT = 2629, + KEYCODE_PLAYPAUSE = 2630, + KEYCODE_PREVIOUS = 2631, + KEYCODE_STOPCD = 2632, + KEYCODE_CONFIG = 2634, + KEYCODE_REFRESH = 2635, + KEYCODE_EXIT = 2636, + KEYCODE_EDIT = 2637, + KEYCODE_SCROLLUP = 2638, + KEYCODE_SCROLLDOWN = 2639, + KEYCODE_NEW = 2640, + KEYCODE_REDO = 2641, + KEYCODE_CLOSE = 2642, + KEYCODE_PLAY = 2643, + KEYCODE_BASSBOOST = 2644, + KEYCODE_PRINT = 2645, + KEYCODE_CHAT = 2646, + KEYCODE_FINANCE = 2647, + KEYCODE_CANCEL = 2648, + KEYCODE_KBDILLUM_TOGGLE = 2649, + KEYCODE_KBDILLUM_DOWN = 2650, + KEYCODE_KBDILLUM_UP = 2651, + KEYCODE_SEND = 2652, + KEYCODE_REPLY = 2653, + KEYCODE_FORWARDMAIL = 2654, + KEYCODE_SAVE = 2655, + KEYCODE_DOCUMENTS = 2656, + KEYCODE_VIDEO_NEXT = 2657, + KEYCODE_VIDEO_PREV = 2658, + KEYCODE_BRIGHTNESS_CYCLE = 2659, + KEYCODE_BRIGHTNESS_ZERO = 2660, + KEYCODE_DISPLAY_OFF = 2661, + KEYCODE_BTN_MISC = 2662, + KEYCODE_GOTO = 2663, + KEYCODE_INFO = 2664, + KEYCODE_PROGRAM = 2665, + KEYCODE_PVR = 2666, + KEYCODE_SUBTITLE = 2667, + KEYCODE_FULL_SCREEN = 2668, + KEYCODE_KEYBOARD = 2669, + KEYCODE_ASPECT_RATIO = 2670, + KEYCODE_PC = 2671, + KEYCODE_TV = 2672, + KEYCODE_TV2 = 2673, + KEYCODE_VCR = 2674, + KEYCODE_VCR2 = 2675, + KEYCODE_SAT = 2676, + KEYCODE_CD = 2677, + KEYCODE_TAPE = 2678, + KEYCODE_TUNER = 2679, + KEYCODE_PLAYER = 2680, + KEYCODE_DVD = 2681, + KEYCODE_AUDIO = 2682, + KEYCODE_VIDEO = 2683, + KEYCODE_MEMO = 2684, + KEYCODE_CALENDAR = 2685, + KEYCODE_RED = 2686, + KEYCODE_GREEN = 2687, + KEYCODE_YELLOW = 2688, + KEYCODE_BLUE = 2689, + KEYCODE_CHANNELUP = 2690, + KEYCODE_CHANNELDOWN = 2691, + KEYCODE_LAST = 2692, + KEYCODE_RESTART = 2693, + KEYCODE_SLOW = 2694, + KEYCODE_SHUFFLE = 2695, + KEYCODE_VIDEOPHONE = 2696, + KEYCODE_GAMES = 2697, + KEYCODE_ZOOMIN = 2698, + KEYCODE_ZOOMOUT = 2699, + KEYCODE_ZOOMRESET = 2700, + KEYCODE_WORDPROCESSOR = 2701, + KEYCODE_EDITOR = 2702, + KEYCODE_SPREADSHEET = 2703, + KEYCODE_GRAPHICSEDITOR = 2704, + KEYCODE_PRESENTATION = 2705, + KEYCODE_DATABASE = 2706, + KEYCODE_NEWS = 2707, + KEYCODE_VOICEMAIL = 2708, + KEYCODE_ADDRESSBOOK = 2709, + KEYCODE_MESSENGER = 2710, + KEYCODE_BRIGHTNESS_TOGGLE = 2711, + KEYCODE_SPELLCHECK = 2712, + KEYCODE_COFFEE = 2713, + KEYCODE_MEDIA_REPEAT = 2714, + KEYCODE_IMAGES = 2715, + KEYCODE_BUTTONCONFIG = 2716, + KEYCODE_TASKMANAGER = 2717, + KEYCODE_JOURNAL = 2718, + KEYCODE_CONTROLPANEL = 2719, + KEYCODE_APPSELECT = 2720, + KEYCODE_SCREENSAVER = 2721, + KEYCODE_ASSISTANT = 2722, + KEYCODE_KBD_LAYOUT_NEXT = 2723, + KEYCODE_BRIGHTNESS_MIN = 2724, + KEYCODE_BRIGHTNESS_MAX = 2725, + KEYCODE_KBDINPUTASSIST_PREV = 2726, + KEYCODE_KBDINPUTASSIST_NEXT = 2727, + KEYCODE_KBDINPUTASSIST_PREVGROUP = 2728, + KEYCODE_KBDINPUTASSIST_NEXTGROUP = 2729, + KEYCODE_KBDINPUTASSIST_ACCEPT = 2730, + KEYCODE_KBDINPUTASSIST_CANCEL = 2731, + KEYCODE_FRONT = 2800, + KEYCODE_SETUP = 2801, + KEYCODE_WAKEUP = 2802, + KEYCODE_SENDFILE = 2803, + KEYCODE_DELETEFILE = 2804, + KEYCODE_XFER = 2805, + KEYCODE_PROG1 = 2806, + KEYCODE_PROG2 = 2807, + KEYCODE_MSDOS = 2808, + KEYCODE_SCREENLOCK = 2809, + KEYCODE_DIRECTION_ROTATE_DISPLAY = 2810, + KEYCODE_CYCLEWINDOWS = 2811, + KEYCODE_COMPUTER = 2812, + KEYCODE_EJECTCLOSECD = 2813, + KEYCODE_ISO = 2814, + KEYCODE_MOVE = 2815, + KEYCODE_F13 = 2816, + KEYCODE_F14 = 2817, + KEYCODE_F15 = 2818, + KEYCODE_F16 = 2819, + KEYCODE_F17 = 2820, + KEYCODE_F18 = 2821, + KEYCODE_F19 = 2822, + KEYCODE_F20 = 2823, + KEYCODE_F21 = 2824, + KEYCODE_F22 = 2825, + KEYCODE_F23 = 2826, + KEYCODE_F24 = 2827, + KEYCODE_PROG3 = 2828, + KEYCODE_PROG4 = 2829, + KEYCODE_DASHBOARD = 2830, + KEYCODE_SUSPEND = 2831, + KEYCODE_HP = 2832, + KEYCODE_SOUND = 2833, + KEYCODE_QUESTION = 2834, + KEYCODE_CONNECT = 2836, + KEYCODE_SPORT = 2837, + KEYCODE_SHOP = 2838, + KEYCODE_ALTERASE = 2839, + KEYCODE_SWITCHVIDEOMODE = 2841, + KEYCODE_BATTERY = 2842, + KEYCODE_BLUETOOTH = 2843, + KEYCODE_WLAN = 2844, + KEYCODE_UWB = 2845, + KEYCODE_WWAN_WIMAX = 2846, + KEYCODE_RFKILL = 2847, + KEYCODE_CHANNEL = 3001, + KEYCODE_BTN_0 = 3100, + KEYCODE_BTN_1 = 3101, + KEYCODE_BTN_2 = 3102, + KEYCODE_BTN_3 = 3103, + KEYCODE_BTN_4 = 3104, + KEYCODE_BTN_5 = 3105, + KEYCODE_BTN_6 = 3106, + KEYCODE_BTN_7 = 3107, + KEYCODE_BTN_8 = 3108, + KEYCODE_BTN_9 = 3109, +} diff --git a/api/@ohos.multimodalInput.keyEvent.d.ts b/api/@ohos.multimodalInput.keyEvent.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..bb20192b67b7702b76b38c7edc17550372a633ec --- /dev/null +++ b/api/@ohos.multimodalInput.keyEvent.d.ts @@ -0,0 +1,132 @@ +/* +* Copyright (c) 2022 Huawei Device Co., Ltd. +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +import { InputEvent } from "./@ohos.multimodalInput.inputEvent" +import { KeyCode } from "./@ohos.multimodalInput.keyCode" +/** +* Action +* +* @since 9 +* @syscap SystemCapability.MultimodalInput.Input.Core +* @import import {Action} from '@ohos.multimodalInput.keyEvent'; +*/ +export declare enum Action { + /** + * cancel + */ + CANCEL = 0, + + /** + * down + */ + DOWN = 1, + + /** + * up + */ + UP = 2, +} + +/** +* Key +* +* @since 9 +* @syscap SystemCapability.MultimodalInput.Input.Core +* @import import {Key} from '@ohos.multimodalInput.mouseEvent'; +*/ +export declare interface Key { + /** + * the key code + */ + code: KeyCode; + + /** + * press the time + */ + pressedTime: number; + + /** + * button Owning device + */ + deviceId: number; +} + +/** +* KeyEvent +* +* @since 9 +* @syscap SystemCapability.MultimodalInput.Input.Core +* @import import {KeyEvent} from '@ohos.multimodalInput.mouseEvent'; +*/ +export declare interface KeyEvent extends InputEvent { + /** + * the key action + */ + action: Action; + + /** + * the keys that change this time + */ + key: Key; + + /** + * unideCode coding + */ + unicodeChar: number; + + /** + * list of keys that are currently in the pressed state + */ + keys: Key[]; + + /** + * whether ctrlKey is in down state + */ + ctrlKey: boolean; + + /** + * whether altKey is in down state + */ + altKey: boolean; + + /** + * whether shiftKey is in down state + */ + shiftKey: boolean; + + /** + * whether logoKey is in down state + */ + logoKey: boolean; + + /** + * whether fnKey is in down state + */ + fnKey: boolean; + + /** + * whether the current capsLock is activated + */ + capsLock: boolean; + + /** + * whether the current numLock is activated + */ + numLock: boolean; + + /** + * whether the current scrollLock is activated + */ + scrollLock: boolean; +} \ No newline at end of file diff --git a/api/@ohos.multimodalInput.mouseEvent.d.ts b/api/@ohos.multimodalInput.mouseEvent.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c5ee7f9963edb6ff6c8119b3b80eea7116a36203 --- /dev/null +++ b/api/@ohos.multimodalInput.mouseEvent.d.ts @@ -0,0 +1,258 @@ +/* +* Copyright (c) 2022 Huawei Device Co., Ltd. +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +import { InputEvent } from "./@ohos.multimodalInput.inputEvent" +import { KeyCode } from "./@ohos.multimodalInput.keyCode" + +/** +* Action +* +* @since 9 +* @syscap SystemCapability.MultimodalInput.Input.Core +* @import import {Action} from '@ohos.multimodalInput.mouseEvent'; +*/ +export declare enum Action { + /** + * cancel + */ + CANCEL = 0, + + /** + * mouse move + */ + MOVE = 1, + + /** + * the mouse button is down + */ + BUTTON_DOWN = 2, + + /** + * Mouse button up + */ + BUTTON_UP = 3, + + /** + * mouse associated axis event begins + */ + AXIS_BEGIN = 4, + + /** + * mouse associated axis events updated + */ + AXIS_UPDATE = 5, + + /** + * mouse associated axis event ends + */ + AXIS_END = 6, +} + +/** +* Button +* +* @since 9 +* @syscap SystemCapability.MultimodalInput.Input.Core +* @import import {Button} from '@ohos.multimodalInput.mouseEvent'; +*/ +export declare enum Button { + /** + * the left mouse button + */ + LEFT = 0, + + /** + * the middle mouse button + */ + MIDDLE = 1, + + /** + * the right mouse button + */ + RIGHT = 2, + + /** + * side mouse button + */ + SIDE = 3, + + /** + * mouse extension button + */ + EXTRA = 4, + + /** + * mouse forward button + */ + FORWARD = 5, + + /** + * mouse back button + */ + BACK = 6, + + /** + * mouse task button + */ + TASK = 7 +} + +/** +* Axis +* +* @since 9 +* @syscap SystemCapability.MultimodalInput.Input.Core +* @import import {Axis} from '@ohos.multimodalInput.mouseEvent'; +*/ +export declare enum Axis { + /** + * scroll vertical + */ + SCROLL_VERTICAL = 0, + + /** + * scroll horizontal + */ + SCROLL_HORIZONTAL = 1, + + /** + * pinch + */ + PINCH = 2, +} + +/** +* AxisValue +* +* @since 9 +* @syscap SystemCapability.MultimodalInput.Input.Core +* @import import {AxisValue} from '@ohos.multimodalInput.mouseEvent'; +*/ +export declare interface AxisValue { + /** + * axis type + */ + axis: Axis; + + /** + * The value of the axis + */ + value: number +} + +/** +* MouseEvent +* +* @since 9 +* @syscap SystemCapability.MultimodalInput.Input.Core +* @import import {MouseEvent} from '@ohos.multimodalInput.mouseEvent'; +*/ +export declare interface MouseEvent extends InputEvent { + /** + * mouse event action + */ + action: Action; + + /** + * the x coordinate of the mouse cursor in the screen + */ + screenX: number; + + /** + * the y coordinate of the mouse cursor in the screen + */ + screenY: number; + + /** + * the x coordinate of the mouse window + */ + windowX: number; + + /** + * the y coordinate of the mouse window + */ + windowY: number; + + /** + * the relative X offset from the last mouse position reported. At the edge of the screen, + * this value may be less than the coordinate difference reported by the two mice + */ + rawDeltaX: number; + + /** + * the relative Y offset from the last mouse position reported. At the edge of the screen, + * this value may be less than the coordinate difference reported by the two mice + */ + rawDeltaY: number; + + /** + * a button to press or up + */ + button: Button; + + /** + * the button that is currently in the pressed state + */ + pressedButtons: Button[]; + + /** + * The current action for AxisBegin/AxisUpdate/AxisEnd, the axis of the relevant data + */ + axes: AxisValue[]; + + /** + * list of keys that are currently in the pressed state + */ + pressedKeys: KeyCode[]; + + /** + * whether ctrlKey is in down state + */ + ctrlKey: boolean; + + /** + * whether altKey is in down state + */ + altKey: boolean; + + /** + * whether shiftKey is in down state + */ + shiftKey: boolean; + + /** + * whether logoKey is in down state + */ + logoKey: boolean; + + /** + * whether fnKey is in down state + */ + fnKey:boolean + + /** + * whether capsLock is in the active state. + */ + capsLock:boolean + + /** + * whether numLock is in the active state. + */ + numLock:boolean + + /** + * whether scrollLock is in the active state. + */ + scrollLock:boolean +} \ No newline at end of file diff --git a/api/@ohos.multimodalInput.touchEvent.d.ts b/api/@ohos.multimodalInput.touchEvent.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f7a7560df1aee608a4a79fa9ecfa80cc55ecba2b --- /dev/null +++ b/api/@ohos.multimodalInput.touchEvent.d.ts @@ -0,0 +1,242 @@ +/* +* Copyright (c) 2022 Huawei Device Co., Ltd. +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +import { InputEvent } from './@ohos.multimodalInput.inputEvent' + +/** +* Action +* +* @since 9 +* @syscap SystemCapability.MultimodalInput.Input.Core +* @import import {Action} from '@ohos.multimodalInput.ToucEvent'; +*/ +export declare enum Action { + /** + * touch to cancel + */ + CANCEL = 0, + + /** + * touch press + */ + DOWN = 1, + + /** + * touch move + */ + MOVE = 2, + + /** + * touch up + */ + UP = 3, +} + +/** +* ToolType +* +* @since 9 +* @syscap SystemCapability.MultimodalInput.Input.Core +* @import import {ToolType} from '@ohos.multimodalInput.ToucEvent'; +*/ +export declare enum ToolType { + /** + * finger + */ + FINGER = 0, + + /** + * pen + */ + PEN = 1, + + /** + * rubber + */ + RUBBER = 2, + + /** + * brush + */ + BRUSH = 3, + + /** + * pencil + */ + PENCIL = 4, + + /** + * airbrush + */ + AIRBRUSH = 5, + + /** + * mouse + */ + MOUSE = 6, + + LENS = 7, +} + +/** +* SourceType +* +* @since 9 +* @syscap SystemCapability.MultimodalInput.Input.Core +* @import import {SourceType} from '@ohos.multimodalInput.ToucEvent'; +*/ +export declare enum SourceType { + /** + * touch screen + */ + TOUCH_SCREEN = 0, + + /** + * pen + */ + PEN = 1, + + /** + * touch pad + */ + TOUCH_PAD = 2, +} + +/** +* Touch +* +* @since 9 +* @syscap SystemCapability.MultimodalInput.Input.Core +* @import import {Touch} from '@ohos.multimodalInput.ToucEvent'; +*/ +export declare interface Touch { + /** + * pointer identifier, integer data, data greater than or equal to 0. + */ + id: number; + + /** + * press the timestamp of the moment + */ + pressedTime: number; + + /** + * the x coordinate of the screen to which the touch position belongs + */ + screenX: number; + + /** + * the y coordinate of the screen to which the touch position belongs + */ + screenY: number; + + /** + * touch the x coordinate of the position in the window + */ + windowX: number; + + /** + * touch the y coordinate of the position in the window + */ + windowY: number; + + /** + * the pressure value. The range is 0.0 to 1.0, with 0.0 indicating unsupported. + */ + pressure: number; + + /** + * press the width of the contact area + */ + width: number; + + /** + * press the height of the contact area + */ + height: number; + + /** + * relative to the YZ plane, values range from -90 to 90 inclusive, where positive values are skewed to the right + */ + tiltX: number; + + /** + * the Angle relative to the XZ plane ranges from -90 to 90 inclusive, where positive values are downward sloping. + */ + tiltY: number; + + /** + * the center point x of the tool area + */ + toolX: number; + + /** + * the center point y of the tool area + */ + toolY: number; + + /** + * tool area width + */ + toolWidth: number; + + /** + * tool area height + */ + toolHeight: number; + + /** + * the x coordinate on the input device + */ + rawX: number; + + /** + * the y coordinate on the input device + */ + rawY: number; + + /** + * tool type + */ + toolType: ToolType; +} + +/** +* TouchEvent +* +* @since 9 +* @syscap SystemCapability.MultimodalInput.Input.Core +* @import import {TouchEvent} from '@ohos.multimodalInput.ToucEvent'; +*/ +export declare interface TouchEvent extends InputEvent { + /** + * touch action + */ + action: Action; + + /** + * the current touch + */ + touch: Touch; + + /** + * all touch + */ + touches: Touch[]; + + /** + * the device type of the touch source + */ + sourceType: SourceType; +} \ No newline at end of file