From c344a58981e9d3d9b929aed06c63f30c896cfde0 Mon Sep 17 00:00:00 2001 From: hungry_feiwei Date: Wed, 20 Apr 2022 14:30:58 +0800 Subject: [PATCH 01/33] add interface Signed-off-by: hungry_feiwei --- api/@ohos.multimodalInput.inputDevice.d.ts | 73 +++++++++++++++++++--- 1 file changed, 66 insertions(+), 7 deletions(-) diff --git a/api/@ohos.multimodalInput.inputDevice.d.ts b/api/@ohos.multimodalInput.inputDevice.d.ts index 8823d8574e..a99d5f376c 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,21 +13,56 @@ * limitations under the License. */ -import { AsyncCallback } from './basic'; +import { Callback } from "./basic"; /** * The input device management module is configured to obtain an ID and device information of an input device. * - * @since 8 + * @since 9 * @syscap SystemCapability.MultimodalInput.Input.InputDevice * @import import inputDevice from '@ohos.multimodalInput.inputDevice'; */ declare namespace inputDevice { + type EventType = 'add' | 'remove'; + + type ChangeType = 'changed'; + type SourceType = 'keyboard' | 'mouse' | 'touchpad' | 'touchscreen' | 'joystick' | 'trackball'; type AxisType = 'NULL'; + /** + * Defines the monitor 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 DeviceMonitor{ + (type: EventType, deviceId: number): void; + } + + /** + * Starts monitoring for an input device event. + * + * @since 9 + * @syscap SystemCapability.MultimodalInput.Input.InputDevice + * @param type Type of the input device event, which is **changed**. + * @param monitor Callback for the input device event. + */ + function on(type: ChangeType, monitor: Callback): void; + + /** + * Stops monitoring for an input device event. + * + * @since 9 + * @syscap SystemCapability.MultimodalInput.Input.InputDevice + * @param type Type of the input device event, which is **changed**. + * @param monitor Callback for the input device event. + */ + function off(type: ChangeType, monitor?: 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, @@ -63,23 +98,47 @@ declare namespace inputDevice { /** * Obtains the IDs of all input devices. * - * @since 8 + * @since 9 * @syscap SystemCapability.MultimodalInput.Input.InputDevice * @param callback callback function, receive reported data */ - function getDeviceIds(callback: AsyncCallback>): void; + function getDeviceIds(callback: Callback>): void; function getDeviceIds(): Promise>; /** * Obtain the information about an input device. * - * @since 8 + * @since 9 * @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, callback: Callback): void; function getDevice(deviceId: number): Promise; + + /** + * Defines whether the specified data structure is supported a key code. + * + * @syscap SystemCapability.MultimodalInput.Input.InputDevice + * @param keyCode Key code. + * @param isSupport Whether the data structure is supported by the key code. The value **true** indicates that the data structure is supported by the key code, and the value **false** indicates the opposite. + */ + interface KeystrokeAbility { + keyCode: number; + isSupport: boolean; + } + + /** + * 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 keyCodes Key codes of the input device. + * @return Returns a result indicating whether the specified key codes are supported. + */ + function getKeystrokeAbility(deviceId: number, keyCodes: Array, callback: Callback>): void; + function getKeystrokeAbility(deviceId: number, keyCodes: Array): Promise>; } export default inputDevice; \ No newline at end of file -- Gitee From d63feac020499c375916d6ebd177fd320e371196 Mon Sep 17 00:00:00 2001 From: hungry_feiwei Date: Wed, 20 Apr 2022 14:39:46 +0800 Subject: [PATCH 02/33] add interface Signed-off-by: hungry_feiwei --- api/@ohos.multimodalInput.inputDevice.d.ts | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/api/@ohos.multimodalInput.inputDevice.d.ts b/api/@ohos.multimodalInput.inputDevice.d.ts index a99d5f376c..b9a94e5113 100644 --- a/api/@ohos.multimodalInput.inputDevice.d.ts +++ b/api/@ohos.multimodalInput.inputDevice.d.ts @@ -32,6 +32,8 @@ declare namespace inputDevice { type AxisType = 'NULL'; + type KeyboardType = 'alphabetic_keyboard' | 'digital_keyboard' | 'handwriting_pen' | 'remote_control' | 'no_keyboard' | 'unknown_device'; + /** * Defines the monitor for input device events. * @@ -139,6 +141,26 @@ declare namespace inputDevice { */ function getKeystrokeAbility(deviceId: number, keyCodes: Array, callback: Callback>): void; function getKeystrokeAbility(deviceId: number, keyCodes: Array): Promise>; + + /** + * 设置鼠标移动速度 + * + * @since 9 + * @syscap SystemCapability.MultimodalInput.Input.InputDevice + * @param mouseSpeed 鼠标移动速度。 + */ + function setMouseSpeed(mouseSpeed: number): void; + + /** + * 获取指定设备id的键盘类型 + * + * @since 8 + * @syscap SystemCapability.MultimodalInput.Input.InputDevice + * @param deviceId 指定的设备id。 + * @return 返回键盘类型。 + */ + function getKeyboardType(deviceId: number, callback: Callback): void; + function getKeyboardType(deviceId: number): Promise; } export default inputDevice; \ No newline at end of file -- Gitee From ce7cc14d334d3a6942c8dc668f4d6e7ee69686ba Mon Sep 17 00:00:00 2001 From: hungry_feiwei Date: Wed, 20 Apr 2022 14:41:26 +0800 Subject: [PATCH 03/33] add interface Signed-off-by: hungry_feiwei --- api/@ohos.multimodalInput.inputDevice.d.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/api/@ohos.multimodalInput.inputDevice.d.ts b/api/@ohos.multimodalInput.inputDevice.d.ts index b9a94e5113..6fb2fd012e 100644 --- a/api/@ohos.multimodalInput.inputDevice.d.ts +++ b/api/@ohos.multimodalInput.inputDevice.d.ts @@ -161,6 +161,17 @@ declare namespace inputDevice { */ function getKeyboardType(deviceId: number, callback: Callback): void; function getKeyboardType(deviceId: number): Promise; + + /** + * Sets whether the pointer icon is visible. + * + * @since 9 + * @syscap SystemCapability.MultimodalInput.Input.InputDevice + * @param visible Whether the pointer icon is visible. The value **true** indicates that the pointer icon is visible, and the value **false** indicates the opposite. + * @return callback function, receive reported data + */ + function setPointerVisible(visible: boolean, callback: Callback): void; + function setPointerVisible(visible: boolean): Promise; } export default inputDevice; \ No newline at end of file -- Gitee From 01044843d1bbc06a16ed68ce003cbfda78e10b48 Mon Sep 17 00:00:00 2001 From: hungry_feiwei Date: Wed, 20 Apr 2022 14:44:31 +0800 Subject: [PATCH 04/33] add interface Signed-off-by: hungry_feiwei --- api/@ohos.multimodalInput.inputDevice.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/@ohos.multimodalInput.inputDevice.d.ts b/api/@ohos.multimodalInput.inputDevice.d.ts index 6fb2fd012e..208b00f0d9 100644 --- a/api/@ohos.multimodalInput.inputDevice.d.ts +++ b/api/@ohos.multimodalInput.inputDevice.d.ts @@ -154,7 +154,7 @@ declare namespace inputDevice { /** * 获取指定设备id的键盘类型 * - * @since 8 + * @since 9 * @syscap SystemCapability.MultimodalInput.Input.InputDevice * @param deviceId 指定的设备id。 * @return 返回键盘类型。 -- Gitee From 643dbd707f0c48a2699ae4f8e7134e29147ac570 Mon Sep 17 00:00:00 2001 From: hungry_feiwei Date: Wed, 20 Apr 2022 15:56:16 +0800 Subject: [PATCH 05/33] add interface Signed-off-by: hungry_feiwei --- api/@ohos.multimodalInput.inputDevice.d.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/api/@ohos.multimodalInput.inputDevice.d.ts b/api/@ohos.multimodalInput.inputDevice.d.ts index 208b00f0d9..c3eb444ac6 100644 --- a/api/@ohos.multimodalInput.inputDevice.d.ts +++ b/api/@ohos.multimodalInput.inputDevice.d.ts @@ -172,6 +172,17 @@ declare namespace inputDevice { */ function setPointerVisible(visible: boolean, callback: Callback): void; function setPointerVisible(visible: boolean): Promise; + + /** + * 设置鼠标样式 + * + * @since 9 + * @syscap SystemCapability.MultimodalInput.Input.InputDevice + * @param iconId 鼠标样式id。 + * @return callback function, receive reported data + */ + function setMouseIcon(iconId: number, callback: Callback): void; + function setMouseIcon(iconId: number): Promise; } export default inputDevice; \ No newline at end of file -- Gitee From 2ad07bb560dff7571c815123944af1e9af14e97a Mon Sep 17 00:00:00 2001 From: hungry_feiwei Date: Fri, 22 Apr 2022 16:13:21 +0800 Subject: [PATCH 06/33] add interface Signed-off-by: hungry_feiwei --- api/@ohos.multimodalInput.inputDevice.d.ts | 177 ++++++--- api/@ohos.multimodalInput.keyCode.d.ts | 415 +++++++++++++++++++++ 2 files changed, 544 insertions(+), 48 deletions(-) create mode 100755 api/@ohos.multimodalInput.keyCode.d.ts diff --git a/api/@ohos.multimodalInput.inputDevice.d.ts b/api/@ohos.multimodalInput.inputDevice.d.ts index c3eb444ac6..b8e788d5a1 100644 --- a/api/@ohos.multimodalInput.inputDevice.d.ts +++ b/api/@ohos.multimodalInput.inputDevice.d.ts @@ -13,57 +13,65 @@ * limitations under the License. */ -import { Callback } 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 9 + * @since 8 * @syscap SystemCapability.MultimodalInput.Input.InputDevice * @import import inputDevice from '@ohos.multimodalInput.inputDevice'; */ declare namespace inputDevice { - type EventType = 'add' | 'remove'; - - type ChangeType = 'changed'; + type ChangedType = 'add' | 'remove'; type SourceType = 'keyboard' | 'mouse' | 'touchpad' | 'touchscreen' | 'joystick' | 'trackball'; - type AxisType = 'NULL'; + type AxisType = 'touchMajor' | 'touchMinor' | 'orientation' | 'positionX' | 'positionY' | 'pressure' | 'toolX' | 'toolY'; + + enum KeyboardType { + None = 0, + Unknown = 1, + AlphabeticKeyboard = 2, + DigitalKeyboard = 3, + HandwritingPen = 4, + RemoteControl = 5, + } - type KeyboardType = 'alphabetic_keyboard' | 'digital_keyboard' | 'handwriting_pen' | 'remote_control' | 'no_keyboard' | 'unknown_device'; + enum PointerStyle {} /** - * Defines the monitor for input device events. + * 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 DeviceMonitor{ - (type: EventType, deviceId: number): void; + interface DeviceListener{ + (type: ChangedType, deviceId: number): void; } /** - * Starts monitoring for an input device event. + * Starts listening for an input device event. * * @since 9 * @syscap SystemCapability.MultimodalInput.Input.InputDevice - * @param type Type of the input device event, which is **changed**. - * @param monitor Callback for the input device event. + * @param type Type of the input device event, which is **change**. + * @param listener Callback for the input device event. */ - function on(type: ChangeType, monitor: Callback): void; + function on(type: "change", listener: DeviceListener): void; /** - * Stops monitoring for an input device event. + * Stops listening for an input device event. * * @since 9 * @syscap SystemCapability.MultimodalInput.Input.InputDevice - * @param type Type of the input device event, which is **changed**. - * @param monitor Callback for the input device event. + * @param type Type of the input device event, which is **change**. + * @param listener Callback for the input device event. */ - function off(type: ChangeType, monitor?: Callback): void; + function off(type: "change", listener?: DeviceListener): void; /** * Defines axis information about events that can be reported by an input device. @@ -75,12 +83,45 @@ declare namespace inputDevice { * @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; - min: number; + + /** + * @since 8 + */ + min : number; + + /** + * @since 9 + */ + fuzz: number; + + /** + * @since 9 + */ + flat: number; + + /** + * @since 9 + */ + resolution: number; } /** @@ -89,77 +130,117 @@ declare namespace inputDevice { * @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 总线 + * @param product 产品 + * @param vendor 厂商 + * @param version 版本 + * @param phys 物理名称 + * @param uniq 唯一标识 */ interface InputDeviceData { + /** + * @since 8 + */ id: number; + + /** + * @since 8 + */ 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 9 + * @since 8 * @syscap SystemCapability.MultimodalInput.Input.InputDevice * @param callback callback function, receive reported data */ - function getDeviceIds(callback: Callback>): void; + function getDeviceIds(callback: AsyncCallback>): void; function getDeviceIds(): Promise>; /** * Obtain the information about an input device. * - * @since 9 + * @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: Callback): void; + function getDevice(deviceId: number, callback: AsyncCallback): void; function getDevice(deviceId: number): Promise; - /** - * Defines whether the specified data structure is supported a key code. - * - * @syscap SystemCapability.MultimodalInput.Input.InputDevice - * @param keyCode Key code. - * @param isSupport Whether the data structure is supported by the key code. The value **true** indicates that the data structure is supported by the key code, and the value **false** indicates the opposite. - */ - interface KeystrokeAbility { - keyCode: number; - isSupport: boolean; - } - /** * 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 keyCodes Key codes of the input device. + * @param keys Key codes of the input device. 最多一次查询5个按键码 * @return Returns a result indicating whether the specified key codes are supported. */ - function getKeystrokeAbility(deviceId: number, keyCodes: Array, callback: Callback>): void; - function getKeystrokeAbility(deviceId: number, keyCodes: Array): Promise>; + function supportKeys(deviceId: number, keys: Array, callback: Callback>>): void; + function supportKeys(deviceId: number, keys: Array): Promise>>; /** - * 设置鼠标移动速度 + * 设置光标移动速度 * * @since 9 * @syscap SystemCapability.MultimodalInput.Input.InputDevice - * @param mouseSpeed 鼠标移动速度。 + * @param speed 光标移动速度。 */ - function setMouseSpeed(mouseSpeed: number): void; + function setPointerSpeed(speed: number): void; /** - * 获取指定设备id的键盘类型 + * 查询输入设备的键盘类型 * * @since 9 * @syscap SystemCapability.MultimodalInput.Input.InputDevice - * @param deviceId 指定的设备id。 + * @param deviceId 输入设备标识。 * @return 返回键盘类型。 */ - function getKeyboardType(deviceId: number, callback: Callback): void; + function getKeyboardType(deviceId: number, callback: AsyncCallback): void; function getKeyboardType(deviceId: number): Promise; /** @@ -170,7 +251,7 @@ declare namespace inputDevice { * @param visible Whether the pointer icon is visible. The value **true** indicates that the pointer icon is visible, and the value **false** indicates the opposite. * @return callback function, receive reported data */ - function setPointerVisible(visible: boolean, callback: Callback): void; + function setPointerVisible(visible: boolean, callback: AsyncCallback): void; function setPointerVisible(visible: boolean): Promise; /** @@ -178,11 +259,11 @@ declare namespace inputDevice { * * @since 9 * @syscap SystemCapability.MultimodalInput.Input.InputDevice - * @param iconId 鼠标样式id。 + * @param pointerStyle 鼠标样式id。 * @return callback function, receive reported data */ - function setMouseIcon(iconId: number, callback: Callback): void; - function setMouseIcon(iconId: number): Promise; + function setPointerStyle(pointerStyle: PointerStyle, callback: AsyncCallback): void; + function setPointerStyle(pointerStyle: PointerStyle): Promise; } export default inputDevice; \ No newline at end of file diff --git a/api/@ohos.multimodalInput.keyCode.d.ts b/api/@ohos.multimodalInput.keyCode.d.ts new file mode 100755 index 0000000000..251084ef61 --- /dev/null +++ b/api/@ohos.multimodalInput.keyCode.d.ts @@ -0,0 +1,415 @@ +/* +* Copyright (C) 2021 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', +* @permission N/A +*/ + +export declare enum KeyCode { + KEYCODE_FN = 0, + KEYCODE_UNKNOWN = -1, + KEYCODE_HOME = 1, + KEYCODE_BACK = 2, + KEYCODE_CALL = 3, + KEYCODE_ENDCALL = 4, + KEYCODE_CLEAR = 5, + KEYCODE_HEADSETHOOK = 6, + KEYCODE_FOCUS = 7, + KEYCODE_NOTIFICATION = 8, + KEYCODE_SEARCH = 9, + 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_VOICE_ASSISTANT = 20, + KEYCODE_CUSTOM1 = 21, + KEYCODE_VOLUME_MUTE = 22, + KEYCODE_MUTE = 23, + KEYCODE_BRIGHTNESS_UP = 40, + KEYCODE_BRIGHTNESS_DOWN = 41, + KEYCODE_WEAR_1 = 1001, + 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_BUTTON_A = 2301, + KEYCODE_BUTTON_B = 2302, + KEYCODE_BUTTON_C = 2303, + KEYCODE_BUTTON_X = 2304, + KEYCODE_BUTTON_Y = 2305, + KEYCODE_BUTTON_Z = 2306, + KEYCODE_BUTTON_L1 = 2307, + KEYCODE_BUTTON_R1 = 2308, + KEYCODE_BUTTON_L2 = 2309, + KEYCODE_BUTTON_R2 = 2310, + KEYCODE_BUTTON_SELECT = 2311, + KEYCODE_BUTTON_START = 2312, + KEYCODE_BUTTON_MODE = 2313, + KEYCODE_BUTTON_THUMBL = 2314, + KEYCODE_BUTTON_THUMBR = 2315, + KEYCODE_BUTTON_TRIGGER = 2401, + KEYCODE_BUTTON_THUMB = 2402, + KEYCODE_BUTTON_THUMB2 = 2403, + KEYCODE_BUTTON_TOP = 2404, + KEYCODE_BUTTON_TOP2 = 2405, + KEYCODE_BUTTON_PINKIE = 2406, + KEYCODE_BUTTON_BASE1 = 2407, + KEYCODE_BUTTON_BASE2 = 2408, + KEYCODE_BUTTON_BASE3 = 2409, + KEYCODE_BUTTON_BASE4 = 2410, + KEYCODE_BUTTON_BASE5 = 2411, + KEYCODE_BUTTON_BASE6 = 2412, + KEYCODE_BUTTON_BASE7 = 2413, + KEYCODE_BUTTON_BASE8 = 2414, + KEYCODE_BUTTON_BASE9 = 2415, + KEYCODE_BUTTON_DEAD = 2416, + 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, + KEYCODE_BRL_DOT1 = 3201, + KEYCODE_BRL_DOT2 = 3202, + KEYCODE_BRL_DOT3 = 3203, + KEYCODE_BRL_DOT4 = 3204, + KEYCODE_BRL_DOT5 = 3205, + KEYCODE_BRL_DOT6 = 3206, + KEYCODE_BRL_DOT7 = 3207, + KEYCODE_BRL_DOT8 = 3208, + KEYCODE_BRL_DOT9 = 3209, + KEYCODE_BRL_DOT10 = 3210, + KEYCODE_LEFT_KNOB_ROLL_UP = 10001, + KEYCODE_LEFT_KNOB_ROLL_DOWN = 10002, + KEYCODE_LEFT_KNOB = 10003, + KEYCODE_RIGHT_KNOB_ROLL_UP = 10004, + KEYCODE_RIGHT_KNOB_ROLL_DOWN = 10005, + KEYCODE_RIGHT_KNOB = 10006, + KEYCODE_VOICE_SOURCE_SWITCH = 10007, + KEYCODE_LAUNCHER_MENU = 10008, +} -- Gitee From ec0152625436574d5ca462a7ab8f7e36f9f8e6af Mon Sep 17 00:00:00 2001 From: hungry_feiwei Date: Fri, 22 Apr 2022 16:14:50 +0800 Subject: [PATCH 07/33] add interface Signed-off-by: hungry_feiwei --- api/@ohos.multimodalInput.inputDevice.d.ts | 28 +++++++++++----------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/api/@ohos.multimodalInput.inputDevice.d.ts b/api/@ohos.multimodalInput.inputDevice.d.ts index b8e788d5a1..4cc9dbe774 100644 --- a/api/@ohos.multimodalInput.inputDevice.d.ts +++ b/api/@ohos.multimodalInput.inputDevice.d.ts @@ -16,13 +16,13 @@ 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 ChangedType = 'add' | 'remove'; @@ -40,7 +40,7 @@ declare namespace inputDevice { RemoteControl = 5, } - enum PointerStyle {} + enum PointerStyle { } /** * Defines the listener for input device events. @@ -49,7 +49,7 @@ declare namespace 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{ + interface DeviceListener { (type: ChangedType, deviceId: number): void; } @@ -96,17 +96,17 @@ declare namespace inputDevice { /** * @since 8 */ - axis : AxisType; + axis: AxisType; /** * @since 8 */ - max : number; + max: number; /** * @since 8 */ - min : number; + min: number; /** * @since 9 @@ -152,12 +152,12 @@ declare namespace inputDevice { /** * @since 8 */ - sources : Array; + sources: Array; /** * @since 8 */ - axisRanges : Array; + axisRanges: Array; /** * @since 9 -- Gitee From 5505ea0c8073f1a5e879388090640d99429ae15b Mon Sep 17 00:00:00 2001 From: hungry_feiwei Date: Sun, 24 Apr 2022 09:46:58 +0800 Subject: [PATCH 08/33] add interface Signed-off-by: hungry_feiwei --- api/@ohos.multimodalInput.axisEvent.d.ts | 91 ++++++++++ ...ohos.multimodalInput.distributedInput.d.ts | 90 ++++++++++ api/@ohos.multimodalInput.inputEvent.d.ts | 41 +++++ api/@ohos.multimodalInput.keyEvent.d.ts | 81 +++++++++ api/@ohos.multimodalInput.mouseEvent.d.ts | 157 ++++++++++++++++++ api/@ohos.multimodalInput.touchEvent.d.ts | 131 +++++++++++++++ 6 files changed, 591 insertions(+) create mode 100755 api/@ohos.multimodalInput.axisEvent.d.ts create mode 100755 api/@ohos.multimodalInput.distributedInput.d.ts create mode 100755 api/@ohos.multimodalInput.inputEvent.d.ts create mode 100755 api/@ohos.multimodalInput.keyEvent.d.ts create mode 100755 api/@ohos.multimodalInput.mouseEvent.d.ts create mode 100755 api/@ohos.multimodalInput.touchEvent.d.ts diff --git a/api/@ohos.multimodalInput.axisEvent.d.ts b/api/@ohos.multimodalInput.axisEvent.d.ts new file mode 100755 index 0000000000..e3bc325fbc --- /dev/null +++ b/api/@ohos.multimodalInput.axisEvent.d.ts @@ -0,0 +1,91 @@ +/* +* Copyright (C) 2021 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" + +/** +* MouseEvent +* +* @since 9 +* @syscap SystemCapability.MultimodalInput.Input.Core +* @import import {MouseEvent} from '@ohos.multimodalInput.mouseEvent'; +* @permission N/A +*/ + +export enum Action { + // 取消 + Cancel = 0, + // 鼠标关联的轴事件开始 + AxisBegin = 4, + // 鼠标关联的轴事件更新 + AxisUpdate = 5, + // 鼠标关联的轴事件结束 + AxisEnd = 6, +} + +export enum Axis { + // 垂直滚动轴 + ScrollVertical = 0, + // 水平滚动轴 + ScrollHorizontal = 1, + // 捏合轴 + Pinch = 2, +} + +export interface AxisValue { + + // 轴类型 + axis: Axis; + // 轴的值 + value: number +} + +export declare interface MouseEvent extends InputEvent { + // 轴事件动作 + action: Action; + + // 轴的数据 + axes: AxisValue[], + + // 当前处于按下状态的按键列表 + pressedKeys: KeyCode[], + + // 当前ctrlKey是否处于按下状态 + readonly ctrlKey: boolean + + // 当前altKey是否处于按下状态 + readonly altKey: boolean + + // 当前shiftKey是否处于按下状态 + readonly shiftKey: boolean + + // 当前metaKey是否处于按下状态 + readonly metaKey: boolean + + // 当前fnKey是否处于按下状态 + readonly fnKey: boolean + + // 当前capsLock是否处于激活状态 + capsLock: boolean + + // 当前numLock是否处于激活状态 + numLock: boolean + + // 当前scrollLock是否处于激活状态 + scrollLock: boolean + + // 指定按键是否处于按下状态 + isKeyDown(keyCode: KeyCode): 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 100755 index 0000000000..7e0b160012 --- /dev/null +++ b/api/@ohos.multimodalInput.distributedInput.d.ts @@ -0,0 +1,90 @@ +/* +* Copyright (C) 2021 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"; + +/** + * 分布式输入管理模块,用于提供分布式能力的接口调用 + * + * @since 9 + * @syscap SystemCapability.MultimodalInput.Input.RemoteInputDevice + * @import import distributedInput from '@ohos.multimodalInput.distributedInput', + */ +declare namespace distributedInput { + enum InputAbility { + Mouse = 0, + Keyboard = 1, + Touchscreen = 2, + Touchpad = 3, + } + + /** + * 查询分布式设备输入能力 + * + * @since 9 + * @syscap SystemCapability.MultimodalInput.Input.RemoteInputDevice + * @param deviceId 表示查询分布式输入能力的那台设备的ID. + * @return - + */ + function getRemoteInputAbility(deviceId: number, callback: AsyncCallback>): void; + function getRemoteInputAbility(deviceId: number): Promise>; + + /** + * 准备分布式 + * + * @since 9 + * @syscap SystemCapability.MultimodalInput.Input.RemoteInputDevice + * @param deviceId 表示准备分布式的那台设备的ID. + * @return - + */ + function prepareRemoteInput(deviceId: number, callback: AsyncCallback): void; + function prepareRemoteInput(deviceId: number): Promise; + + /** + * 取消准备分布式 + * + * @since 9 + * @syscap SystemCapability.MultimodalInput.Input.RemoteInputDevice + * @param deviceId 表示准备分布式的那台设备的ID. + * @return - + */ + function unprepareRemoteInput(deviceId: number, callback: AsyncCallback): void; + function unprepareRemoteInput(deviceId: number): Promise; + + /** + * 停止分布式 + * + * @since 9 + * @syscap SystemCapability.MultimodalInput.Input.RemoteInputDevice + * @param deviceId 表示准备分布式的那台设备的ID. + * @return - + */ + function stopRemoteInput(deviceId: number, callback: AsyncCallback): void; + function stopRemoteInput(deviceId: number): Promise; + + /** + * 鼠标位置设定 + * + * @since 9 + * @syscap SystemCapability.MultimodalInput.Input.RemoteInputDevice + * @param mouseX x坐标 + * @param mouseY y坐标 + * @return - + */ + function setPointerLocation(mouseX: number, mouseY: number, callback: AsyncCallback): void; + function setPointerLocation(deviceId: number, mouseY: number): Promise; +} + +export default distributedInput; \ 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 100755 index 0000000000..d164e90a26 --- /dev/null +++ b/api/@ohos.multimodalInput.inputEvent.d.ts @@ -0,0 +1,41 @@ + +/* +* Copyright (C) 2021 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'; +* @permission N/A +*/ + +export declare interface InputEvent { + // 事件id,服务端生成,全局唯一 + readonly id: number; + + // 上报输入事件的设备id, 整型数字,>=0 有效 + deviceId: number; + + // 事件发生事件 + actionTime: number; + + // 目标屏幕id, 整型数字,>=0 有效 + screenId: number; + + // 目标窗口id, 整型数字, >=0 有效 + windowId: number; +} \ No newline at end of file diff --git a/api/@ohos.multimodalInput.keyEvent.d.ts b/api/@ohos.multimodalInput.keyEvent.d.ts new file mode 100755 index 0000000000..242d7f0b00 --- /dev/null +++ b/api/@ohos.multimodalInput.keyEvent.d.ts @@ -0,0 +1,81 @@ + +/* +* Copyright (C) 2021 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" +/** +* KeyEvent +* +* @since 9 +* @syscap SystemCapability.MultimodalInput.Input.Core +* @import import KeyEvent from '@ohos.multimodalInput.keyEvent'; +* @permission N/A +*/ + +export enum Action { + // 取消 + Cancel = 0, + // 按钮按下 + Down = 1, + // 按钮抬起 + Up = 2, +} + +export interface Key { + // 按键码 + code: KeyCode; + // 按下时间 + pressedTime: number; + // 按键所属设备 + deviceId: number; +} + +export declare interface KeyEvent extends InputEvent { + // 按键动作 + action: Action; + + // 本次发生变化的按键 + key: Key; + + // unideCode编码 + unicodeChar: number; + + // 当前处于按下状态的按键列表 + keys: Key[]; + + // 当前ctrlKey是否处于按下状态 + readonly ctrlKey: boolean + + // 当前altKey是否处于按下状态 + readonly altKey: boolean + + // 当前shiftKey是否处于按下状态 + readonly shiftKey: boolean + + // 当前metaKey是否处于按下状态 + readonly metaKey: boolean + + // 当前fnKey是否处于按下状态 + readonly fnKey: boolean + + // 当前capsLock是否处于激活状态 + capsLock: boolean + + // 当前numLock是否处于激活状态 + numLock: boolean + + // 当前scrollLock是否处于激活状态 + 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 100755 index 0000000000..ece01e3956 --- /dev/null +++ b/api/@ohos.multimodalInput.mouseEvent.d.ts @@ -0,0 +1,157 @@ + +/* +* Copyright (C) 2021 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" + +/** +* MouseEvent +* +* @since 9 +* @syscap SystemCapability.MultimodalInput.Input.Core +* @import import {MouseEvent} from '@ohos.multimodalInput.mouseEvent'; +* @permission N/A +*/ + +export enum Action { + // 取消 + Cancel = 0, + + // 鼠标移动 + Move = 1, + + // 鼠标按钮按下 + ButtonDown = 2, + + // 鼠标按钮抬起 + ButtonUp = 3, + + // 鼠标关联的轴事件开始 + AxisBegin = 4, + + // 鼠标关联的轴事件更新 + AxisUpdate = 5, + + // 鼠标关联的轴事件结束 + AxisEnd = 6, +} + +export enum Button { + // 鼠标左键 + Left = 0, + + // 鼠标中键 + Middle = 1, + + // 鼠标右键 + Right = 2, + + // 鼠标侧边键 + Side = 3, + + // 鼠标扩展键 + Extra = 4, + + // 鼠标前进键 + Forward = 5, + + // 鼠标后退键 + Back = 6, + + // 鼠标任务键 + Task = 7 + +} + +export enum Axis { + // 垂直滚动轴 + ScrollVertical = 0, + + // 水平滚动轴 + ScrollHorizontal = 1, + + // 捏合轴 + Pinch = 2, +} + +export interface AxisValue { + // 轴类型 + axis: Axis; + + // 轴的值 + value: number +} + +export declare interface MouseEvent extends InputEvent { + // 鼠标事件动作 + action: Action; + + // 鼠标光标在屏幕中的x坐标 + screenX: number; + + // 鼠标光标在屏幕中的y坐标 + screenY: number; + + // 鼠标归属窗口的x坐标 + windowX: number; + + // 鼠标归属窗口的y坐标 + windowY: number; + + // 相对上次上报鼠标位置的相对X偏移,在屏幕边缘位置时,该值可能小于两次鼠标上报的坐标差 + rawDeltaX: number; + + // 相对上次上报鼠标位置的相对Y偏移,在屏幕边缘位置时,该值可能小于两次鼠标上报的坐标差 + rawDeltaY: number; + + // 按钮按下/抬起时的按钮 + button: Button; + + // 当前处于按下状态的按钮 + pressedButtons: Button[]; + + // 当前action为AxisBegin/AxisUpdate/AxisEnd时,相关的轴的数据 + axes: AxisValue[]; + + // 当前处于按下状态的按键列表 + pressedKeys: KeyCode[]; + + // 当前ctrlKey是否处于按下状态 + readonly ctrlKey: boolean; + + // 当前altKey是否处于按下状态 + readonly altKey: boolean; + + // 当前shiftKey是否处于按下状态 + readonly shiftKey: boolean; + + // 当前metaKey是否处于按下状态 + readonly metaKey: boolean; + + // 当前fnKey是否处于按下状态 + readonly fnKey:boolean + + // 当前capsLock是否处于激活状态 + capsLock:boolean + + // 当前numLock是否处于激活状态 + numLock:boolean + + // 当前scrollLock是否处于激活状态 + scrollLock:boolean + + // 指定按键是否处于按下状态 + isKeyDown(keyCode:KeyCode):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 100755 index 0000000000..913697b134 --- /dev/null +++ b/api/@ohos.multimodalInput.touchEvent.d.ts @@ -0,0 +1,131 @@ +/* +* Copyright (C) 2021 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' + +/** +* TouchEvent +* +* @since 9 +* @syscap SystemCapability.MultimodalInput.Input.Core +* @import import {PointerEvent, Pointer, PointerAction} from '@ohos.multimodalInput.ToucEvent'; +* @permission N/A +*/ + +export enum Action { + // 触摸取消 + Cancel = 0, + + // 触摸按下 + Down = 1, + + // 触摸移动 + Move = 2, + + // 触摸抬起 + Up = 3, +} + +export enum ToolType { + // 手指 + Finger = 0, + + // 笔 + Pen = 1, + + Rubber = 2, + + Brush = 3, + + Pencil = 4, + + Airbrush = 5, + + Mouse = 6, + + Lens = 7, +} + +export enum SourceType { + // 触摸屏 + TouchScreen = 0, + + // 手写笔 + Pen = 1, +} + +export interface Touch { + // 指针标识,整型 >= 0 有效 + readonly id: number; + + // 按下时刻的时间戳 + pressedTime: number; + + // 触摸位置所属的屏幕x坐标 + screenX: number; + + // 触摸位置所属的屏幕y坐标 + screenY: number; + + // 触摸位置在窗口中的x坐标 + windowX: number; + + // 触摸位置在窗口中的y坐标 + windowY: number; + + // 压力值 [0.0, 1.0], 0.0表示不支持 + pressure: number; + + // 按下接触区域的宽度 + width: number; + + // 按下接触区域的高度 + height: number; + + // 相对YZ平面的角度,值的范围为-90到90(含),其中正值是向右倾斜。 + tiltX: number; + + // 相对XZ平面的角度,值的范围为-90到90(含),其中正值是向下倾斜。 + tiltY: number; + + // 工具区域的中心点X + toolX: number; + + // 工具区域的中心点Y + toolY: number; + + // 工具区域宽度 + toolWidth: number; + + // 工具区域高度 + toolHeight: number; + + // 工具类型 + toolType: ToolType; +} + + +export declare interface TouchEvent extends InputEvent { + // 触摸动作 + action: Action; + + // 当前触摸 + touch: Touch; + + // 所有触摸 + touches: Touch[]; + + // 触摸来源的设备类型 + sourceType: SourceType; +} \ No newline at end of file -- Gitee From b3712895d691adefae1bd3ac0f2cc05688eecc39 Mon Sep 17 00:00:00 2001 From: hungry_feiwei Date: Sun, 24 Apr 2022 09:50:25 +0800 Subject: [PATCH 09/33] add interface Signed-off-by: hungry_feiwei --- api/@ohos.multimodalInput.axisEvent.d.ts | 0 api/@ohos.multimodalInput.distributedInput.d.ts | 0 api/@ohos.multimodalInput.inputEvent.d.ts | 0 api/@ohos.multimodalInput.keyCode.d.ts | 0 api/@ohos.multimodalInput.keyEvent.d.ts | 0 api/@ohos.multimodalInput.mouseEvent.d.ts | 0 api/@ohos.multimodalInput.touchEvent.d.ts | 0 7 files changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 api/@ohos.multimodalInput.axisEvent.d.ts mode change 100755 => 100644 api/@ohos.multimodalInput.distributedInput.d.ts mode change 100755 => 100644 api/@ohos.multimodalInput.inputEvent.d.ts mode change 100755 => 100644 api/@ohos.multimodalInput.keyCode.d.ts mode change 100755 => 100644 api/@ohos.multimodalInput.keyEvent.d.ts mode change 100755 => 100644 api/@ohos.multimodalInput.mouseEvent.d.ts mode change 100755 => 100644 api/@ohos.multimodalInput.touchEvent.d.ts diff --git a/api/@ohos.multimodalInput.axisEvent.d.ts b/api/@ohos.multimodalInput.axisEvent.d.ts old mode 100755 new mode 100644 diff --git a/api/@ohos.multimodalInput.distributedInput.d.ts b/api/@ohos.multimodalInput.distributedInput.d.ts old mode 100755 new mode 100644 diff --git a/api/@ohos.multimodalInput.inputEvent.d.ts b/api/@ohos.multimodalInput.inputEvent.d.ts old mode 100755 new mode 100644 diff --git a/api/@ohos.multimodalInput.keyCode.d.ts b/api/@ohos.multimodalInput.keyCode.d.ts old mode 100755 new mode 100644 diff --git a/api/@ohos.multimodalInput.keyEvent.d.ts b/api/@ohos.multimodalInput.keyEvent.d.ts old mode 100755 new mode 100644 diff --git a/api/@ohos.multimodalInput.mouseEvent.d.ts b/api/@ohos.multimodalInput.mouseEvent.d.ts old mode 100755 new mode 100644 diff --git a/api/@ohos.multimodalInput.touchEvent.d.ts b/api/@ohos.multimodalInput.touchEvent.d.ts old mode 100755 new mode 100644 -- Gitee From d6b201a64a88aa8f2e5ddbcc9b12703f26f4f35d Mon Sep 17 00:00:00 2001 From: hungry_feiwei Date: Sun, 24 Apr 2022 10:04:35 +0800 Subject: [PATCH 10/33] add interface Signed-off-by: hungry_feiwei --- api/@ohos.multimodalInput.axisEvent.d.ts | 87 ++- api/@ohos.multimodalInput.inputDevice.d.ts | 384 +++++----- api/@ohos.multimodalInput.inputEvent.d.ts | 20 +- api/@ohos.multimodalInput.keyCode.d.ts | 778 ++++++++++----------- api/@ohos.multimodalInput.keyEvent.d.ts | 72 +- api/@ohos.multimodalInput.mouseEvent.d.ts | 168 ++--- api/@ohos.multimodalInput.touchEvent.d.ts | 124 ++-- 7 files changed, 816 insertions(+), 817 deletions(-) diff --git a/api/@ohos.multimodalInput.axisEvent.d.ts b/api/@ohos.multimodalInput.axisEvent.d.ts index e3bc325fbc..385ea90b72 100644 --- a/api/@ohos.multimodalInput.axisEvent.d.ts +++ b/api/@ohos.multimodalInput.axisEvent.d.ts @@ -25,67 +25,66 @@ import { KeyCode } from "./@ohos.multimodalInput.keyCode" */ export enum Action { - // 取消 - Cancel = 0, - // 鼠标关联的轴事件开始 - AxisBegin = 4, - // 鼠标关联的轴事件更新 - AxisUpdate = 5, - // 鼠标关联的轴事件结束 - AxisEnd = 6, + // 取消 + Cancel = 0, + // 鼠标关联的轴事件开始 + AxisBegin = 4, + // 鼠标关联的轴事件更新 + AxisUpdate = 5, + // 鼠标关联的轴事件结束 + AxisEnd = 6, } export enum Axis { - // 垂直滚动轴 - ScrollVertical = 0, - // 水平滚动轴 - ScrollHorizontal = 1, - // 捏合轴 - Pinch = 2, + // 垂直滚动轴 + ScrollVertical = 0, + // 水平滚动轴 + ScrollHorizontal = 1, + // 捏合轴 + Pinch = 2, } export interface AxisValue { - - // 轴类型 - axis: Axis; - // 轴的值 - value: number + // 轴类型 + axis: Axis; + // 轴的值 + value: number } export declare interface MouseEvent extends InputEvent { - // 轴事件动作 - action: Action; + // 轴事件动作 + action: Action; + + // 轴的数据 + axes: AxisValue[], - // 轴的数据 - axes: AxisValue[], + // 当前处于按下状态的按键列表 + pressedKeys: KeyCode[], - // 当前处于按下状态的按键列表 - pressedKeys: KeyCode[], + // 当前ctrlKey是否处于按下状态 + readonly ctrlKey: boolean - // 当前ctrlKey是否处于按下状态 - readonly ctrlKey: boolean + // 当前altKey是否处于按下状态 + readonly altKey: boolean - // 当前altKey是否处于按下状态 - readonly altKey: boolean + // 当前shiftKey是否处于按下状态 + readonly shiftKey: boolean - // 当前shiftKey是否处于按下状态 - readonly shiftKey: boolean + // 当前metaKey是否处于按下状态 + readonly metaKey: boolean - // 当前metaKey是否处于按下状态 - readonly metaKey: boolean + // 当前fnKey是否处于按下状态 + readonly fnKey: boolean - // 当前fnKey是否处于按下状态 - readonly fnKey: boolean + // 当前capsLock是否处于激活状态 + capsLock: boolean - // 当前capsLock是否处于激活状态 - capsLock: boolean + // 当前numLock是否处于激活状态 + numLock: boolean - // 当前numLock是否处于激活状态 - numLock: boolean + // 当前scrollLock是否处于激活状态 + scrollLock: boolean - // 当前scrollLock是否处于激活状态 - scrollLock: boolean - - // 指定按键是否处于按下状态 - isKeyDown(keyCode: KeyCode): boolean + // 指定按键是否处于按下状态 + isKeyDown(keyCode: KeyCode): boolean } \ No newline at end of file diff --git a/api/@ohos.multimodalInput.inputDevice.d.ts b/api/@ohos.multimodalInput.inputDevice.d.ts index 4cc9dbe774..6b34e61811 100644 --- a/api/@ohos.multimodalInput.inputDevice.d.ts +++ b/api/@ohos.multimodalInput.inputDevice.d.ts @@ -25,245 +25,245 @@ import { KeyCode } from "./@ohos.multimodalInput.keyCode" */ declare namespace inputDevice { - type ChangedType = 'add' | 'remove'; - - type SourceType = 'keyboard' | 'mouse' | 'touchpad' | 'touchscreen' | 'joystick' | 'trackball'; - - type AxisType = 'touchMajor' | 'touchMinor' | 'orientation' | 'positionX' | 'positionY' | 'pressure' | 'toolX' | 'toolY'; + type ChangedType = 'add' | 'remove'; + + type SourceType = 'keyboard' | 'mouse' | 'touchpad' | 'touchscreen' | 'joystick' | 'trackball'; + + type AxisType = 'touchMajor' | 'touchMinor' | 'orientation' | 'positionX' | 'positionY' | 'pressure' | 'toolX' | 'toolY'; + + enum KeyboardType { + None = 0, + Unknown = 1, + AlphabeticKeyboard = 2, + DigitalKeyboard = 3, + HandwritingPen = 4, + RemoteControl = 5, + } + + enum PointerStyle { } + + /** + * 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): void; + } + + /** + * 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**. + * @param listener Callback for the input device event. + */ + function on(type: "change", listener: DeviceListener): 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**. + * @param listener Callback for the input device event. + */ + function off(type: "change", listener?: DeviceListener): 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; - enum KeyboardType { - None = 0, - Unknown = 1, - AlphabeticKeyboard = 2, - DigitalKeyboard = 3, - HandwritingPen = 4, - RemoteControl = 5, - } + /** + * @since 8 + */ + axis: AxisType; - enum PointerStyle { } + /** + * @since 8 + */ + max: number; /** - * 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. + * @since 8 */ - interface DeviceListener { - (type: ChangedType, deviceId: number): void; - } + min: 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**. - * @param listener Callback for the input device event. */ - function on(type: "change", listener: DeviceListener): void; + fuzz: number; /** - * 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**. - * @param listener Callback for the input device event. */ - function off(type: "change", listener?: DeviceListener): void; + flat: number; /** - * 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. + * @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 总线 + * @param product 产品 + * @param vendor 厂商 + * @param version 版本 + * @param phys 物理名称 + * @param uniq 唯一标识 + */ + interface InputDeviceData { + /** + * @since 8 */ - 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; - } + id: 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 总线 - * @param product 产品 - * @param vendor 厂商 - * @param version 版本 - * @param phys 物理名称 - * @param uniq 唯一标识 + * @since 8 */ - interface InputDeviceData { - /** - * @since 8 - */ - id: number; - - /** - * @since 8 - */ - 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; - } + name: 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>; + sources: Array; /** - * 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; + axisRanges: Array; + + /** + * @since 9 + */ + bus: number; /** - * 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. 最多一次查询5个按键码 - * @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>>; + product: number; /** - * 设置光标移动速度 - * * @since 9 - * @syscap SystemCapability.MultimodalInput.Input.InputDevice - * @param speed 光标移动速度。 */ - function setPointerSpeed(speed: number): void; + vendor: number; /** - * 查询输入设备的键盘类型 - * * @since 9 - * @syscap SystemCapability.MultimodalInput.Input.InputDevice - * @param deviceId 输入设备标识。 - * @return 返回键盘类型。 */ - function getKeyboardType(deviceId: number, callback: AsyncCallback): void; - function getKeyboardType(deviceId: number): Promise; + version: number; /** - * Sets whether the pointer icon is visible. - * * @since 9 - * @syscap SystemCapability.MultimodalInput.Input.InputDevice - * @param visible Whether the pointer icon is visible. The value **true** indicates that the pointer icon is visible, and the value **false** indicates the opposite. - * @return callback function, receive reported data */ - function setPointerVisible(visible: boolean, callback: AsyncCallback): void; - function setPointerVisible(visible: boolean): Promise; + phys: string; /** - * 设置鼠标样式 - * * @since 9 - * @syscap SystemCapability.MultimodalInput.Input.InputDevice - * @param pointerStyle 鼠标样式id。 - * @return callback function, receive reported data */ - function setPointerStyle(pointerStyle: PointerStyle, callback: AsyncCallback): void; - function setPointerStyle(pointerStyle: PointerStyle): Promise; + 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. 最多一次查询5个按键码 + * @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>>; + + /** + * 设置光标移动速度 + * + * @since 9 + * @syscap SystemCapability.MultimodalInput.Input.InputDevice + * @param speed 光标移动速度。 + */ + function setPointerSpeed(speed: number): void; + + /** + * 查询输入设备的键盘类型 + * + * @since 9 + * @syscap SystemCapability.MultimodalInput.Input.InputDevice + * @param deviceId 输入设备标识。 + * @return 返回键盘类型。 + */ + function getKeyboardType(deviceId: number, callback: AsyncCallback): void; + function getKeyboardType(deviceId: number): Promise; + + /** + * Sets whether the pointer icon is visible. + * + * @since 9 + * @syscap SystemCapability.MultimodalInput.Input.InputDevice + * @param visible Whether the pointer icon is visible. The value **true** indicates that the pointer icon is visible, and the value **false** indicates the opposite. + * @return callback function, receive reported data + */ + function setPointerVisible(visible: boolean, callback: AsyncCallback): void; + function setPointerVisible(visible: boolean): Promise; + + /** + * 设置鼠标样式 + * + * @since 9 + * @syscap SystemCapability.MultimodalInput.Input.InputDevice + * @param pointerStyle 鼠标样式id。 + * @return callback function, receive reported data + */ + function setPointerStyle(pointerStyle: PointerStyle, callback: AsyncCallback): void; + function setPointerStyle(pointerStyle: PointerStyle): 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 index d164e90a26..4a7233b875 100644 --- a/api/@ohos.multimodalInput.inputEvent.d.ts +++ b/api/@ohos.multimodalInput.inputEvent.d.ts @@ -24,18 +24,18 @@ */ export declare interface InputEvent { - // 事件id,服务端生成,全局唯一 - readonly id: number; + // 事件id,服务端生成,全局唯一 + readonly id: number; - // 上报输入事件的设备id, 整型数字,>=0 有效 - deviceId: number; + // 上报输入事件的设备id, 整型数字,>=0 有效 + deviceId: number; - // 事件发生事件 - actionTime: number; + // 事件发生事件 + actionTime: number; - // 目标屏幕id, 整型数字,>=0 有效 - screenId: number; + // 目标屏幕id, 整型数字,>=0 有效 + screenId: number; - // 目标窗口id, 整型数字, >=0 有效 - windowId: number; + // 目标窗口id, 整型数字, >=0 有效 + windowId: number; } \ No newline at end of file diff --git a/api/@ohos.multimodalInput.keyCode.d.ts b/api/@ohos.multimodalInput.keyCode.d.ts index 251084ef61..71e990bb73 100644 --- a/api/@ohos.multimodalInput.keyCode.d.ts +++ b/api/@ohos.multimodalInput.keyCode.d.ts @@ -23,393 +23,393 @@ */ export declare enum KeyCode { - KEYCODE_FN = 0, - KEYCODE_UNKNOWN = -1, - KEYCODE_HOME = 1, - KEYCODE_BACK = 2, - KEYCODE_CALL = 3, - KEYCODE_ENDCALL = 4, - KEYCODE_CLEAR = 5, - KEYCODE_HEADSETHOOK = 6, - KEYCODE_FOCUS = 7, - KEYCODE_NOTIFICATION = 8, - KEYCODE_SEARCH = 9, - 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_VOICE_ASSISTANT = 20, - KEYCODE_CUSTOM1 = 21, - KEYCODE_VOLUME_MUTE = 22, - KEYCODE_MUTE = 23, - KEYCODE_BRIGHTNESS_UP = 40, - KEYCODE_BRIGHTNESS_DOWN = 41, - KEYCODE_WEAR_1 = 1001, - 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_BUTTON_A = 2301, - KEYCODE_BUTTON_B = 2302, - KEYCODE_BUTTON_C = 2303, - KEYCODE_BUTTON_X = 2304, - KEYCODE_BUTTON_Y = 2305, - KEYCODE_BUTTON_Z = 2306, - KEYCODE_BUTTON_L1 = 2307, - KEYCODE_BUTTON_R1 = 2308, - KEYCODE_BUTTON_L2 = 2309, - KEYCODE_BUTTON_R2 = 2310, - KEYCODE_BUTTON_SELECT = 2311, - KEYCODE_BUTTON_START = 2312, - KEYCODE_BUTTON_MODE = 2313, - KEYCODE_BUTTON_THUMBL = 2314, - KEYCODE_BUTTON_THUMBR = 2315, - KEYCODE_BUTTON_TRIGGER = 2401, - KEYCODE_BUTTON_THUMB = 2402, - KEYCODE_BUTTON_THUMB2 = 2403, - KEYCODE_BUTTON_TOP = 2404, - KEYCODE_BUTTON_TOP2 = 2405, - KEYCODE_BUTTON_PINKIE = 2406, - KEYCODE_BUTTON_BASE1 = 2407, - KEYCODE_BUTTON_BASE2 = 2408, - KEYCODE_BUTTON_BASE3 = 2409, - KEYCODE_BUTTON_BASE4 = 2410, - KEYCODE_BUTTON_BASE5 = 2411, - KEYCODE_BUTTON_BASE6 = 2412, - KEYCODE_BUTTON_BASE7 = 2413, - KEYCODE_BUTTON_BASE8 = 2414, - KEYCODE_BUTTON_BASE9 = 2415, - KEYCODE_BUTTON_DEAD = 2416, - 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, - KEYCODE_BRL_DOT1 = 3201, - KEYCODE_BRL_DOT2 = 3202, - KEYCODE_BRL_DOT3 = 3203, - KEYCODE_BRL_DOT4 = 3204, - KEYCODE_BRL_DOT5 = 3205, - KEYCODE_BRL_DOT6 = 3206, - KEYCODE_BRL_DOT7 = 3207, - KEYCODE_BRL_DOT8 = 3208, - KEYCODE_BRL_DOT9 = 3209, - KEYCODE_BRL_DOT10 = 3210, - KEYCODE_LEFT_KNOB_ROLL_UP = 10001, - KEYCODE_LEFT_KNOB_ROLL_DOWN = 10002, - KEYCODE_LEFT_KNOB = 10003, - KEYCODE_RIGHT_KNOB_ROLL_UP = 10004, - KEYCODE_RIGHT_KNOB_ROLL_DOWN = 10005, - KEYCODE_RIGHT_KNOB = 10006, - KEYCODE_VOICE_SOURCE_SWITCH = 10007, - KEYCODE_LAUNCHER_MENU = 10008, + KEYCODE_FN = 0, + KEYCODE_UNKNOWN = -1, + KEYCODE_HOME = 1, + KEYCODE_BACK = 2, + KEYCODE_CALL = 3, + KEYCODE_ENDCALL = 4, + KEYCODE_CLEAR = 5, + KEYCODE_HEADSETHOOK = 6, + KEYCODE_FOCUS = 7, + KEYCODE_NOTIFICATION = 8, + KEYCODE_SEARCH = 9, + 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_VOICE_ASSISTANT = 20, + KEYCODE_CUSTOM1 = 21, + KEYCODE_VOLUME_MUTE = 22, + KEYCODE_MUTE = 23, + KEYCODE_BRIGHTNESS_UP = 40, + KEYCODE_BRIGHTNESS_DOWN = 41, + KEYCODE_WEAR_1 = 1001, + 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_BUTTON_A = 2301, + KEYCODE_BUTTON_B = 2302, + KEYCODE_BUTTON_C = 2303, + KEYCODE_BUTTON_X = 2304, + KEYCODE_BUTTON_Y = 2305, + KEYCODE_BUTTON_Z = 2306, + KEYCODE_BUTTON_L1 = 2307, + KEYCODE_BUTTON_R1 = 2308, + KEYCODE_BUTTON_L2 = 2309, + KEYCODE_BUTTON_R2 = 2310, + KEYCODE_BUTTON_SELECT = 2311, + KEYCODE_BUTTON_START = 2312, + KEYCODE_BUTTON_MODE = 2313, + KEYCODE_BUTTON_THUMBL = 2314, + KEYCODE_BUTTON_THUMBR = 2315, + KEYCODE_BUTTON_TRIGGER = 2401, + KEYCODE_BUTTON_THUMB = 2402, + KEYCODE_BUTTON_THUMB2 = 2403, + KEYCODE_BUTTON_TOP = 2404, + KEYCODE_BUTTON_TOP2 = 2405, + KEYCODE_BUTTON_PINKIE = 2406, + KEYCODE_BUTTON_BASE1 = 2407, + KEYCODE_BUTTON_BASE2 = 2408, + KEYCODE_BUTTON_BASE3 = 2409, + KEYCODE_BUTTON_BASE4 = 2410, + KEYCODE_BUTTON_BASE5 = 2411, + KEYCODE_BUTTON_BASE6 = 2412, + KEYCODE_BUTTON_BASE7 = 2413, + KEYCODE_BUTTON_BASE8 = 2414, + KEYCODE_BUTTON_BASE9 = 2415, + KEYCODE_BUTTON_DEAD = 2416, + 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, + KEYCODE_BRL_DOT1 = 3201, + KEYCODE_BRL_DOT2 = 3202, + KEYCODE_BRL_DOT3 = 3203, + KEYCODE_BRL_DOT4 = 3204, + KEYCODE_BRL_DOT5 = 3205, + KEYCODE_BRL_DOT6 = 3206, + KEYCODE_BRL_DOT7 = 3207, + KEYCODE_BRL_DOT8 = 3208, + KEYCODE_BRL_DOT9 = 3209, + KEYCODE_BRL_DOT10 = 3210, + KEYCODE_LEFT_KNOB_ROLL_UP = 10001, + KEYCODE_LEFT_KNOB_ROLL_DOWN = 10002, + KEYCODE_LEFT_KNOB = 10003, + KEYCODE_RIGHT_KNOB_ROLL_UP = 10004, + KEYCODE_RIGHT_KNOB_ROLL_DOWN = 10005, + KEYCODE_RIGHT_KNOB = 10006, + KEYCODE_VOICE_SOURCE_SWITCH = 10007, + KEYCODE_LAUNCHER_MENU = 10008, } diff --git a/api/@ohos.multimodalInput.keyEvent.d.ts b/api/@ohos.multimodalInput.keyEvent.d.ts index 242d7f0b00..88e9933d66 100644 --- a/api/@ohos.multimodalInput.keyEvent.d.ts +++ b/api/@ohos.multimodalInput.keyEvent.d.ts @@ -25,57 +25,57 @@ import { KeyCode } from "./@ohos.multimodalInput.keyCode" */ export enum Action { - // 取消 - Cancel = 0, - // 按钮按下 - Down = 1, - // 按钮抬起 - Up = 2, + // 取消 + Cancel = 0, + // 按钮按下 + Down = 1, + // 按钮抬起 + Up = 2, } export interface Key { - // 按键码 - code: KeyCode; - // 按下时间 - pressedTime: number; - // 按键所属设备 - deviceId: number; + // 按键码 + code: KeyCode; + // 按下时间 + pressedTime: number; + // 按键所属设备 + deviceId: number; } export declare interface KeyEvent extends InputEvent { - // 按键动作 - action: Action; + // 按键动作 + action: Action; - // 本次发生变化的按键 - key: Key; + // 本次发生变化的按键 + key: Key; - // unideCode编码 - unicodeChar: number; + // unideCode编码 + unicodeChar: number; - // 当前处于按下状态的按键列表 - keys: Key[]; + // 当前处于按下状态的按键列表 + keys: Key[]; - // 当前ctrlKey是否处于按下状态 - readonly ctrlKey: boolean + // 当前ctrlKey是否处于按下状态 + readonly ctrlKey: boolean - // 当前altKey是否处于按下状态 - readonly altKey: boolean + // 当前altKey是否处于按下状态 + readonly altKey: boolean - // 当前shiftKey是否处于按下状态 - readonly shiftKey: boolean + // 当前shiftKey是否处于按下状态 + readonly shiftKey: boolean - // 当前metaKey是否处于按下状态 - readonly metaKey: boolean + // 当前metaKey是否处于按下状态 + readonly metaKey: boolean - // 当前fnKey是否处于按下状态 - readonly fnKey: boolean + // 当前fnKey是否处于按下状态 + readonly fnKey: boolean - // 当前capsLock是否处于激活状态 - capsLock: boolean + // 当前capsLock是否处于激活状态 + capsLock: boolean - // 当前numLock是否处于激活状态 - numLock: boolean + // 当前numLock是否处于激活状态 + numLock: boolean - // 当前scrollLock是否处于激活状态 - scrollLock: boolean + // 当前scrollLock是否处于激活状态 + scrollLock: boolean } \ No newline at end of file diff --git a/api/@ohos.multimodalInput.mouseEvent.d.ts b/api/@ohos.multimodalInput.mouseEvent.d.ts index ece01e3956..5ad91ddcdd 100644 --- a/api/@ohos.multimodalInput.mouseEvent.d.ts +++ b/api/@ohos.multimodalInput.mouseEvent.d.ts @@ -26,132 +26,132 @@ import { KeyCode } from "./@ohos.multimodalInput.keyCode" */ export enum Action { - // 取消 - Cancel = 0, + // 取消 + Cancel = 0, - // 鼠标移动 - Move = 1, + // 鼠标移动 + Move = 1, - // 鼠标按钮按下 - ButtonDown = 2, + // 鼠标按钮按下 + ButtonDown = 2, - // 鼠标按钮抬起 - ButtonUp = 3, + // 鼠标按钮抬起 + ButtonUp = 3, - // 鼠标关联的轴事件开始 - AxisBegin = 4, + // 鼠标关联的轴事件开始 + AxisBegin = 4, - // 鼠标关联的轴事件更新 - AxisUpdate = 5, + // 鼠标关联的轴事件更新 + AxisUpdate = 5, - // 鼠标关联的轴事件结束 - AxisEnd = 6, + // 鼠标关联的轴事件结束 + AxisEnd = 6, } export enum Button { - // 鼠标左键 - Left = 0, + // 鼠标左键 + Left = 0, - // 鼠标中键 - Middle = 1, + // 鼠标中键 + Middle = 1, - // 鼠标右键 - Right = 2, + // 鼠标右键 + Right = 2, - // 鼠标侧边键 - Side = 3, + // 鼠标侧边键 + Side = 3, - // 鼠标扩展键 - Extra = 4, + // 鼠标扩展键 + Extra = 4, - // 鼠标前进键 - Forward = 5, + // 鼠标前进键 + Forward = 5, - // 鼠标后退键 - Back = 6, + // 鼠标后退键 + Back = 6, - // 鼠标任务键 - Task = 7 + // 鼠标任务键 + Task = 7 } export enum Axis { - // 垂直滚动轴 - ScrollVertical = 0, + // 垂直滚动轴 + ScrollVertical = 0, - // 水平滚动轴 - ScrollHorizontal = 1, + // 水平滚动轴 + ScrollHorizontal = 1, - // 捏合轴 - Pinch = 2, + // 捏合轴 + Pinch = 2, } export interface AxisValue { - // 轴类型 - axis: Axis; + // 轴类型 + axis: Axis; - // 轴的值 - value: number + // 轴的值 + value: number } export declare interface MouseEvent extends InputEvent { - // 鼠标事件动作 - action: Action; + // 鼠标事件动作 + action: Action; - // 鼠标光标在屏幕中的x坐标 - screenX: number; + // 鼠标光标在屏幕中的x坐标 + screenX: number; - // 鼠标光标在屏幕中的y坐标 - screenY: number; + // 鼠标光标在屏幕中的y坐标 + screenY: number; - // 鼠标归属窗口的x坐标 - windowX: number; + // 鼠标归属窗口的x坐标 + windowX: number; - // 鼠标归属窗口的y坐标 - windowY: number; + // 鼠标归属窗口的y坐标 + windowY: number; - // 相对上次上报鼠标位置的相对X偏移,在屏幕边缘位置时,该值可能小于两次鼠标上报的坐标差 - rawDeltaX: number; + // 相对上次上报鼠标位置的相对X偏移,在屏幕边缘位置时,该值可能小于两次鼠标上报的坐标差 + rawDeltaX: number; - // 相对上次上报鼠标位置的相对Y偏移,在屏幕边缘位置时,该值可能小于两次鼠标上报的坐标差 - rawDeltaY: number; + // 相对上次上报鼠标位置的相对Y偏移,在屏幕边缘位置时,该值可能小于两次鼠标上报的坐标差 + rawDeltaY: number; - // 按钮按下/抬起时的按钮 - button: Button; + // 按钮按下/抬起时的按钮 + button: Button; - // 当前处于按下状态的按钮 - pressedButtons: Button[]; + // 当前处于按下状态的按钮 + pressedButtons: Button[]; - // 当前action为AxisBegin/AxisUpdate/AxisEnd时,相关的轴的数据 - axes: AxisValue[]; + // 当前action为AxisBegin/AxisUpdate/AxisEnd时,相关的轴的数据 + axes: AxisValue[]; - // 当前处于按下状态的按键列表 - pressedKeys: KeyCode[]; + // 当前处于按下状态的按键列表 + pressedKeys: KeyCode[]; - // 当前ctrlKey是否处于按下状态 - readonly ctrlKey: boolean; + // 当前ctrlKey是否处于按下状态 + readonly ctrlKey: boolean; - // 当前altKey是否处于按下状态 - readonly altKey: boolean; + // 当前altKey是否处于按下状态 + readonly altKey: boolean; - // 当前shiftKey是否处于按下状态 - readonly shiftKey: boolean; + // 当前shiftKey是否处于按下状态 + readonly shiftKey: boolean; - // 当前metaKey是否处于按下状态 - readonly metaKey: boolean; + // 当前metaKey是否处于按下状态 + readonly metaKey: boolean; - // 当前fnKey是否处于按下状态 - readonly fnKey:boolean - - // 当前capsLock是否处于激活状态 - capsLock:boolean - - // 当前numLock是否处于激活状态 - numLock:boolean - - // 当前scrollLock是否处于激活状态 - scrollLock:boolean - - // 指定按键是否处于按下状态 - isKeyDown(keyCode:KeyCode):boolean + // 当前fnKey是否处于按下状态 + readonly fnKey:boolean + + // 当前capsLock是否处于激活状态 + capsLock:boolean + + // 当前numLock是否处于激活状态 + numLock:boolean + + // 当前scrollLock是否处于激活状态 + scrollLock:boolean + + // 指定按键是否处于按下状态 + isKeyDown(keyCode:KeyCode):boolean } \ No newline at end of file diff --git a/api/@ohos.multimodalInput.touchEvent.d.ts b/api/@ohos.multimodalInput.touchEvent.d.ts index 913697b134..6e0db97e5f 100644 --- a/api/@ohos.multimodalInput.touchEvent.d.ts +++ b/api/@ohos.multimodalInput.touchEvent.d.ts @@ -24,108 +24,108 @@ import { InputEvent } from './@ohos.multimodalInput.inputEvent' */ export enum Action { - // 触摸取消 - Cancel = 0, + // 触摸取消 + Cancel = 0, - // 触摸按下 - Down = 1, + // 触摸按下 + Down = 1, - // 触摸移动 - Move = 2, + // 触摸移动 + Move = 2, - // 触摸抬起 - Up = 3, + // 触摸抬起 + Up = 3, } export enum ToolType { - // 手指 - Finger = 0, + // 手指 + Finger = 0, - // 笔 - Pen = 1, + // 笔 + Pen = 1, - Rubber = 2, + Rubber = 2, - Brush = 3, + Brush = 3, - Pencil = 4, + Pencil = 4, - Airbrush = 5, + Airbrush = 5, - Mouse = 6, + Mouse = 6, - Lens = 7, + Lens = 7, } export enum SourceType { - // 触摸屏 - TouchScreen = 0, + // 触摸屏 + TouchScreen = 0, - // 手写笔 - Pen = 1, + // 手写笔 + Pen = 1, } export interface Touch { - // 指针标识,整型 >= 0 有效 - readonly id: number; + // 指针标识,整型 >= 0 有效 + readonly id: number; - // 按下时刻的时间戳 - pressedTime: number; + // 按下时刻的时间戳 + pressedTime: number; - // 触摸位置所属的屏幕x坐标 - screenX: number; + // 触摸位置所属的屏幕x坐标 + screenX: number; - // 触摸位置所属的屏幕y坐标 - screenY: number; + // 触摸位置所属的屏幕y坐标 + screenY: number; - // 触摸位置在窗口中的x坐标 - windowX: number; + // 触摸位置在窗口中的x坐标 + windowX: number; - // 触摸位置在窗口中的y坐标 - windowY: number; + // 触摸位置在窗口中的y坐标 + windowY: number; - // 压力值 [0.0, 1.0], 0.0表示不支持 - pressure: number; + // 压力值 [0.0, 1.0], 0.0表示不支持 + pressure: number; - // 按下接触区域的宽度 - width: number; + // 按下接触区域的宽度 + width: number; - // 按下接触区域的高度 - height: number; + // 按下接触区域的高度 + height: number; - // 相对YZ平面的角度,值的范围为-90到90(含),其中正值是向右倾斜。 - tiltX: number; + // 相对YZ平面的角度,值的范围为-90到90(含),其中正值是向右倾斜。 + tiltX: number; - // 相对XZ平面的角度,值的范围为-90到90(含),其中正值是向下倾斜。 - tiltY: number; + // 相对XZ平面的角度,值的范围为-90到90(含),其中正值是向下倾斜。 + tiltY: number; - // 工具区域的中心点X - toolX: number; + // 工具区域的中心点X + toolX: number; - // 工具区域的中心点Y - toolY: number; + // 工具区域的中心点Y + toolY: number; - // 工具区域宽度 - toolWidth: number; + // 工具区域宽度 + toolWidth: number; - // 工具区域高度 - toolHeight: number; + // 工具区域高度 + toolHeight: number; - // 工具类型 - toolType: ToolType; + // 工具类型 + toolType: ToolType; } export declare interface TouchEvent extends InputEvent { - // 触摸动作 - action: Action; + // 触摸动作 + action: Action; - // 当前触摸 - touch: Touch; + // 当前触摸 + touch: Touch; - // 所有触摸 - touches: Touch[]; + // 所有触摸 + touches: Touch[]; - // 触摸来源的设备类型 - sourceType: SourceType; + // 触摸来源的设备类型 + sourceType: SourceType; } \ No newline at end of file -- Gitee From 9ab665715857a3dd3ac7be4a5a5ff5fff67c378f Mon Sep 17 00:00:00 2001 From: hungry_feiwei Date: Sun, 24 Apr 2022 10:06:29 +0800 Subject: [PATCH 11/33] add interface Signed-off-by: hungry_feiwei --- ...ohos.multimodalInput.distributedInput.d.ts | 114 +++++++++--------- api/@ohos.multimodalInput.inputEvent.d.ts | 20 +-- 2 files changed, 67 insertions(+), 67 deletions(-) diff --git a/api/@ohos.multimodalInput.distributedInput.d.ts b/api/@ohos.multimodalInput.distributedInput.d.ts index 7e0b160012..b9829e4870 100644 --- a/api/@ohos.multimodalInput.distributedInput.d.ts +++ b/api/@ohos.multimodalInput.distributedInput.d.ts @@ -23,68 +23,68 @@ import { AsyncCallback } from "./basic"; * @import import distributedInput from '@ohos.multimodalInput.distributedInput', */ declare namespace distributedInput { - enum InputAbility { - Mouse = 0, - Keyboard = 1, - Touchscreen = 2, - Touchpad = 3, - } + enum InputAbility { + Mouse = 0, + Keyboard = 1, + Touchscreen = 2, + Touchpad = 3, + } - /** - * 查询分布式设备输入能力 - * - * @since 9 - * @syscap SystemCapability.MultimodalInput.Input.RemoteInputDevice - * @param deviceId 表示查询分布式输入能力的那台设备的ID. - * @return - - */ - function getRemoteInputAbility(deviceId: number, callback: AsyncCallback>): void; - function getRemoteInputAbility(deviceId: number): Promise>; + /** + * 查询分布式设备输入能力 + * + * @since 9 + * @syscap SystemCapability.MultimodalInput.Input.RemoteInputDevice + * @param deviceId 表示查询分布式输入能力的那台设备的ID. + * @return - + */ + function getRemoteInputAbility(deviceId: number, callback: AsyncCallback>): void; + function getRemoteInputAbility(deviceId: number): Promise>; - /** - * 准备分布式 - * - * @since 9 - * @syscap SystemCapability.MultimodalInput.Input.RemoteInputDevice - * @param deviceId 表示准备分布式的那台设备的ID. - * @return - - */ - function prepareRemoteInput(deviceId: number, callback: AsyncCallback): void; - function prepareRemoteInput(deviceId: number): Promise; + /** + * 准备分布式 + * + * @since 9 + * @syscap SystemCapability.MultimodalInput.Input.RemoteInputDevice + * @param deviceId 表示准备分布式的那台设备的ID. + * @return - + */ + function prepareRemoteInput(deviceId: number, callback: AsyncCallback): void; + function prepareRemoteInput(deviceId: number): Promise; - /** - * 取消准备分布式 - * - * @since 9 - * @syscap SystemCapability.MultimodalInput.Input.RemoteInputDevice - * @param deviceId 表示准备分布式的那台设备的ID. - * @return - - */ - function unprepareRemoteInput(deviceId: number, callback: AsyncCallback): void; - function unprepareRemoteInput(deviceId: number): Promise; + /** + * 取消准备分布式 + * + * @since 9 + * @syscap SystemCapability.MultimodalInput.Input.RemoteInputDevice + * @param deviceId 表示准备分布式的那台设备的ID. + * @return - + */ + function unprepareRemoteInput(deviceId: number, callback: AsyncCallback): void; + function unprepareRemoteInput(deviceId: number): Promise; - /** - * 停止分布式 - * - * @since 9 - * @syscap SystemCapability.MultimodalInput.Input.RemoteInputDevice - * @param deviceId 表示准备分布式的那台设备的ID. - * @return - - */ - function stopRemoteInput(deviceId: number, callback: AsyncCallback): void; - function stopRemoteInput(deviceId: number): Promise; + /** + * 停止分布式 + * + * @since 9 + * @syscap SystemCapability.MultimodalInput.Input.RemoteInputDevice + * @param deviceId 表示准备分布式的那台设备的ID. + * @return - + */ + function stopRemoteInput(deviceId: number, callback: AsyncCallback): void; + function stopRemoteInput(deviceId: number): Promise; - /** - * 鼠标位置设定 - * - * @since 9 - * @syscap SystemCapability.MultimodalInput.Input.RemoteInputDevice - * @param mouseX x坐标 - * @param mouseY y坐标 - * @return - - */ - function setPointerLocation(mouseX: number, mouseY: number, callback: AsyncCallback): void; - function setPointerLocation(deviceId: number, mouseY: number): Promise; + /** + * 鼠标位置设定 + * + * @since 9 + * @syscap SystemCapability.MultimodalInput.Input.RemoteInputDevice + * @param mouseX x坐标 + * @param mouseY y坐标 + * @return - + */ + function setPointerLocation(mouseX: number, mouseY: number, callback: AsyncCallback): void; + function setPointerLocation(deviceId: number, mouseY: number): Promise; } export default distributedInput; \ No newline at end of file diff --git a/api/@ohos.multimodalInput.inputEvent.d.ts b/api/@ohos.multimodalInput.inputEvent.d.ts index 4a7233b875..bfc5062381 100644 --- a/api/@ohos.multimodalInput.inputEvent.d.ts +++ b/api/@ohos.multimodalInput.inputEvent.d.ts @@ -24,18 +24,18 @@ */ export declare interface InputEvent { - // 事件id,服务端生成,全局唯一 - readonly id: number; + // 事件id,服务端生成,全局唯一 + readonly id: number; - // 上报输入事件的设备id, 整型数字,>=0 有效 - deviceId: number; + // 上报输入事件的设备id, 整型数字,>=0 有效 + deviceId: number; - // 事件发生事件 - actionTime: number; + // 事件发生事件 + actionTime: number; - // 目标屏幕id, 整型数字,>=0 有效 - screenId: number; + // 目标屏幕id, 整型数字,>=0 有效 + screenId: number; - // 目标窗口id, 整型数字, >=0 有效 - windowId: number; + // 目标窗口id, 整型数字, >=0 有效 + windowId: number; } \ No newline at end of file -- Gitee From cf1ddf248aca42c40376a66856dac0f69d055963 Mon Sep 17 00:00:00 2001 From: hungry_feiwei Date: Sun, 24 Apr 2022 13:21:01 +0800 Subject: [PATCH 12/33] add interface Signed-off-by: hungry_feiwei --- api/@ohos.multimodalInput.axisEvent.d.ts | 4 ++-- api/@ohos.multimodalInput.inputDevice.d.ts | 20 +++++++++++++++++++- api/@ohos.multimodalInput.keyEvent.d.ts | 4 ++-- api/@ohos.multimodalInput.mouseEvent.d.ts | 4 ++-- 4 files changed, 25 insertions(+), 7 deletions(-) diff --git a/api/@ohos.multimodalInput.axisEvent.d.ts b/api/@ohos.multimodalInput.axisEvent.d.ts index 385ea90b72..3333e12052 100644 --- a/api/@ohos.multimodalInput.axisEvent.d.ts +++ b/api/@ohos.multimodalInput.axisEvent.d.ts @@ -70,8 +70,8 @@ export declare interface MouseEvent extends InputEvent { // 当前shiftKey是否处于按下状态 readonly shiftKey: boolean - // 当前metaKey是否处于按下状态 - readonly metaKey: boolean + // 当前logoKey是否处于按下状态 + readonly logoKey: boolean // 当前fnKey是否处于按下状态 readonly fnKey: boolean diff --git a/api/@ohos.multimodalInput.inputDevice.d.ts b/api/@ohos.multimodalInput.inputDevice.d.ts index 6b34e61811..e7b7087442 100644 --- a/api/@ohos.multimodalInput.inputDevice.d.ts +++ b/api/@ohos.multimodalInput.inputDevice.d.ts @@ -40,7 +40,25 @@ declare namespace inputDevice { RemoteControl = 5, } - enum PointerStyle { } + enum PointerStyle { + NormalSelect, + HelpSelect, + WorkingInBackground, + Busy, + PrecisionSelect, + NextSelect, + Handwriting, + Unavailable, + VeticalResize, + HorizontalResize, + DiagonalResize1, + DiagonalResize2, + Move, + AlternateSelect, + LinkSelect, + LocationSelect, + PersonSelect, + } /** * Defines the listener for input device events. diff --git a/api/@ohos.multimodalInput.keyEvent.d.ts b/api/@ohos.multimodalInput.keyEvent.d.ts index 88e9933d66..a9a2f1be34 100644 --- a/api/@ohos.multimodalInput.keyEvent.d.ts +++ b/api/@ohos.multimodalInput.keyEvent.d.ts @@ -64,8 +64,8 @@ export declare interface KeyEvent extends InputEvent { // 当前shiftKey是否处于按下状态 readonly shiftKey: boolean - // 当前metaKey是否处于按下状态 - readonly metaKey: boolean + // 当前logoKey是否处于按下状态 + readonly logoKey: boolean // 当前fnKey是否处于按下状态 readonly fnKey: boolean diff --git a/api/@ohos.multimodalInput.mouseEvent.d.ts b/api/@ohos.multimodalInput.mouseEvent.d.ts index 5ad91ddcdd..bdfe335fae 100644 --- a/api/@ohos.multimodalInput.mouseEvent.d.ts +++ b/api/@ohos.multimodalInput.mouseEvent.d.ts @@ -137,8 +137,8 @@ export declare interface MouseEvent extends InputEvent { // 当前shiftKey是否处于按下状态 readonly shiftKey: boolean; - // 当前metaKey是否处于按下状态 - readonly metaKey: boolean; + // 当前logoKey是否处于按下状态 + readonly logoKey: boolean; // 当前fnKey是否处于按下状态 readonly fnKey:boolean -- Gitee From f5a73aacce63faa5033f4aebd98e36e10b1eb72f Mon Sep 17 00:00:00 2001 From: hungry_feiwei Date: Sun, 24 Apr 2022 19:09:08 +0800 Subject: [PATCH 13/33] add interface Signed-off-by: hungry_feiwei --- api/@ohos.multimodalInput.axisEvent.d.ts | 72 ++++++++----- ...ohos.multimodalInput.distributedInput.d.ts | 20 +--- api/@ohos.multimodalInput.inputDevice.d.ts | 100 +++++++++++++----- api/@ohos.multimodalInput.inputEvent.d.ts | 2 +- api/@ohos.multimodalInput.keyEvent.d.ts | 26 ++--- api/@ohos.multimodalInput.mouseEvent.d.ts | 58 +++++----- api/@ohos.multimodalInput.touchEvent.d.ts | 47 ++++---- 7 files changed, 191 insertions(+), 134 deletions(-) diff --git a/api/@ohos.multimodalInput.axisEvent.d.ts b/api/@ohos.multimodalInput.axisEvent.d.ts index 3333e12052..669a8fcf9a 100644 --- a/api/@ohos.multimodalInput.axisEvent.d.ts +++ b/api/@ohos.multimodalInput.axisEvent.d.ts @@ -16,75 +16,97 @@ import { InputEvent } from "./@ohos.multimodalInput.inputEvent" import { KeyCode } from "./@ohos.multimodalInput.keyCode" /** -* MouseEvent +* Action * * @since 9 * @syscap SystemCapability.MultimodalInput.Input.Core * @import import {MouseEvent} from '@ohos.multimodalInput.mouseEvent'; * @permission N/A */ - -export enum Action { +export declare enum Action { // 取消 - Cancel = 0, + CANCEL = 0, // 鼠标关联的轴事件开始 - AxisBegin = 4, + AXIS_BEGIN = 4, // 鼠标关联的轴事件更新 - AxisUpdate = 5, + AXIS_UPDATE = 5, // 鼠标关联的轴事件结束 - AxisEnd = 6, + AXIS_END = 6, } -export enum Axis { +/** +* Axis +* +* @since 9 +* @syscap SystemCapability.MultimodalInput.Input.Core +* @import import {MouseEvent} from '@ohos.multimodalInput.mouseEvent'; +* @permission N/A +*/ +export declare enum Axis { // 垂直滚动轴 - ScrollVertical = 0, + SCROLL_VERTICAL = 0, + // 水平滚动轴 - ScrollHorizontal = 1, + SCEOLL_HORIZONTAL = 1, + // 捏合轴 - Pinch = 2, + PINCH = 2, } -export interface AxisValue { +/** +* AxisValue +* +* @since 9 +* @syscap SystemCapability.MultimodalInput.Input.Core +* @import import {MouseEvent} from '@ohos.multimodalInput.mouseEvent'; +* @permission N/A +*/ +export declare interface AxisValue { // 轴类型 axis: Axis; // 轴的值 value: number } +/** +* MouseEvent +* +* @since 9 +* @syscap SystemCapability.MultimodalInput.Input.Core +* @import import {MouseEvent} from '@ohos.multimodalInput.mouseEvent'; +* @permission N/A +*/ export declare interface MouseEvent extends InputEvent { // 轴事件动作 action: Action; // 轴的数据 - axes: AxisValue[], + axes: AxisValue[]; // 当前处于按下状态的按键列表 - pressedKeys: KeyCode[], + pressedKeys: KeyCode[]; // 当前ctrlKey是否处于按下状态 - readonly ctrlKey: boolean + readonly ctrlKey: boolean; // 当前altKey是否处于按下状态 - readonly altKey: boolean + readonly altKey: boolean; // 当前shiftKey是否处于按下状态 - readonly shiftKey: boolean + readonly shiftKey: boolean; // 当前logoKey是否处于按下状态 - readonly logoKey: boolean + readonly logoKey: boolean; // 当前fnKey是否处于按下状态 - readonly fnKey: boolean + readonly fnKey: boolean; // 当前capsLock是否处于激活状态 - capsLock: boolean + capsLock: boolean; // 当前numLock是否处于激活状态 - numLock: boolean + numLock: boolean; // 当前scrollLock是否处于激活状态 - scrollLock: boolean - - // 指定按键是否处于按下状态 - isKeyDown(keyCode: KeyCode): boolean + scrollLock: boolean; } \ No newline at end of file diff --git a/api/@ohos.multimodalInput.distributedInput.d.ts b/api/@ohos.multimodalInput.distributedInput.d.ts index b9829e4870..176edbcf93 100644 --- a/api/@ohos.multimodalInput.distributedInput.d.ts +++ b/api/@ohos.multimodalInput.distributedInput.d.ts @@ -24,10 +24,10 @@ import { AsyncCallback } from "./basic"; */ declare namespace distributedInput { enum InputAbility { - Mouse = 0, - Keyboard = 1, - Touchscreen = 2, - Touchpad = 3, + MOUSE = 0, + KEYBOARD = 1, + TOUCH_SCREEN = 2, + TOUCH_PAD = 3, } /** @@ -73,18 +73,6 @@ declare namespace distributedInput { */ function stopRemoteInput(deviceId: number, callback: AsyncCallback): void; function stopRemoteInput(deviceId: number): Promise; - - /** - * 鼠标位置设定 - * - * @since 9 - * @syscap SystemCapability.MultimodalInput.Input.RemoteInputDevice - * @param mouseX x坐标 - * @param mouseY y坐标 - * @return - - */ - function setPointerLocation(mouseX: number, mouseY: number, callback: AsyncCallback): void; - function setPointerLocation(deviceId: number, mouseY: number): 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 e7b7087442..dc94e406a0 100644 --- a/api/@ohos.multimodalInput.inputDevice.d.ts +++ b/api/@ohos.multimodalInput.inputDevice.d.ts @@ -29,35 +29,35 @@ declare namespace inputDevice { type SourceType = 'keyboard' | 'mouse' | 'touchpad' | 'touchscreen' | 'joystick' | 'trackball'; - type AxisType = 'touchMajor' | 'touchMinor' | 'orientation' | 'positionX' | 'positionY' | 'pressure' | 'toolX' | 'toolY'; + type AxisType = 'touchMajor' | 'touchMinor' | 'orientation' | 'x' | 'y' | 'pressure' | 'toolMinor' | 'touchMajor'; enum KeyboardType { - None = 0, - Unknown = 1, - AlphabeticKeyboard = 2, - DigitalKeyboard = 3, - HandwritingPen = 4, - RemoteControl = 5, + NONE = 0, + UNKNOWN = 1, + ALPHABETIC_KEYBOARD = 2, + DIGITAL_KEYBOARD = 3, + HANDWRITING_PEN = 4, + REMOTE_CONTROL = 5, } enum PointerStyle { - NormalSelect, - HelpSelect, - WorkingInBackground, - Busy, - PrecisionSelect, - NextSelect, - Handwriting, - Unavailable, - VeticalResize, - HorizontalResize, - DiagonalResize1, - DiagonalResize2, - Move, - AlternateSelect, - LinkSelect, - LocationSelect, - PersonSelect, + NORMAL_SELECT, + HELP_SELECT, + WORKING_IN_BACKGROUND, + BUSY, + PRECISION_SELECT, + NEXT_SELECT, + HANDWRITING, + UNAVAILABLE, + VETICAL_RESIZE, + HORIZONTAL_RESIZE, + DIAGONAL_RESIZE_1, + DIAGONAL_RESIZE_2, + MOVE, + ALTERNATE_SELECT, + LINK_SELECT, + LOCATION_SELECT, + PERSON_SELECT, } /** @@ -153,8 +153,8 @@ declare namespace inputDevice { * @param product 产品 * @param vendor 厂商 * @param version 版本 - * @param phys 物理名称 - * @param uniq 唯一标识 + * @param phys 物理路径 + * @param uniq 唯一标识符 */ interface InputDeviceData { /** @@ -238,8 +238,8 @@ declare namespace inputDevice { * @param keys Key codes of the input device. 最多一次查询5个按键码 * @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>>; + function supportKeys(deviceId: number, keys: Array, callback: Callback>): void; + function supportKeys(deviceId: number, keys: Array): Promise>; /** * 设置光标移动速度 @@ -248,7 +248,17 @@ declare namespace inputDevice { * @syscap SystemCapability.MultimodalInput.Input.InputDevice * @param speed 光标移动速度。 */ - function setPointerSpeed(speed: number): void; + function setPointerSpeed(speed: number, callback: AsyncCallback): void; + function setPointerSpeed(speed: number): Promise; + + /** + * 获取光标移动速度 + * + * @since 9 + * @syscap SystemCapability.MultimodalInput.Input.InputDevice + */ + function getPointerSpeed(callback: AsyncCallback): void; + function getPointerSpeed(): Promise; /** * 查询输入设备的键盘类型 @@ -272,6 +282,16 @@ declare namespace inputDevice { function setPointerVisible(visible: boolean, callback: AsyncCallback): void; function setPointerVisible(visible: boolean): Promise; + /** + * 获取光标是否可见 + * + * @since 9 + * @syscap SystemCapability.MultimodalInput.Input.InputDevice + * @return callback function, receive reported data + */ + function isPointerVisible(callback: AsyncCallback): void; + function isPointerVisible(): Promise; + /** * 设置鼠标样式 * @@ -282,6 +302,28 @@ declare namespace inputDevice { */ function setPointerStyle(pointerStyle: PointerStyle, callback: AsyncCallback): void; function setPointerStyle(pointerStyle: PointerStyle): Promise; + +/** + * 获取鼠标样式 + * + * @since 9 + * @syscap SystemCapability.MultimodalInput.Input.InputDevice + * @return callback function, receive reported data + */ + function getPointerStyle(callback: AsyncCallback): void; + function getPointerStyle(): Promise; + + /** + * 鼠标位置设定 + * + * @since 9 + * @syscap SystemCapability.MultimodalInput.Input.RemoteInputDevice + * @param x x坐标 + * @param y y坐标 + * @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 index bfc5062381..4c6e9e0f85 100644 --- a/api/@ohos.multimodalInput.inputEvent.d.ts +++ b/api/@ohos.multimodalInput.inputEvent.d.ts @@ -25,7 +25,7 @@ export declare interface InputEvent { // 事件id,服务端生成,全局唯一 - readonly id: number; + id: number; // 上报输入事件的设备id, 整型数字,>=0 有效 deviceId: number; diff --git a/api/@ohos.multimodalInput.keyEvent.d.ts b/api/@ohos.multimodalInput.keyEvent.d.ts index a9a2f1be34..f0c645d438 100644 --- a/api/@ohos.multimodalInput.keyEvent.d.ts +++ b/api/@ohos.multimodalInput.keyEvent.d.ts @@ -24,16 +24,16 @@ import { KeyCode } from "./@ohos.multimodalInput.keyCode" * @permission N/A */ -export enum Action { +export declare enum Action { // 取消 - Cancel = 0, + CANCEL = 0, // 按钮按下 - Down = 1, + DOWN = 1, // 按钮抬起 - Up = 2, + UP = 2, } -export interface Key { +export declare interface Key { // 按键码 code: KeyCode; // 按下时间 @@ -56,26 +56,26 @@ export declare interface KeyEvent extends InputEvent { keys: Key[]; // 当前ctrlKey是否处于按下状态 - readonly ctrlKey: boolean + ctrlKey: boolean; // 当前altKey是否处于按下状态 - readonly altKey: boolean + altKey: boolean; // 当前shiftKey是否处于按下状态 - readonly shiftKey: boolean + shiftKey: boolean; // 当前logoKey是否处于按下状态 - readonly logoKey: boolean + logoKey: boolean; // 当前fnKey是否处于按下状态 - readonly fnKey: boolean + fnKey: boolean; // 当前capsLock是否处于激活状态 - capsLock: boolean + capsLock: boolean; // 当前numLock是否处于激活状态 - numLock: boolean + numLock: boolean; // 当前scrollLock是否处于激活状态 - scrollLock: boolean + scrollLock: boolean; } \ No newline at end of file diff --git a/api/@ohos.multimodalInput.mouseEvent.d.ts b/api/@ohos.multimodalInput.mouseEvent.d.ts index bdfe335fae..3cc1d19273 100644 --- a/api/@ohos.multimodalInput.mouseEvent.d.ts +++ b/api/@ohos.multimodalInput.mouseEvent.d.ts @@ -25,68 +25,67 @@ import { KeyCode } from "./@ohos.multimodalInput.keyCode" * @permission N/A */ -export enum Action { +export declare enum Action { // 取消 - Cancel = 0, + CANCEL = 0, // 鼠标移动 - Move = 1, + MOVE = 1, // 鼠标按钮按下 - ButtonDown = 2, + BUTTON_DOWN = 2, // 鼠标按钮抬起 - ButtonUp = 3, + BUTTON_UP = 3, // 鼠标关联的轴事件开始 - AxisBegin = 4, + AXIS_BEGIN = 4, // 鼠标关联的轴事件更新 - AxisUpdate = 5, + AXIS_UPDATE = 5, // 鼠标关联的轴事件结束 - AxisEnd = 6, + AXIS_END = 6, } -export enum Button { +export declare enum Button { // 鼠标左键 - Left = 0, + LEFT = 0, // 鼠标中键 - Middle = 1, + MIDDLE = 1, // 鼠标右键 - Right = 2, + RIGHT = 2, // 鼠标侧边键 - Side = 3, + SIDE = 3, // 鼠标扩展键 - Extra = 4, + EXTRA = 4, // 鼠标前进键 - Forward = 5, + FORWARD = 5, // 鼠标后退键 - Back = 6, + BACK = 6, // 鼠标任务键 - Task = 7 - + TASK = 7 } -export enum Axis { +export declare enum Axis { // 垂直滚动轴 - ScrollVertical = 0, + SCEOLL_VERTICAL = 0, // 水平滚动轴 - ScrollHorizontal = 1, + SCROLL_HORIZONTAL = 1, // 捏合轴 - Pinch = 2, + PINCH = 2, } -export interface AxisValue { +export declare interface AxisValue { // 轴类型 axis: Axis; @@ -129,19 +128,19 @@ export declare interface MouseEvent extends InputEvent { pressedKeys: KeyCode[]; // 当前ctrlKey是否处于按下状态 - readonly ctrlKey: boolean; + ctrlKey: boolean; // 当前altKey是否处于按下状态 - readonly altKey: boolean; + altKey: boolean; // 当前shiftKey是否处于按下状态 - readonly shiftKey: boolean; + shiftKey: boolean; // 当前logoKey是否处于按下状态 - readonly logoKey: boolean; + logoKey: boolean; // 当前fnKey是否处于按下状态 - readonly fnKey:boolean + fnKey:boolean // 当前capsLock是否处于激活状态 capsLock:boolean @@ -151,7 +150,4 @@ export declare interface MouseEvent extends InputEvent { // 当前scrollLock是否处于激活状态 scrollLock:boolean - - // 指定按键是否处于按下状态 - isKeyDown(keyCode:KeyCode):boolean } \ No newline at end of file diff --git a/api/@ohos.multimodalInput.touchEvent.d.ts b/api/@ohos.multimodalInput.touchEvent.d.ts index 6e0db97e5f..6244c5efca 100644 --- a/api/@ohos.multimodalInput.touchEvent.d.ts +++ b/api/@ohos.multimodalInput.touchEvent.d.ts @@ -23,51 +23,54 @@ import { InputEvent } from './@ohos.multimodalInput.inputEvent' * @permission N/A */ -export enum Action { +export declare enum Action { // 触摸取消 - Cancel = 0, + CANCEL = 0, // 触摸按下 - Down = 1, + DOWN = 1, // 触摸移动 - Move = 2, + MOVE = 2, // 触摸抬起 - Up = 3, + UP = 3, } -export enum ToolType { +export declare enum ToolType { // 手指 - Finger = 0, + FINGER = 0, // 笔 - Pen = 1, + PEN = 1, - Rubber = 2, + RUBBER = 2, - Brush = 3, + BRUSH = 3, - Pencil = 4, + PENCIL = 4, - Airbrush = 5, + AIRBRUSH = 5, - Mouse = 6, + MOUSE = 6, - Lens = 7, + LENS = 7, } -export enum SourceType { +export declare enum SourceType { // 触摸屏 - TouchScreen = 0, + TOUCH_SCREEN = 0, // 手写笔 - Pen = 1, + PEN = 1, + + // 触摸板 + TOUCH_PAD = 2, } -export interface Touch { +export declare interface Touch { // 指针标识,整型 >= 0 有效 - readonly id: number; + id: number; // 按下时刻的时间戳 pressedTime: number; @@ -111,6 +114,12 @@ export interface Touch { // 工具区域高度 toolHeight: number; + // 输入设备上的x坐标 + rawX: number; + + //输入设备上的y坐标 + rawY: number; + // 工具类型 toolType: ToolType; } -- Gitee From 18e48ee0a7d08937453ac6c3955e4f9f7fc85d05 Mon Sep 17 00:00:00 2001 From: hungry_feiwei Date: Mon, 25 Apr 2022 09:21:04 +0800 Subject: [PATCH 14/33] add interface Signed-off-by: hungry_feiwei --- api/@ohos.multimodalInput.distributedInput.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/@ohos.multimodalInput.distributedInput.d.ts b/api/@ohos.multimodalInput.distributedInput.d.ts index 176edbcf93..aeacb9c1c2 100644 --- a/api/@ohos.multimodalInput.distributedInput.d.ts +++ b/api/@ohos.multimodalInput.distributedInput.d.ts @@ -71,8 +71,8 @@ declare namespace distributedInput { * @param deviceId 表示准备分布式的那台设备的ID. * @return - */ - function stopRemoteInput(deviceId: number, callback: AsyncCallback): void; - function stopRemoteInput(deviceId: number): Promise; + function stopRemoteInput(deviceId: number, inputAbilities: Array, callback: AsyncCallback): void; + function stopRemoteInput(deviceId: number, iputAbilities: Array): Promise; } export default distributedInput; \ No newline at end of file -- Gitee From e6e49a6099249e42c62580b8fc4a0571c83c7033 Mon Sep 17 00:00:00 2001 From: hungry_feiwei Date: Mon, 25 Apr 2022 09:25:44 +0800 Subject: [PATCH 15/33] add interface Signed-off-by: hungry_feiwei --- api/@ohos.multimodalInput.inputDevice.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/@ohos.multimodalInput.inputDevice.d.ts b/api/@ohos.multimodalInput.inputDevice.d.ts index dc94e406a0..349c92d98f 100644 --- a/api/@ohos.multimodalInput.inputDevice.d.ts +++ b/api/@ohos.multimodalInput.inputDevice.d.ts @@ -300,8 +300,8 @@ declare namespace inputDevice { * @param pointerStyle 鼠标样式id。 * @return callback function, receive reported data */ - function setPointerStyle(pointerStyle: PointerStyle, callback: AsyncCallback): void; - function setPointerStyle(pointerStyle: PointerStyle): Promise; + function setPointerStyle(pointerStyle: PointerStyle, callback: AsyncCallback): void; + function setPointerStyle(pointerStyle: PointerStyle): Promise; /** * 获取鼠标样式 -- Gitee From fbc933977367e49eb6ae086ad05309e1a6eff872 Mon Sep 17 00:00:00 2001 From: hungry_feiwei Date: Mon, 25 Apr 2022 10:03:29 +0800 Subject: [PATCH 16/33] add interface Signed-off-by: hungry_feiwei --- api/@ohos.multimodalInput.inputDevice.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/@ohos.multimodalInput.inputDevice.d.ts b/api/@ohos.multimodalInput.inputDevice.d.ts index 349c92d98f..752dd0f346 100644 --- a/api/@ohos.multimodalInput.inputDevice.d.ts +++ b/api/@ohos.multimodalInput.inputDevice.d.ts @@ -49,7 +49,7 @@ declare namespace inputDevice { NEXT_SELECT, HANDWRITING, UNAVAILABLE, - VETICAL_RESIZE, + VERTICAL_RESIZE, HORIZONTAL_RESIZE, DIAGONAL_RESIZE_1, DIAGONAL_RESIZE_2, -- Gitee From 0a79751cf18cb18c211a9c689d08972f6e26549a Mon Sep 17 00:00:00 2001 From: hungry_feiwei Date: Mon, 25 Apr 2022 14:33:44 +0800 Subject: [PATCH 17/33] add interface Signed-off-by: hungry_feiwei --- ...ohos.multimodalInput.distributedInput.d.ts | 15 ++++-- api/@ohos.multimodalInput.inputDevice.d.ts | 46 ++++++++++++++++++- api/@ohos.multimodalInput.inputEvent.d.ts | 2 +- api/@ohos.multimodalInput.touchEvent.d.ts | 21 +++++---- 4 files changed, 70 insertions(+), 14 deletions(-) diff --git a/api/@ohos.multimodalInput.distributedInput.d.ts b/api/@ohos.multimodalInput.distributedInput.d.ts index aeacb9c1c2..8abd952763 100644 --- a/api/@ohos.multimodalInput.distributedInput.d.ts +++ b/api/@ohos.multimodalInput.distributedInput.d.ts @@ -24,10 +24,17 @@ import { AsyncCallback } from "./basic"; */ declare namespace distributedInput { enum InputAbility { - MOUSE = 0, - KEYBOARD = 1, - TOUCH_SCREEN = 2, - TOUCH_PAD = 3, + // 鼠标 + Mouse = 0, + + // 按键 + Keyboard = 1, + + // 触摸屏 + Touchscreen = 2, + + // 触摸板 + Touchpad = 3, } /** diff --git a/api/@ohos.multimodalInput.inputDevice.d.ts b/api/@ohos.multimodalInput.inputDevice.d.ts index 752dd0f346..44975a80f0 100644 --- a/api/@ohos.multimodalInput.inputDevice.d.ts +++ b/api/@ohos.multimodalInput.inputDevice.d.ts @@ -32,31 +32,75 @@ declare namespace inputDevice { type AxisType = 'touchMajor' | 'touchMinor' | 'orientation' | 'x' | 'y' | 'pressure' | 'toolMinor' | 'touchMajor'; enum KeyboardType { + // 无按键 NONE = 0, + + // 未知按键 UNKNOWN = 1, + + // 字母键盘 ALPHABETIC_KEYBOARD = 2, + + // 数字按键 DIGITAL_KEYBOARD = 3, + + // 手写笔 HANDWRITING_PEN = 4, + + // 遥控器 REMOTE_CONTROL = 5, - } + } enum PointerStyle { + // 正常选择 NORMAL_SELECT, + + // 协助选择 HELP_SELECT, + + // 后台运行 WORKING_IN_BACKGROUND, + + // 忙碌 BUSY, + + // 精确选择 PRECISION_SELECT, + + // 下一步 NEXT_SELECT, + + // 手写 HANDWRITING, + + // 不可用 UNAVAILABLE, + + // 垂直调整 VERTICAL_RESIZE, + + // 水平调整 HORIZONTAL_RESIZE, + + // 正向对角线调整 DIAGONAL_RESIZE_1, + + // 负向对角线调整 DIAGONAL_RESIZE_2, + + // 移动 MOVE, + + // 备选 ALTERNATE_SELECT, + + // 链接 LINK_SELECT, + + // 位置 LOCATION_SELECT, + + // 人物 PERSON_SELECT, } diff --git a/api/@ohos.multimodalInput.inputEvent.d.ts b/api/@ohos.multimodalInput.inputEvent.d.ts index 4c6e9e0f85..cdb475a2bb 100644 --- a/api/@ohos.multimodalInput.inputEvent.d.ts +++ b/api/@ohos.multimodalInput.inputEvent.d.ts @@ -30,7 +30,7 @@ export declare interface InputEvent { // 上报输入事件的设备id, 整型数字,>=0 有效 deviceId: number; - // 事件发生事件 + // 事件发生时间 actionTime: number; // 目标屏幕id, 整型数字,>=0 有效 diff --git a/api/@ohos.multimodalInput.touchEvent.d.ts b/api/@ohos.multimodalInput.touchEvent.d.ts index 6244c5efca..7d6a66eca9 100644 --- a/api/@ohos.multimodalInput.touchEvent.d.ts +++ b/api/@ohos.multimodalInput.touchEvent.d.ts @@ -39,22 +39,27 @@ export declare enum Action { export declare enum ToolType { // 手指 - FINGER = 0, + Finger = 0, // 笔 - PEN = 1, + Pen = 1, - RUBBER = 2, + // 橡皮擦 + Rubber = 2, - BRUSH = 3, + // 笔刷 + Brush = 3, - PENCIL = 4, + // 铅笔 + Pencil = 4, - AIRBRUSH = 5, + // 气笔 + Airbrush = 5, - MOUSE = 6, + // 鼠标 + Mouse = 6, - LENS = 7, + Lens = 7, } export declare enum SourceType { -- Gitee From 65bf737b3c25691123ae9db774b7f7ea5138ca7b Mon Sep 17 00:00:00 2001 From: hungry_feiwei Date: Mon, 25 Apr 2022 14:39:03 +0800 Subject: [PATCH 18/33] add interface Signed-off-by: hungry_feiwei --- api/@ohos.multimodalInput.distributedInput.d.ts | 10 +++++----- api/@ohos.multimodalInput.touchEvent.d.ts | 16 ++++++++-------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/api/@ohos.multimodalInput.distributedInput.d.ts b/api/@ohos.multimodalInput.distributedInput.d.ts index 8abd952763..91afba614b 100644 --- a/api/@ohos.multimodalInput.distributedInput.d.ts +++ b/api/@ohos.multimodalInput.distributedInput.d.ts @@ -25,16 +25,16 @@ import { AsyncCallback } from "./basic"; declare namespace distributedInput { enum InputAbility { // 鼠标 - Mouse = 0, + MOUSE = 0, - // 按键 - Keyboard = 1, + // 键盘 + KEYBOARD = 1, // 触摸屏 - Touchscreen = 2, + TOUCH_SCREEN = 2, // 触摸板 - Touchpad = 3, + TOUCH_PAD = 3, } /** diff --git a/api/@ohos.multimodalInput.touchEvent.d.ts b/api/@ohos.multimodalInput.touchEvent.d.ts index 7d6a66eca9..474c29aec6 100644 --- a/api/@ohos.multimodalInput.touchEvent.d.ts +++ b/api/@ohos.multimodalInput.touchEvent.d.ts @@ -39,27 +39,27 @@ export declare enum Action { export declare enum ToolType { // 手指 - Finger = 0, + FINGER = 0, // 笔 - Pen = 1, + PEN = 1, // 橡皮擦 - Rubber = 2, + RUBBER = 2, // 笔刷 - Brush = 3, + BRUSH = 3, // 铅笔 - Pencil = 4, + PENCIL = 4, // 气笔 - Airbrush = 5, + AIRBRUSH = 5, // 鼠标 - Mouse = 6, + MOUSE = 6, - Lens = 7, + LENS = 7, } export declare enum SourceType { -- Gitee From 2c7366cbdbd326bb7c52dd5be90e569ccdf23e95 Mon Sep 17 00:00:00 2001 From: hungry_feiwei Date: Wed, 27 Apr 2022 09:54:45 +0800 Subject: [PATCH 19/33] add interface Signed-off-by: hungry_feiwei --- api/@ohos.multimodalInput.axisEvent.d.ts | 4 ++-- api/@ohos.multimodalInput.distributedInput.d.ts | 15 +++++++++++++-- api/@ohos.multimodalInput.inputDevice.d.ts | 2 +- api/@ohos.multimodalInput.inputEvent.d.ts | 3 +-- api/@ohos.multimodalInput.inputMonitor.d.ts | 2 +- api/@ohos.multimodalInput.keyCode.d.ts | 2 +- api/@ohos.multimodalInput.keyEvent.d.ts | 3 +-- api/@ohos.multimodalInput.mouseEvent.d.ts | 3 +-- api/@ohos.multimodalInput.touchEvent.d.ts | 2 +- 9 files changed, 22 insertions(+), 14 deletions(-) diff --git a/api/@ohos.multimodalInput.axisEvent.d.ts b/api/@ohos.multimodalInput.axisEvent.d.ts index 669a8fcf9a..ccce65cc61 100644 --- a/api/@ohos.multimodalInput.axisEvent.d.ts +++ b/api/@ohos.multimodalInput.axisEvent.d.ts @@ -1,5 +1,5 @@ /* -* Copyright (C) 2021 Huawei Device Co., Ltd. +* 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 @@ -47,7 +47,7 @@ export declare enum Axis { SCROLL_VERTICAL = 0, // 水平滚动轴 - SCEOLL_HORIZONTAL = 1, + SCROLL_HORIZONTAL = 1, // 捏合轴 PINCH = 2, diff --git a/api/@ohos.multimodalInput.distributedInput.d.ts b/api/@ohos.multimodalInput.distributedInput.d.ts index 91afba614b..4c0c37c4a2 100644 --- a/api/@ohos.multimodalInput.distributedInput.d.ts +++ b/api/@ohos.multimodalInput.distributedInput.d.ts @@ -1,5 +1,5 @@ /* -* Copyright (C) 2021 Huawei Device Co., Ltd. +* 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 @@ -70,12 +70,23 @@ declare namespace distributedInput { function unprepareRemoteInput(deviceId: number, callback: AsyncCallback): void; function unprepareRemoteInput(deviceId: number): Promise; + /** + * 开始分布式 + * + * @since 9 + * @syscap SystemCapability.MultimodalInput.Input.RemoteInputDevice + * @param deviceId 表示开始分布式的那台设备的id + * @return - + */ + function startRemoteInput(deviceId: number, inputAbilities: Array, callback: AsyncCallback): void; + function startRemoteInput(deviceId: number, iputAbilities: Array): Promise; + /** * 停止分布式 * * @since 9 * @syscap SystemCapability.MultimodalInput.Input.RemoteInputDevice - * @param deviceId 表示准备分布式的那台设备的ID. + * @param deviceId 表示停止分布式的那台设备的id * @return - */ function stopRemoteInput(deviceId: number, inputAbilities: Array, callback: AsyncCallback): void; diff --git a/api/@ohos.multimodalInput.inputDevice.d.ts b/api/@ohos.multimodalInput.inputDevice.d.ts index 44975a80f0..a402760014 100644 --- a/api/@ohos.multimodalInput.inputDevice.d.ts +++ b/api/@ohos.multimodalInput.inputDevice.d.ts @@ -1,5 +1,5 @@ /* -* Copyright (C) 2021-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.inputEvent.d.ts b/api/@ohos.multimodalInput.inputEvent.d.ts index cdb475a2bb..f024627b85 100644 --- a/api/@ohos.multimodalInput.inputEvent.d.ts +++ b/api/@ohos.multimodalInput.inputEvent.d.ts @@ -1,6 +1,5 @@ - /* -* Copyright (C) 2021 Huawei Device Co., Ltd. +* 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 diff --git a/api/@ohos.multimodalInput.inputMonitor.d.ts b/api/@ohos.multimodalInput.inputMonitor.d.ts index a2139c9e50..1e8af33d90 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 index 71e990bb73..9e94fc5f49 100644 --- a/api/@ohos.multimodalInput.keyCode.d.ts +++ b/api/@ohos.multimodalInput.keyCode.d.ts @@ -1,5 +1,5 @@ /* -* Copyright (C) 2021 Huawei Device Co., Ltd. +* 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 diff --git a/api/@ohos.multimodalInput.keyEvent.d.ts b/api/@ohos.multimodalInput.keyEvent.d.ts index f0c645d438..7aa4cfe3e5 100644 --- a/api/@ohos.multimodalInput.keyEvent.d.ts +++ b/api/@ohos.multimodalInput.keyEvent.d.ts @@ -1,6 +1,5 @@ - /* -* Copyright (C) 2021 Huawei Device Co., Ltd. +* 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 diff --git a/api/@ohos.multimodalInput.mouseEvent.d.ts b/api/@ohos.multimodalInput.mouseEvent.d.ts index 3cc1d19273..99e78748cc 100644 --- a/api/@ohos.multimodalInput.mouseEvent.d.ts +++ b/api/@ohos.multimodalInput.mouseEvent.d.ts @@ -1,6 +1,5 @@ - /* -* Copyright (C) 2021 Huawei Device Co., Ltd. +* 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 diff --git a/api/@ohos.multimodalInput.touchEvent.d.ts b/api/@ohos.multimodalInput.touchEvent.d.ts index 474c29aec6..ccabf1f6f4 100644 --- a/api/@ohos.multimodalInput.touchEvent.d.ts +++ b/api/@ohos.multimodalInput.touchEvent.d.ts @@ -1,5 +1,5 @@ /* -* Copyright (C) 2021 Huawei Device Co., Ltd. +* 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 -- Gitee From 60a6f01dfd9dd49e1d7d5d32d5be6435260e906c Mon Sep 17 00:00:00 2001 From: hungry_feiwei Date: Wed, 27 Apr 2022 14:57:08 +0800 Subject: [PATCH 20/33] add interface Signed-off-by: hungry_feiwei --- api/@ohos.multimodalInput.distributedInput.d.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/api/@ohos.multimodalInput.distributedInput.d.ts b/api/@ohos.multimodalInput.distributedInput.d.ts index 4c0c37c4a2..3bef392722 100644 --- a/api/@ohos.multimodalInput.distributedInput.d.ts +++ b/api/@ohos.multimodalInput.distributedInput.d.ts @@ -23,7 +23,7 @@ import { AsyncCallback } from "./basic"; * @import import distributedInput from '@ohos.multimodalInput.distributedInput', */ declare namespace distributedInput { - enum InputAbility { + enum InputSource { // 鼠标 MOUSE = 0, @@ -45,8 +45,8 @@ declare namespace distributedInput { * @param deviceId 表示查询分布式输入能力的那台设备的ID. * @return - */ - function getRemoteInputAbility(deviceId: number, callback: AsyncCallback>): void; - function getRemoteInputAbility(deviceId: number): Promise>; + function getRemoteInputAbility(deviceId: number, callback: AsyncCallback>): void; + function getRemoteInputAbility(deviceId: number): Promise>; /** * 准备分布式 @@ -78,8 +78,8 @@ declare namespace distributedInput { * @param deviceId 表示开始分布式的那台设备的id * @return - */ - function startRemoteInput(deviceId: number, inputAbilities: Array, callback: AsyncCallback): void; - function startRemoteInput(deviceId: number, iputAbilities: Array): Promise; + function startRemoteInput(deviceId: number, inputSources: Array, callback: AsyncCallback): void; + function startRemoteInput(deviceId: number, inputSources: Array): Promise; /** * 停止分布式 @@ -89,8 +89,8 @@ declare namespace distributedInput { * @param deviceId 表示停止分布式的那台设备的id * @return - */ - function stopRemoteInput(deviceId: number, inputAbilities: Array, callback: AsyncCallback): void; - function stopRemoteInput(deviceId: number, iputAbilities: Array): Promise; + 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 -- Gitee From 6d0fd906511c1089fcbc554c99a27d76e9c4c892 Mon Sep 17 00:00:00 2001 From: hungry_feiwei Date: Wed, 27 Apr 2022 15:06:48 +0800 Subject: [PATCH 21/33] add interface Signed-off-by: hungry_feiwei --- api/@ohos.multimodalInput.inputDevice.d.ts | 3 +++ api/@ohos.multimodalInput.mouseEvent.d.ts | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/api/@ohos.multimodalInput.inputDevice.d.ts b/api/@ohos.multimodalInput.inputDevice.d.ts index a402760014..32295a691b 100644 --- a/api/@ohos.multimodalInput.inputDevice.d.ts +++ b/api/@ohos.multimodalInput.inputDevice.d.ts @@ -102,6 +102,9 @@ declare namespace inputDevice { // 人物 PERSON_SELECT, + + // 自定义 + CUSTOM, } /** diff --git a/api/@ohos.multimodalInput.mouseEvent.d.ts b/api/@ohos.multimodalInput.mouseEvent.d.ts index 99e78748cc..de25a01180 100644 --- a/api/@ohos.multimodalInput.mouseEvent.d.ts +++ b/api/@ohos.multimodalInput.mouseEvent.d.ts @@ -75,7 +75,7 @@ export declare enum Button { export declare enum Axis { // 垂直滚动轴 - SCEOLL_VERTICAL = 0, + SCROLL_VERTICAL = 0, // 水平滚动轴 SCROLL_HORIZONTAL = 1, -- Gitee From 5b1f2196c7733213eda0b1842e27e54b3091da87 Mon Sep 17 00:00:00 2001 From: hungry_feiwei Date: Wed, 27 Apr 2022 16:51:25 +0800 Subject: [PATCH 22/33] add interface Signed-off-by: hungry_feiwei --- api/@ohos.multimodalInput.inputDevice.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/@ohos.multimodalInput.inputDevice.d.ts b/api/@ohos.multimodalInput.inputDevice.d.ts index 32295a691b..964440d6cf 100644 --- a/api/@ohos.multimodalInput.inputDevice.d.ts +++ b/api/@ohos.multimodalInput.inputDevice.d.ts @@ -326,8 +326,8 @@ declare namespace inputDevice { * @param visible Whether the pointer icon is visible. The value **true** indicates that the pointer icon is visible, and the value **false** indicates the opposite. * @return callback function, receive reported data */ - function setPointerVisible(visible: boolean, callback: AsyncCallback): void; - function setPointerVisible(visible: boolean): Promise; + function setPointerVisibility(visible: boolean, callback: AsyncCallback): void; + function setPointerVisibility(visible: boolean): Promise; /** * 获取光标是否可见 -- Gitee From 1da2a14f0b1259d9e05395670551752cdc04a30e Mon Sep 17 00:00:00 2001 From: hungry_feiwei Date: Fri, 29 Apr 2022 14:29:47 +0800 Subject: [PATCH 23/33] add interface Signed-off-by: hungry_feiwei --- api/@ohos.multimodalInput.inputDevice.d.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/api/@ohos.multimodalInput.inputDevice.d.ts b/api/@ohos.multimodalInput.inputDevice.d.ts index 964440d6cf..fbc5d74dc3 100644 --- a/api/@ohos.multimodalInput.inputDevice.d.ts +++ b/api/@ohos.multimodalInput.inputDevice.d.ts @@ -115,7 +115,8 @@ declare namespace inputDevice { * @param deviceId ID of the input device for the reported input device event. */ interface DeviceListener { - (type: ChangedType, deviceId: number): void; + type: ChangedType; + deviceId: number; } /** @@ -124,9 +125,9 @@ declare namespace inputDevice { * @since 9 * @syscap SystemCapability.MultimodalInput.Input.InputDevice * @param type Type of the input device event, which is **change**. - * @param listener Callback for the input device event. + * @return Callback for the input device event. */ - function on(type: "change", listener: DeviceListener): void; + function on(type: "change", listener: Callback): void; /** * Stops listening for an input device event. @@ -134,9 +135,9 @@ declare namespace inputDevice { * @since 9 * @syscap SystemCapability.MultimodalInput.Input.InputDevice * @param type Type of the input device event, which is **change**. - * @param listener Callback for the input device event. + * @return Callback for the input device event. */ - function off(type: "change", listener?: DeviceListener): void; + function off(type: "change", listener?: Callback): void; /** * Defines axis information about events that can be reported by an input device. -- Gitee From 5e4b237d9c022ff522ac13046f6b2a182b68e96f Mon Sep 17 00:00:00 2001 From: hungry_feiwei Date: Thu, 5 May 2022 16:34:59 +0800 Subject: [PATCH 24/33] add interface Signed-off-by: hungry_feiwei --- api/@ohos.multimodalInput.inputDevice.d.ts | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/api/@ohos.multimodalInput.inputDevice.d.ts b/api/@ohos.multimodalInput.inputDevice.d.ts index fbc5d74dc3..ef7a996dac 100644 --- a/api/@ohos.multimodalInput.inputDevice.d.ts +++ b/api/@ohos.multimodalInput.inputDevice.d.ts @@ -340,27 +340,6 @@ declare namespace inputDevice { function isPointerVisible(callback: AsyncCallback): void; function isPointerVisible(): Promise; - /** - * 设置鼠标样式 - * - * @since 9 - * @syscap SystemCapability.MultimodalInput.Input.InputDevice - * @param pointerStyle 鼠标样式id。 - * @return callback function, receive reported data - */ - function setPointerStyle(pointerStyle: PointerStyle, callback: AsyncCallback): void; - function setPointerStyle(pointerStyle: PointerStyle): Promise; - -/** - * 获取鼠标样式 - * - * @since 9 - * @syscap SystemCapability.MultimodalInput.Input.InputDevice - * @return callback function, receive reported data - */ - function getPointerStyle(callback: AsyncCallback): void; - function getPointerStyle(): Promise; - /** * 鼠标位置设定 * -- Gitee From e3b56dc019dde0653df3bcc6343d40899b155106 Mon Sep 17 00:00:00 2001 From: hungry_feiwei Date: Thu, 5 May 2022 16:37:41 +0800 Subject: [PATCH 25/33] add interface Signed-off-by: hungry_feiwei --- api/@ohos.multimodalInput.inputDevice.d.ts | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/api/@ohos.multimodalInput.inputDevice.d.ts b/api/@ohos.multimodalInput.inputDevice.d.ts index ef7a996dac..402e314772 100644 --- a/api/@ohos.multimodalInput.inputDevice.d.ts +++ b/api/@ohos.multimodalInput.inputDevice.d.ts @@ -319,27 +319,6 @@ declare namespace inputDevice { function getKeyboardType(deviceId: number, callback: AsyncCallback): void; function getKeyboardType(deviceId: number): Promise; - /** - * Sets whether the pointer icon is visible. - * - * @since 9 - * @syscap SystemCapability.MultimodalInput.Input.InputDevice - * @param visible Whether the pointer icon is visible. The value **true** indicates that the pointer icon is visible, and the value **false** indicates the opposite. - * @return callback function, receive reported data - */ - function setPointerVisibility(visible: boolean, callback: AsyncCallback): void; - function setPointerVisibility(visible: boolean): Promise; - - /** - * 获取光标是否可见 - * - * @since 9 - * @syscap SystemCapability.MultimodalInput.Input.InputDevice - * @return callback function, receive reported data - */ - function isPointerVisible(callback: AsyncCallback): void; - function isPointerVisible(): Promise; - /** * 鼠标位置设定 * -- Gitee From a3869b391caa30469301be34fd4cc1121d4bd435 Mon Sep 17 00:00:00 2001 From: hungry_feiwei Date: Thu, 5 May 2022 17:37:53 +0800 Subject: [PATCH 26/33] add interface Signed-off-by: hungry_feiwei --- api/@ohos.multimodalInput.axisEvent.d.ts | 84 +++++++--- ...ohos.multimodalInput.distributedInput.d.ts | 38 +++-- api/@ohos.multimodalInput.inputDevice.d.ts | 128 +++++++++----- api/@ohos.multimodalInput.inputEvent.d.ts | 19 ++- api/@ohos.multimodalInput.keyEvent.d.ts | 76 +++++++-- api/@ohos.multimodalInput.mouseEvent.d.ts | 158 +++++++++++++----- api/@ohos.multimodalInput.touchEvent.d.ts | 142 ++++++++++++---- 7 files changed, 475 insertions(+), 170 deletions(-) diff --git a/api/@ohos.multimodalInput.axisEvent.d.ts b/api/@ohos.multimodalInput.axisEvent.d.ts index ccce65cc61..f73133e39f 100644 --- a/api/@ohos.multimodalInput.axisEvent.d.ts +++ b/api/@ohos.multimodalInput.axisEvent.d.ts @@ -24,13 +24,24 @@ import { KeyCode } from "./@ohos.multimodalInput.keyCode" * @permission N/A */ export declare enum Action { - // 取消 + /** + * cancel + */ CANCEL = 0, - // 鼠标关联的轴事件开始 + + /** + * axis begin + */ AXIS_BEGIN = 4, - // 鼠标关联的轴事件更新 + + /** + * axis update + */ AXIS_UPDATE = 5, - // 鼠标关联的轴事件结束 + + /** + * axis end + */ AXIS_END = 6, } @@ -43,13 +54,19 @@ export declare enum Action { * @permission N/A */ export declare enum Axis { - // 垂直滚动轴 + /** + * scroll vertical + */ SCROLL_VERTICAL = 0, - // 水平滚动轴 + /** + * scroll horizontal + */ SCROLL_HORIZONTAL = 1, - // 捏合轴 + /** + * pinch + */ PINCH = 2, } @@ -62,9 +79,14 @@ export declare enum Axis { * @permission N/A */ export declare interface AxisValue { - // 轴类型 + /** + * axis + */ axis: Axis; - // 轴的值 + + /** + * value + */ value: number } @@ -77,36 +99,58 @@ export declare interface AxisValue { * @permission N/A */ 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[]; - // 当前ctrlKey是否处于按下状态 + /** + * whether ctrlKey is in pressed state. + */ readonly ctrlKey: boolean; - // 当前altKey是否处于按下状态 + /** + * whether altKey is in pressed state. + */ readonly altKey: boolean; - // 当前shiftKey是否处于按下状态 + /** + * whether shiftKey is in pressed state. + */ readonly shiftKey: boolean; - // 当前logoKey是否处于按下状态 + /** + * whether logoKey is in pressed state. + */ readonly logoKey: boolean; - // 当前fnKey是否处于按下状态 + /** + * whether fnKey is in pressed state. + */ readonly fnKey: boolean; - // 当前capsLock是否处于激活状态 + /** + * whether capsLock is in the active state. + */ capsLock: boolean; - // 当前numLock是否处于激活状态 + /** + * whether numLock is in the active state. + */ numLock: boolean; - // 当前scrollLock是否处于激活状态 + /** + * 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 index 3bef392722..f526134bc7 100644 --- a/api/@ohos.multimodalInput.distributedInput.d.ts +++ b/api/@ohos.multimodalInput.distributedInput.d.ts @@ -16,7 +16,7 @@ import { AsyncCallback } from "./basic"; /** - * 分布式输入管理模块,用于提供分布式能力的接口调用 + * Distributed input management module for interface calls with distributed capabilities. * * @since 9 * @syscap SystemCapability.MultimodalInput.Input.RemoteInputDevice @@ -24,69 +24,77 @@ import { AsyncCallback } from "./basic"; */ 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 表示查询分布式输入能力的那台设备的ID. + * @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 表示准备分布式的那台设备的ID. + * @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 表示准备分布式的那台设备的ID. + * @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 表示开始分布式的那台设备的id + * @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 表示停止分布式的那台设备的id + * @param deviceId Indicates the ID of the device that stopped distribution. * @return - */ function stopRemoteInput(deviceId: number, inputSources: Array, callback: AsyncCallback): void; diff --git a/api/@ohos.multimodalInput.inputDevice.d.ts b/api/@ohos.multimodalInput.inputDevice.d.ts index 402e314772..b7999248ea 100644 --- a/api/@ohos.multimodalInput.inputDevice.d.ts +++ b/api/@ohos.multimodalInput.inputDevice.d.ts @@ -32,78 +32,126 @@ declare namespace inputDevice { type AxisType = 'touchMajor' | 'touchMinor' | 'orientation' | 'x' | 'y' | 'pressure' | 'toolMinor' | 'touchMajor'; enum KeyboardType { - // 无按键 + /** + * none + */ 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, } enum PointerStyle { - // 正常选择 + /** + * normal select + */ NORMAL_SELECT, - // 协助选择 + /** + * help select + */ HELP_SELECT, - // 后台运行 + /** + * working in background. + */ WORKING_IN_BACKGROUND, - // 忙碌 + /** + * busy + */ BUSY, - // 精确选择 + /** + * precision select + */ PRECISION_SELECT, - // 下一步 + /** + * next select + */ NEXT_SELECT, - // 手写 + /** + * handwriting + */ HANDWRITING, - // 不可用 + /** + * unavailable + */ UNAVAILABLE, - // 垂直调整 + /** + * vertical resize + */ VERTICAL_RESIZE, - // 水平调整 + /** + * horizontal resize + */ HORIZONTAL_RESIZE, - // 正向对角线调整 + /** + * diagonal resize 1 + */ DIAGONAL_RESIZE_1, - // 负向对角线调整 + /** + * diagonal resize 2 + */ DIAGONAL_RESIZE_2, - // 移动 + /** + * move + */ MOVE, - // 备选 + /** + * alternate select + */ ALTERNATE_SELECT, - // 链接 + /** + * link + */ LINK_SELECT, - // 位置 + /** + * location + */ LOCATION_SELECT, - // 人物 + /** + * person + */ PERSON_SELECT, - // 自定义 + /** + * custom + */ CUSTOM, } @@ -197,12 +245,12 @@ declare namespace 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 总线 - * @param product 产品 - * @param vendor 厂商 - * @param version 版本 - * @param phys 物理路径 - * @param uniq 唯一标识符 + * @param bus bus + * @param product product + * @param vendor vendor + * @param version version + * @param phys physical path + * @param uniq unique identifier */ interface InputDeviceData { /** @@ -283,24 +331,24 @@ declare namespace inputDevice { * @since 9 * @syscap SystemCapability.MultimodalInput.Input.InputDevice * @param deviceId ID of the input device. - * @param keys Key codes of the input device. 最多一次查询5个按键码 + * @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 光标移动速度。 + * @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 @@ -309,23 +357,23 @@ declare namespace inputDevice { function getPointerSpeed(): Promise; /** - * 查询输入设备的键盘类型 + * Query the keyboard type of the input device. * * @since 9 * @syscap SystemCapability.MultimodalInput.Input.InputDevice - * @param deviceId 输入设备标识。 - * @return 返回键盘类型。 + * @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坐标 - * @param y y坐标 + * @param x x coordinate + * @param y y coordinate * @return - */ function setPointerLocation(x: number, y: number, callback: AsyncCallback): void; diff --git a/api/@ohos.multimodalInput.inputEvent.d.ts b/api/@ohos.multimodalInput.inputEvent.d.ts index f024627b85..0dd8cd2c72 100644 --- a/api/@ohos.multimodalInput.inputEvent.d.ts +++ b/api/@ohos.multimodalInput.inputEvent.d.ts @@ -23,18 +23,29 @@ */ export declare interface InputEvent { - // 事件id,服务端生成,全局唯一 + /** + * Event ID, generated on the server and globally unique. + */ id: number; - // 上报输入事件的设备id, 整型数字,>=0 有效 + /** + * 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; - // 目标屏幕id, 整型数字,>=0 有效 + /** + * Target screen ID, integer number, valid if the value is >=0 + */ screenId: number; - // 目标窗口id, 整型数字, >=0 有效 + /** + * Target window ID, integer number, valid value >=0 + */ windowId: number; } \ No newline at end of file diff --git a/api/@ohos.multimodalInput.keyEvent.d.ts b/api/@ohos.multimodalInput.keyEvent.d.ts index 7aa4cfe3e5..e08143441b 100644 --- a/api/@ohos.multimodalInput.keyEvent.d.ts +++ b/api/@ohos.multimodalInput.keyEvent.d.ts @@ -24,57 +24,97 @@ import { KeyCode } from "./@ohos.multimodalInput.keyCode" */ export declare enum Action { - // 取消 + /** + * cancel + */ CANCEL = 0, - // 按钮按下 + + /** + * down + */ DOWN = 1, - // 按钮抬起 + + /** + * up + */ UP = 2, } export declare interface Key { - // 按键码 + /** + * the key code + */ code: KeyCode; - // 按下时间 + + /** + * press the time + */ pressedTime: number; - // 按键所属设备 + + /** + * button Owning device + */ deviceId: number; } export declare interface KeyEvent extends InputEvent { - // 按键动作 + /** + * the key action + */ action: Action; - // 本次发生变化的按键 + /** + * the keys that change this time + */ key: Key; - // unideCode编码 + /** + * unideCode coding + */ unicodeChar: number; - // 当前处于按下状态的按键列表 + /** + * list of keys that are currently in the pressed state + */ keys: Key[]; - // 当前ctrlKey是否处于按下状态 + /** + * whether ctrlKey is in down state + */ ctrlKey: boolean; - // 当前altKey是否处于按下状态 + /** + * whether altKey is in down state + */ altKey: boolean; - // 当前shiftKey是否处于按下状态 + /** + * whether shiftKey is in down state + */ shiftKey: boolean; - // 当前logoKey是否处于按下状态 + /** + * whether logoKey is in down state + */ logoKey: boolean; - // 当前fnKey是否处于按下状态 + /** + * whether fnKey is in down state + */ fnKey: boolean; - // 当前capsLock是否处于激活状态 + /** + * whether the current capsLock is activated + */ capsLock: boolean; - // 当前numLock是否处于激活状态 + /** + * whether the current numLock is activated + */ numLock: boolean; - // 当前scrollLock是否处于激活状态 + /** + * 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 index de25a01180..4d66d41215 100644 --- a/api/@ohos.multimodalInput.mouseEvent.d.ts +++ b/api/@ohos.multimodalInput.mouseEvent.d.ts @@ -25,128 +25,208 @@ import { KeyCode } from "./@ohos.multimodalInput.keyCode" */ 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, } 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 } export declare enum Axis { - // 垂直滚动轴 + /** + * scroll vertical + */ SCROLL_VERTICAL = 0, - // 水平滚动轴 + /** + * scroll horizontal + */ SCROLL_HORIZONTAL = 1, - // 捏合轴 + /** + * pinch + */ PINCH = 2, } export declare interface AxisValue { - // 轴类型 + /** + * axis type + */ axis: Axis; - // 轴的值 + /** + * The value of the axis + */ value: number } export declare interface MouseEvent extends InputEvent { - // 鼠标事件动作 + /** + * mouse event action + */ action: Action; - // 鼠标光标在屏幕中的x坐标 + /** + * the x coordinate of the mouse cursor in the screen + */ screenX: number; - // 鼠标光标在屏幕中的y坐标 + /** + * the y coordinate of the mouse cursor in the screen + */ screenY: number; - // 鼠标归属窗口的x坐标 + /** + * the x coordinate of the mouse window + */ windowX: number; - // 鼠标归属窗口的y坐标 + /** + * the y coordinate of the mouse window + */ windowY: number; - // 相对上次上报鼠标位置的相对X偏移,在屏幕边缘位置时,该值可能小于两次鼠标上报的坐标差 + /** + * 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; - // 相对上次上报鼠标位置的相对Y偏移,在屏幕边缘位置时,该值可能小于两次鼠标上报的坐标差 + /** + * 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[]; - // 当前action为AxisBegin/AxisUpdate/AxisEnd时,相关的轴的数据 + /** + * 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[]; - // 当前ctrlKey是否处于按下状态 + /** + * whether ctrlKey is in down state + */ ctrlKey: boolean; - // 当前altKey是否处于按下状态 + /** + * whether altKey is in down state + */ altKey: boolean; - // 当前shiftKey是否处于按下状态 + /** + * whether shiftKey is in down state + */ shiftKey: boolean; - // 当前logoKey是否处于按下状态 + /** + * whether logoKey is in down state + */ logoKey: boolean; - // 当前fnKey是否处于按下状态 + /** + * whether fnKey is in down state + */ fnKey:boolean - // 当前capsLock是否处于激活状态 + /** + * whether capsLock is in the active state. + */ capsLock:boolean - // 当前numLock是否处于激活状态 + /** + * whether numLock is in the active state. + */ numLock:boolean - // 当前scrollLock是否处于激活状态 + /** + * 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 index ccabf1f6f4..8ba544acf4 100644 --- a/api/@ohos.multimodalInput.touchEvent.d.ts +++ b/api/@ohos.multimodalInput.touchEvent.d.ts @@ -24,122 +24,196 @@ import { InputEvent } from './@ohos.multimodalInput.inputEvent' */ export declare enum Action { - // 触摸取消 + /** + * touch to cancel + */ CANCEL = 0, - // 触摸按下 + /** + * touch press + */ DOWN = 1, - // 触摸移动 + /** + * touch move + */ MOVE = 2, - // 触摸抬起 + /** + * touch up + */ UP = 3, } 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, } export declare enum SourceType { - // 触摸屏 + /** + * touch screen + */ TOUCH_SCREEN = 0, - // 手写笔 + /** + * pen + */ PEN = 1, - // 触摸板 + /** + * touch pad + */ TOUCH_PAD = 2, } export declare interface Touch { - // 指针标识,整型 >= 0 有效 + /** + * pointer identifier, integer data, data greater than or equal to 0. + */ id: number; - // 按下时刻的时间戳 + /** + * press the timestamp of the moment + */ pressedTime: number; - // 触摸位置所属的屏幕x坐标 + /** + * the x coordinate of the screen to which the touch position belongs + */ screenX: number; - // 触摸位置所属的屏幕y坐标 + /** + * the y coordinate of the screen to which the touch position belongs + */ screenY: number; - // 触摸位置在窗口中的x坐标 + /** + * touch the x coordinate of the position in the window + */ windowX: number; - // 触摸位置在窗口中的y坐标 + /** + * touch the y coordinate of the position in the window + */ windowY: number; - // 压力值 [0.0, 1.0], 0.0表示不支持 + /** + * 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; - // 相对YZ平面的角度,值的范围为-90到90(含),其中正值是向右倾斜。 + /** + * relative to the YZ plane, values range from -90 to 90 inclusive, where positive values are skewed to the right + */ tiltX: number; - // 相对XZ平面的角度,值的范围为-90到90(含),其中正值是向下倾斜。 + /** + * the Angle relative to the XZ plane ranges from -90 to 90 inclusive, where positive values are downward sloping. + */ tiltY: number; - // 工具区域的中心点X + /** + * the center point x of the tool area + */ toolX: number; + /** + * the center point y of the tool area + */ // 工具区域的中心点Y toolY: number; + /** + * tool area width + */ // 工具区域宽度 toolWidth: number; - // 工具区域高度 + /** + * tool area height + */ toolHeight: number; - // 输入设备上的x坐标 + /** + * the x coordinate on the input device + */ rawX: number; - //输入设备上的y坐标 + /** + * the y coordinate on the input device + */ rawY: number; - // 工具类型 + /** + * tool type + */ toolType: ToolType; } 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 -- Gitee From 97b7904bda0658664f0614757b2ded798805f685 Mon Sep 17 00:00:00 2001 From: hungry_feiwei Date: Sat, 7 May 2022 10:29:21 +0800 Subject: [PATCH 27/33] multimodalinput ts Signed-off-by: hungry_feiwei --- api/@ohos.multimodalInput.inputDevice.d.ts | 92 ---------------------- 1 file changed, 92 deletions(-) diff --git a/api/@ohos.multimodalInput.inputDevice.d.ts b/api/@ohos.multimodalInput.inputDevice.d.ts index b7999248ea..1c0116e025 100644 --- a/api/@ohos.multimodalInput.inputDevice.d.ts +++ b/api/@ohos.multimodalInput.inputDevice.d.ts @@ -63,98 +63,6 @@ declare namespace inputDevice { REMOTE_CONTROL = 5, } - enum PointerStyle { - /** - * normal select - */ - NORMAL_SELECT, - - /** - * help select - */ - HELP_SELECT, - - /** - * working in background. - */ - WORKING_IN_BACKGROUND, - - /** - * busy - */ - BUSY, - - /** - * precision select - */ - PRECISION_SELECT, - - /** - * next select - */ - NEXT_SELECT, - - /** - * handwriting - */ - HANDWRITING, - - /** - * unavailable - */ - UNAVAILABLE, - - /** - * vertical resize - */ - VERTICAL_RESIZE, - - /** - * horizontal resize - */ - HORIZONTAL_RESIZE, - - /** - * diagonal resize 1 - */ - DIAGONAL_RESIZE_1, - - /** - * diagonal resize 2 - */ - DIAGONAL_RESIZE_2, - - /** - * move - */ - MOVE, - - /** - * alternate select - */ - ALTERNATE_SELECT, - - /** - * link - */ - LINK_SELECT, - - /** - * location - */ - LOCATION_SELECT, - - /** - * person - */ - PERSON_SELECT, - - /** - * custom - */ - CUSTOM, - } - /** * Defines the listener for input device events. * -- Gitee From 016fa32ed4badbc14b4c0cd049fb11f4ac6219ca Mon Sep 17 00:00:00 2001 From: hungry_feiwei Date: Sat, 7 May 2022 14:46:50 +0800 Subject: [PATCH 28/33] multimodalinput ts Signed-off-by: hungry_feiwei --- api/@ohos.multimodalInput.keyCode.d.ts | 59 -------------------------- 1 file changed, 59 deletions(-) diff --git a/api/@ohos.multimodalInput.keyCode.d.ts b/api/@ohos.multimodalInput.keyCode.d.ts index 9e94fc5f49..01a0236105 100644 --- a/api/@ohos.multimodalInput.keyCode.d.ts +++ b/api/@ohos.multimodalInput.keyCode.d.ts @@ -27,13 +27,6 @@ export declare enum KeyCode { KEYCODE_UNKNOWN = -1, KEYCODE_HOME = 1, KEYCODE_BACK = 2, - KEYCODE_CALL = 3, - KEYCODE_ENDCALL = 4, - KEYCODE_CLEAR = 5, - KEYCODE_HEADSETHOOK = 6, - KEYCODE_FOCUS = 7, - KEYCODE_NOTIFICATION = 8, - KEYCODE_SEARCH = 9, KEYCODE_MEDIA_PLAY_PAUSE = 10, KEYCODE_MEDIA_STOP = 11, KEYCODE_MEDIA_NEXT = 12, @@ -44,13 +37,10 @@ export declare enum KeyCode { KEYCODE_VOLUME_DOWN = 17, KEYCODE_POWER = 18, KEYCODE_CAMERA = 19, - KEYCODE_VOICE_ASSISTANT = 20, - KEYCODE_CUSTOM1 = 21, KEYCODE_VOLUME_MUTE = 22, KEYCODE_MUTE = 23, KEYCODE_BRIGHTNESS_UP = 40, KEYCODE_BRIGHTNESS_DOWN = 41, - KEYCODE_WEAR_1 = 1001, KEYCODE_0 = 2000, KEYCODE_1 = 2001, KEYCODE_2 = 2002, @@ -175,37 +165,6 @@ export declare enum KeyCode { KEYCODE_NUMPAD_LEFT_PAREN = 2121, KEYCODE_NUMPAD_RIGHT_PAREN = 2122, KEYCODE_VIRTUAL_MULTITASK = 2210, - KEYCODE_BUTTON_A = 2301, - KEYCODE_BUTTON_B = 2302, - KEYCODE_BUTTON_C = 2303, - KEYCODE_BUTTON_X = 2304, - KEYCODE_BUTTON_Y = 2305, - KEYCODE_BUTTON_Z = 2306, - KEYCODE_BUTTON_L1 = 2307, - KEYCODE_BUTTON_R1 = 2308, - KEYCODE_BUTTON_L2 = 2309, - KEYCODE_BUTTON_R2 = 2310, - KEYCODE_BUTTON_SELECT = 2311, - KEYCODE_BUTTON_START = 2312, - KEYCODE_BUTTON_MODE = 2313, - KEYCODE_BUTTON_THUMBL = 2314, - KEYCODE_BUTTON_THUMBR = 2315, - KEYCODE_BUTTON_TRIGGER = 2401, - KEYCODE_BUTTON_THUMB = 2402, - KEYCODE_BUTTON_THUMB2 = 2403, - KEYCODE_BUTTON_TOP = 2404, - KEYCODE_BUTTON_TOP2 = 2405, - KEYCODE_BUTTON_PINKIE = 2406, - KEYCODE_BUTTON_BASE1 = 2407, - KEYCODE_BUTTON_BASE2 = 2408, - KEYCODE_BUTTON_BASE3 = 2409, - KEYCODE_BUTTON_BASE4 = 2410, - KEYCODE_BUTTON_BASE5 = 2411, - KEYCODE_BUTTON_BASE6 = 2412, - KEYCODE_BUTTON_BASE7 = 2413, - KEYCODE_BUTTON_BASE8 = 2414, - KEYCODE_BUTTON_BASE9 = 2415, - KEYCODE_BUTTON_DEAD = 2416, KEYCODE_SLEEP = 2600, KEYCODE_ZENKAKU_HANKAKU = 2601, KEYCODE_102ND = 2602, @@ -394,22 +353,4 @@ export declare enum KeyCode { KEYCODE_BTN_7 = 3107, KEYCODE_BTN_8 = 3108, KEYCODE_BTN_9 = 3109, - KEYCODE_BRL_DOT1 = 3201, - KEYCODE_BRL_DOT2 = 3202, - KEYCODE_BRL_DOT3 = 3203, - KEYCODE_BRL_DOT4 = 3204, - KEYCODE_BRL_DOT5 = 3205, - KEYCODE_BRL_DOT6 = 3206, - KEYCODE_BRL_DOT7 = 3207, - KEYCODE_BRL_DOT8 = 3208, - KEYCODE_BRL_DOT9 = 3209, - KEYCODE_BRL_DOT10 = 3210, - KEYCODE_LEFT_KNOB_ROLL_UP = 10001, - KEYCODE_LEFT_KNOB_ROLL_DOWN = 10002, - KEYCODE_LEFT_KNOB = 10003, - KEYCODE_RIGHT_KNOB_ROLL_UP = 10004, - KEYCODE_RIGHT_KNOB_ROLL_DOWN = 10005, - KEYCODE_RIGHT_KNOB = 10006, - KEYCODE_VOICE_SOURCE_SWITCH = 10007, - KEYCODE_LAUNCHER_MENU = 10008, } -- Gitee From bd40c13f760d5a67c10cb10e4c6d11d087a54560 Mon Sep 17 00:00:00 2001 From: hungry_feiwei Date: Tue, 10 May 2022 09:22:04 +0800 Subject: [PATCH 29/33] add interface Signed-off-by: hungry_feiwei --- api/@ohos.multimodalInput.axisEvent.d.ts | 4 ---- api/@ohos.multimodalInput.inputEvent.d.ts | 1 - api/@ohos.multimodalInput.keyCode.d.ts | 1 - api/@ohos.multimodalInput.keyEvent.d.ts | 1 - api/@ohos.multimodalInput.mouseEvent.d.ts | 1 - api/@ohos.multimodalInput.touchEvent.d.ts | 1 - 6 files changed, 9 deletions(-) diff --git a/api/@ohos.multimodalInput.axisEvent.d.ts b/api/@ohos.multimodalInput.axisEvent.d.ts index f73133e39f..e4631fa842 100644 --- a/api/@ohos.multimodalInput.axisEvent.d.ts +++ b/api/@ohos.multimodalInput.axisEvent.d.ts @@ -21,7 +21,6 @@ import { KeyCode } from "./@ohos.multimodalInput.keyCode" * @since 9 * @syscap SystemCapability.MultimodalInput.Input.Core * @import import {MouseEvent} from '@ohos.multimodalInput.mouseEvent'; -* @permission N/A */ export declare enum Action { /** @@ -51,7 +50,6 @@ export declare enum Action { * @since 9 * @syscap SystemCapability.MultimodalInput.Input.Core * @import import {MouseEvent} from '@ohos.multimodalInput.mouseEvent'; -* @permission N/A */ export declare enum Axis { /** @@ -76,7 +74,6 @@ export declare enum Axis { * @since 9 * @syscap SystemCapability.MultimodalInput.Input.Core * @import import {MouseEvent} from '@ohos.multimodalInput.mouseEvent'; -* @permission N/A */ export declare interface AxisValue { /** @@ -96,7 +93,6 @@ export declare interface AxisValue { * @since 9 * @syscap SystemCapability.MultimodalInput.Input.Core * @import import {MouseEvent} from '@ohos.multimodalInput.mouseEvent'; -* @permission N/A */ export declare interface MouseEvent extends InputEvent { /** diff --git a/api/@ohos.multimodalInput.inputEvent.d.ts b/api/@ohos.multimodalInput.inputEvent.d.ts index 0dd8cd2c72..a69f272c5b 100644 --- a/api/@ohos.multimodalInput.inputEvent.d.ts +++ b/api/@ohos.multimodalInput.inputEvent.d.ts @@ -19,7 +19,6 @@ * @since 9 * @syscap SystemCapability.MultimodalInput.Input.Core * @import import InputEvent from '@ohos.multimodalInput.inputEvent'; -* @permission N/A */ export declare interface InputEvent { diff --git a/api/@ohos.multimodalInput.keyCode.d.ts b/api/@ohos.multimodalInput.keyCode.d.ts index 01a0236105..5b13d89371 100644 --- a/api/@ohos.multimodalInput.keyCode.d.ts +++ b/api/@ohos.multimodalInput.keyCode.d.ts @@ -19,7 +19,6 @@ * @since 9 * @syscap SystemCapability.MultimodalInput.Input.Core * @import import {KeyCode}} from '@ohos.multimodalInput.keyCode', -* @permission N/A */ export declare enum KeyCode { diff --git a/api/@ohos.multimodalInput.keyEvent.d.ts b/api/@ohos.multimodalInput.keyEvent.d.ts index e08143441b..0d0e160501 100644 --- a/api/@ohos.multimodalInput.keyEvent.d.ts +++ b/api/@ohos.multimodalInput.keyEvent.d.ts @@ -20,7 +20,6 @@ import { KeyCode } from "./@ohos.multimodalInput.keyCode" * @since 9 * @syscap SystemCapability.MultimodalInput.Input.Core * @import import KeyEvent from '@ohos.multimodalInput.keyEvent'; -* @permission N/A */ export declare enum Action { diff --git a/api/@ohos.multimodalInput.mouseEvent.d.ts b/api/@ohos.multimodalInput.mouseEvent.d.ts index 4d66d41215..2c204e24e9 100644 --- a/api/@ohos.multimodalInput.mouseEvent.d.ts +++ b/api/@ohos.multimodalInput.mouseEvent.d.ts @@ -21,7 +21,6 @@ import { KeyCode } from "./@ohos.multimodalInput.keyCode" * @since 9 * @syscap SystemCapability.MultimodalInput.Input.Core * @import import {MouseEvent} from '@ohos.multimodalInput.mouseEvent'; -* @permission N/A */ export declare enum Action { diff --git a/api/@ohos.multimodalInput.touchEvent.d.ts b/api/@ohos.multimodalInput.touchEvent.d.ts index 8ba544acf4..08d2d45106 100644 --- a/api/@ohos.multimodalInput.touchEvent.d.ts +++ b/api/@ohos.multimodalInput.touchEvent.d.ts @@ -20,7 +20,6 @@ import { InputEvent } from './@ohos.multimodalInput.inputEvent' * @since 9 * @syscap SystemCapability.MultimodalInput.Input.Core * @import import {PointerEvent, Pointer, PointerAction} from '@ohos.multimodalInput.ToucEvent'; -* @permission N/A */ export declare enum Action { -- Gitee From bc3713d4748677d67237c16fffe14c8c43d8504b Mon Sep 17 00:00:00 2001 From: hungry_feiwei Date: Tue, 10 May 2022 14:47:32 +0800 Subject: [PATCH 30/33] add interface Signed-off-by: hungry_feiwei --- api/@ohos.multimodalInput.inputDevice.d.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/api/@ohos.multimodalInput.inputDevice.d.ts b/api/@ohos.multimodalInput.inputDevice.d.ts index 1c0116e025..b16a830ab4 100644 --- a/api/@ohos.multimodalInput.inputDevice.d.ts +++ b/api/@ohos.multimodalInput.inputDevice.d.ts @@ -29,7 +29,10 @@ declare namespace inputDevice { type SourceType = 'keyboard' | 'mouse' | 'touchpad' | 'touchscreen' | 'joystick' | 'trackball'; - type AxisType = 'touchMajor' | 'touchMinor' | 'orientation' | 'x' | 'y' | 'pressure' | 'toolMinor' | 'touchMajor'; + /** + * @since 9 + */ + type AxisType = 'touchMajor' | 'touchMinor' | 'orientation' | 'x' | 'y' | 'pressure' | 'toolMinor' | 'touchMajor' | 'NULL'; enum KeyboardType { /** -- Gitee From 7c78652b5e3b53d011c36df03d76eb18d0f1bdaa Mon Sep 17 00:00:00 2001 From: hungry_feiwei Date: Wed, 11 May 2022 09:12:29 +0800 Subject: [PATCH 31/33] add interface Signed-off-by: hungry_feiwei --- api/@ohos.multimodalInput.inputEvent.d.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/api/@ohos.multimodalInput.inputEvent.d.ts b/api/@ohos.multimodalInput.inputEvent.d.ts index a69f272c5b..d00e3677c9 100644 --- a/api/@ohos.multimodalInput.inputEvent.d.ts +++ b/api/@ohos.multimodalInput.inputEvent.d.ts @@ -35,7 +35,6 @@ export declare interface InputEvent { /** * Time of event. */ - // 事件发生时间 actionTime: number; /** -- Gitee From 7dd713941eba4bcc7d947fcf5031f33d00d76f32 Mon Sep 17 00:00:00 2001 From: hungry_feiwei Date: Wed, 11 May 2022 09:16:18 +0800 Subject: [PATCH 32/33] add interface Signed-off-by: hungry_feiwei --- api/@ohos.multimodalInput.keyEvent.d.ts | 1 - api/@ohos.multimodalInput.touchEvent.d.ts | 2 -- 2 files changed, 3 deletions(-) diff --git a/api/@ohos.multimodalInput.keyEvent.d.ts b/api/@ohos.multimodalInput.keyEvent.d.ts index 0d0e160501..f19294385b 100644 --- a/api/@ohos.multimodalInput.keyEvent.d.ts +++ b/api/@ohos.multimodalInput.keyEvent.d.ts @@ -21,7 +21,6 @@ import { KeyCode } from "./@ohos.multimodalInput.keyCode" * @syscap SystemCapability.MultimodalInput.Input.Core * @import import KeyEvent from '@ohos.multimodalInput.keyEvent'; */ - export declare enum Action { /** * cancel diff --git a/api/@ohos.multimodalInput.touchEvent.d.ts b/api/@ohos.multimodalInput.touchEvent.d.ts index 08d2d45106..d739d95529 100644 --- a/api/@ohos.multimodalInput.touchEvent.d.ts +++ b/api/@ohos.multimodalInput.touchEvent.d.ts @@ -164,13 +164,11 @@ export declare interface Touch { /** * the center point y of the tool area */ - // 工具区域的中心点Y toolY: number; /** * tool area width */ - // 工具区域宽度 toolWidth: number; /** -- Gitee From caa17ca1c8f3f53899364728036123dad1b7863b Mon Sep 17 00:00:00 2001 From: hungry_feiwei Date: Mon, 16 May 2022 17:03:25 +0800 Subject: [PATCH 33/33] add interface Signed-off-by: hungry_feiwei --- api/@ohos.multimodalInput.axisEvent.d.ts | 6 ++-- api/@ohos.multimodalInput.keyCode.d.ts | 2 +- api/@ohos.multimodalInput.keyEvent.d.ts | 18 ++++++++++-- api/@ohos.multimodalInput.mouseEvent.d.ts | 33 ++++++++++++++++++++-- api/@ohos.multimodalInput.touchEvent.d.ts | 34 ++++++++++++++++++++--- 5 files changed, 80 insertions(+), 13 deletions(-) diff --git a/api/@ohos.multimodalInput.axisEvent.d.ts b/api/@ohos.multimodalInput.axisEvent.d.ts index e4631fa842..ba6df294c0 100644 --- a/api/@ohos.multimodalInput.axisEvent.d.ts +++ b/api/@ohos.multimodalInput.axisEvent.d.ts @@ -20,7 +20,7 @@ import { KeyCode } from "./@ohos.multimodalInput.keyCode" * * @since 9 * @syscap SystemCapability.MultimodalInput.Input.Core -* @import import {MouseEvent} from '@ohos.multimodalInput.mouseEvent'; +* @import import {Action} from '@ohos.multimodalInput.mouseEvent'; */ export declare enum Action { /** @@ -49,7 +49,7 @@ export declare enum Action { * * @since 9 * @syscap SystemCapability.MultimodalInput.Input.Core -* @import import {MouseEvent} from '@ohos.multimodalInput.mouseEvent'; +* @import import {Axis} from '@ohos.multimodalInput.mouseEvent'; */ export declare enum Axis { /** @@ -73,7 +73,7 @@ export declare enum Axis { * * @since 9 * @syscap SystemCapability.MultimodalInput.Input.Core -* @import import {MouseEvent} from '@ohos.multimodalInput.mouseEvent'; +* @import import {AxisValue} from '@ohos.multimodalInput.mouseEvent'; */ export declare interface AxisValue { /** diff --git a/api/@ohos.multimodalInput.keyCode.d.ts b/api/@ohos.multimodalInput.keyCode.d.ts index 5b13d89371..7da279b403 100644 --- a/api/@ohos.multimodalInput.keyCode.d.ts +++ b/api/@ohos.multimodalInput.keyCode.d.ts @@ -18,7 +18,7 @@ * * @since 9 * @syscap SystemCapability.MultimodalInput.Input.Core -* @import import {KeyCode}} from '@ohos.multimodalInput.keyCode', +* @import import {KeyCode} from '@ohos.multimodalInput.keyCode', */ export declare enum KeyCode { diff --git a/api/@ohos.multimodalInput.keyEvent.d.ts b/api/@ohos.multimodalInput.keyEvent.d.ts index f19294385b..bb20192b67 100644 --- a/api/@ohos.multimodalInput.keyEvent.d.ts +++ b/api/@ohos.multimodalInput.keyEvent.d.ts @@ -15,11 +15,11 @@ import { InputEvent } from "./@ohos.multimodalInput.inputEvent" import { KeyCode } from "./@ohos.multimodalInput.keyCode" /** -* KeyEvent +* Action * * @since 9 * @syscap SystemCapability.MultimodalInput.Input.Core -* @import import KeyEvent from '@ohos.multimodalInput.keyEvent'; +* @import import {Action} from '@ohos.multimodalInput.keyEvent'; */ export declare enum Action { /** @@ -38,6 +38,13 @@ export declare enum Action { UP = 2, } +/** +* Key +* +* @since 9 +* @syscap SystemCapability.MultimodalInput.Input.Core +* @import import {Key} from '@ohos.multimodalInput.mouseEvent'; +*/ export declare interface Key { /** * the key code @@ -55,6 +62,13 @@ export declare interface Key { 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 diff --git a/api/@ohos.multimodalInput.mouseEvent.d.ts b/api/@ohos.multimodalInput.mouseEvent.d.ts index 2c204e24e9..c5ee7f9963 100644 --- a/api/@ohos.multimodalInput.mouseEvent.d.ts +++ b/api/@ohos.multimodalInput.mouseEvent.d.ts @@ -16,13 +16,12 @@ import { InputEvent } from "./@ohos.multimodalInput.inputEvent" import { KeyCode } from "./@ohos.multimodalInput.keyCode" /** -* MouseEvent +* Action * * @since 9 * @syscap SystemCapability.MultimodalInput.Input.Core -* @import import {MouseEvent} from '@ohos.multimodalInput.mouseEvent'; +* @import import {Action} from '@ohos.multimodalInput.mouseEvent'; */ - export declare enum Action { /** * cancel @@ -60,6 +59,13 @@ export declare enum Action { 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 @@ -102,6 +108,13 @@ export declare enum Button { TASK = 7 } +/** +* Axis +* +* @since 9 +* @syscap SystemCapability.MultimodalInput.Input.Core +* @import import {Axis} from '@ohos.multimodalInput.mouseEvent'; +*/ export declare enum Axis { /** * scroll vertical @@ -119,6 +132,13 @@ export declare enum Axis { PINCH = 2, } +/** +* AxisValue +* +* @since 9 +* @syscap SystemCapability.MultimodalInput.Input.Core +* @import import {AxisValue} from '@ohos.multimodalInput.mouseEvent'; +*/ export declare interface AxisValue { /** * axis type @@ -131,6 +151,13 @@ export declare interface AxisValue { 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 diff --git a/api/@ohos.multimodalInput.touchEvent.d.ts b/api/@ohos.multimodalInput.touchEvent.d.ts index d739d95529..f7a7560df1 100644 --- a/api/@ohos.multimodalInput.touchEvent.d.ts +++ b/api/@ohos.multimodalInput.touchEvent.d.ts @@ -15,13 +15,12 @@ import { InputEvent } from './@ohos.multimodalInput.inputEvent' /** -* TouchEvent +* Action * * @since 9 * @syscap SystemCapability.MultimodalInput.Input.Core -* @import import {PointerEvent, Pointer, PointerAction} from '@ohos.multimodalInput.ToucEvent'; +* @import import {Action} from '@ohos.multimodalInput.ToucEvent'; */ - export declare enum Action { /** * touch to cancel @@ -44,6 +43,13 @@ export declare enum Action { UP = 3, } +/** +* ToolType +* +* @since 9 +* @syscap SystemCapability.MultimodalInput.Input.Core +* @import import {ToolType} from '@ohos.multimodalInput.ToucEvent'; +*/ export declare enum ToolType { /** * finger @@ -83,6 +89,13 @@ export declare enum ToolType { LENS = 7, } +/** +* SourceType +* +* @since 9 +* @syscap SystemCapability.MultimodalInput.Input.Core +* @import import {SourceType} from '@ohos.multimodalInput.ToucEvent'; +*/ export declare enum SourceType { /** * touch screen @@ -100,6 +113,13 @@ export declare enum SourceType { 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. @@ -192,7 +212,13 @@ export declare interface Touch { 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 -- Gitee