From f2543371976d890d1beae426d42fa212d4625fb0 Mon Sep 17 00:00:00 2001 From: yirenjie1 Date: Thu, 10 Feb 2022 06:07:28 +0000 Subject: [PATCH 1/2] Signed-off-by:yirenjie1 Signed-off-by: yirenjie1 --- api/@ohos.multimodalInput.inputMonitor.d.ts | 50 +++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 api/@ohos.multimodalInput.inputMonitor.d.ts diff --git a/api/@ohos.multimodalInput.inputMonitor.d.ts b/api/@ohos.multimodalInput.inputMonitor.d.ts new file mode 100644 index 0000000000..5f3cc0570b --- /dev/null +++ b/api/@ohos.multimodalInput.inputMonitor.d.ts @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Global Input Event Listener + * System API, available only to system processes + * @since 7 + * @sysCap System Capabilities + * @devices phone, tablet, tv, wearable + * @import import inputMonitor from '@ohos.multimodalInput.inputMonitor'; + * @permission ohos.permission.INPUT_MONITORING + * @systemapi + */ +declare namespace inputMonitor { + /** + * Callback function of the touch input event. If true is returned, the touch input is consumed by the monitor (the system performs the closing action). + * @since 7 + * @sysCap System Capabilities + * @systemapi + */ + interface TouchEventReceiver { + (touchEvent:TouchEvent): Boolean; + } + /** + * Listening for touch input events + * @since 7 + * @sysCap System Capabilities + * @systemapi + */ + function on(type:"touch", receiver:TouchEventReceiver):void; + /** + * Cancels listening for touch input events + * @since 7 + * @sysCap System Capabilities + * @systemapi + */ + function off(type:"touch", receiver:TouchEventReceiver):void; +} +export default inputMonitor; \ No newline at end of file -- Gitee From fd6ca825ddcef15acd49fcb7757c2b78887f1e03 Mon Sep 17 00:00:00 2001 From: yirenjie1 Date: Thu, 10 Feb 2022 06:10:44 +0000 Subject: [PATCH 2/2] Signed-off-by:yirenjie1 Signed-off-by: yirenjie1 --- api/@ohos.multimodalInput.inputMonitor.d.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/api/@ohos.multimodalInput.inputMonitor.d.ts b/api/@ohos.multimodalInput.inputMonitor.d.ts index 5f3cc0570b..70af2ad16a 100644 --- a/api/@ohos.multimodalInput.inputMonitor.d.ts +++ b/api/@ohos.multimodalInput.inputMonitor.d.ts @@ -32,6 +32,7 @@ declare namespace inputMonitor { interface TouchEventReceiver { (touchEvent:TouchEvent): Boolean; } + /** * Listening for touch input events * @since 7 @@ -39,6 +40,7 @@ declare namespace inputMonitor { * @systemapi */ function on(type:"touch", receiver:TouchEventReceiver):void; + /** * Cancels listening for touch input events * @since 7 @@ -47,4 +49,4 @@ declare namespace inputMonitor { */ function off(type:"touch", receiver:TouchEventReceiver):void; } -export default inputMonitor; \ No newline at end of file +export default inputMonitor; -- Gitee