From a4170cac4b8c61163acef07f1d99216609575c13 Mon Sep 17 00:00:00 2001 From: mayunteng_1 Date: Fri, 11 Mar 2022 08:28:47 +0000 Subject: [PATCH 1/2] add inputeventclient ts file Signed-off-by: mayunteng_1 Change-Id: I90f934835588e0febc122ebce14e15a3dce3a3de --- api/@ohos.multimodalInput.inputConsumer.d.ts | 0 api/@ohos.multimodalInput.inputDevice.d.ts | 0 ...ohos.multimodalInput.inputEventClient.d.ts | 53 +++++++++++++++++++ 3 files changed, 53 insertions(+) mode change 100755 => 100644 api/@ohos.multimodalInput.inputConsumer.d.ts mode change 100755 => 100644 api/@ohos.multimodalInput.inputDevice.d.ts create mode 100644 api/@ohos.multimodalInput.inputEventClient.d.ts diff --git a/api/@ohos.multimodalInput.inputConsumer.d.ts b/api/@ohos.multimodalInput.inputConsumer.d.ts old mode 100755 new mode 100644 diff --git a/api/@ohos.multimodalInput.inputDevice.d.ts b/api/@ohos.multimodalInput.inputDevice.d.ts old mode 100755 new mode 100644 diff --git a/api/@ohos.multimodalInput.inputEventClient.d.ts b/api/@ohos.multimodalInput.inputEventClient.d.ts new file mode 100644 index 0000000000..dd33a3b084 --- /dev/null +++ b/api/@ohos.multimodalInput.inputEventClient.d.ts @@ -0,0 +1,53 @@ +/* +* 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. +*/ + + /** + * Global Key Event Injection + * + * @since 8 + * @syscap SystemCapability.MultimodalInput.Input.InputEventClient + * @import import inputEventClient from '@ohos.multimodalInput.inputEventClient'; + * @permission N/A + */ + +declare namespace inputEventClient { + /** + * Defines event of key that user want to inject. + * + * @syscap SystemCapability.MultimodalInput.Input.InputEventClient + * @param isPressed The status of key. + * @param keyCode The keyCode value of key. + * @param keyDownDuration Key hold duration. + * @param isIntercepted Whether the key is blocked. + */ + interface KeyEvent { + isPressed: boolean, + keyCode: number; + keyDownDuration: number; + isIntercepted: boolean; + } + + /** + * Inject system keys. + * + * @since 8 + * @syscap SystemCapability.MultimodalInput.Input.InputEventClient + * @permission N/A + * @param KeyEvent the key event to be injected. + */ + function injectEvent({KeyEvent: KeyEvent}): void; +} + +export default inputEventClient; \ No newline at end of file -- Gitee From 6e20a8c5e9d9e94162681c92956ab28679c4074e Mon Sep 17 00:00:00 2001 From: mayunteng_1 Date: Tue, 15 Mar 2022 02:53:00 +0000 Subject: [PATCH 2/2] ts file add systemapi Signed-off-by: mayunteng_1 Change-Id: I365f1591724f8590d592c1859d703acd110739b0 --- api/@ohos.multimodalInput.inputConsumer.d.ts | 4 ++++ api/@ohos.multimodalInput.inputEventClient.d.ts | 3 +++ 2 files changed, 7 insertions(+) diff --git a/api/@ohos.multimodalInput.inputConsumer.d.ts b/api/@ohos.multimodalInput.inputConsumer.d.ts index e10019666d..86798b1935 100644 --- a/api/@ohos.multimodalInput.inputConsumer.d.ts +++ b/api/@ohos.multimodalInput.inputConsumer.d.ts @@ -21,6 +21,7 @@ import { Callback } from './basic'; * @since 8 * @syscap SystemCapability.MultimodalInput.Input.InputConsumer * @import import inputConsumer from '@ohos.multimodalInput.inputConsumer'; + * @systemapi hide for inner use * @permission N/A */ @@ -29,6 +30,7 @@ declare namespace inputConsumer { * Defines event of key that user want to subscribe or unsubscribe. * * @syscap SystemCapability.MultimodalInput.Input.InputConsumer + * @systemapi hide for inner use * @param preKeys The pre-keys that want to subscribe or unsubscribe. * @param finalKey The post position key that want to subscribe or unsubscribe. * @param isFinalKeyDown The final key press down or up. @@ -46,6 +48,7 @@ declare namespace inputConsumer { * * @since 8 * @syscap SystemCapability.MultimodalInput.Input.InputConsumer + * @systemapi hide for inner use * @permission N/A * @param type type of the inputevent about input which is to be subscribed. * @param keyOption the key events about input which is to be subscribed. @@ -58,6 +61,7 @@ declare namespace inputConsumer { * * @since 8 * @syscap SystemCapability.MultimodalInput.Input.InputConsumer + * @systemapi hide for inner use * @permission N/A * @param type type of the inputevent about input which is to be subscribed. * @param keyOption the key events about input which is to be subscribed. diff --git a/api/@ohos.multimodalInput.inputEventClient.d.ts b/api/@ohos.multimodalInput.inputEventClient.d.ts index dd33a3b084..de09ecc84e 100644 --- a/api/@ohos.multimodalInput.inputEventClient.d.ts +++ b/api/@ohos.multimodalInput.inputEventClient.d.ts @@ -19,6 +19,7 @@ * @since 8 * @syscap SystemCapability.MultimodalInput.Input.InputEventClient * @import import inputEventClient from '@ohos.multimodalInput.inputEventClient'; + * @systemapi hide for inner use * @permission N/A */ @@ -27,6 +28,7 @@ declare namespace inputEventClient { * Defines event of key that user want to inject. * * @syscap SystemCapability.MultimodalInput.Input.InputEventClient + * @systemapi hide for inner use * @param isPressed The status of key. * @param keyCode The keyCode value of key. * @param keyDownDuration Key hold duration. @@ -44,6 +46,7 @@ declare namespace inputEventClient { * * @since 8 * @syscap SystemCapability.MultimodalInput.Input.InputEventClient + * @systemapi hide for inner use * @permission N/A * @param KeyEvent the key event to be injected. */ -- Gitee