diff --git a/api/@ohos.multimodalInput.inputConsumer.d.ts b/api/@ohos.multimodalInput.inputConsumer.d.ts old mode 100755 new mode 100644 index e10019666ddd9e967e9eefb947365fc997357501..86798b19356679d96e43505cfa842bf863ef49ce --- 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.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 0000000000000000000000000000000000000000..de09ecc84e0a627f3237bdb34ddb02a8359d88b2 --- /dev/null +++ b/api/@ohos.multimodalInput.inputEventClient.d.ts @@ -0,0 +1,56 @@ +/* +* 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'; + * @systemapi hide for inner use + * @permission N/A + */ + +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. + * @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 + * @systemapi hide for inner use + * @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