From f0d5f10bb44ce9c4d0b0de7e17288c5f9044583f Mon Sep 17 00:00:00 2001 From: l30075025 Date: Tue, 17 Jun 2025 14:41:36 +0800 Subject: [PATCH] fix Signed-off-by: l30075025 --- .../device/input/inputconsumer-guidelines.md | 10 ++++++---- .../device/input/inputdevice-guidelines.md | 2 +- .../device/input/inputeventclient-guidelines.md | 4 +++- .../device/input/inputmonitor-guidelines.md | 4 ++-- .../device/input/pointerstyle-guidelines.md | 4 ++-- .../device/input/shortkey-guidelines.md | 3 ++- .../reference/apis-input-kit/js-apis-touchevent.md | 6 +++--- 7 files changed, 19 insertions(+), 14 deletions(-) diff --git a/zh-cn/application-dev/device/input/inputconsumer-guidelines.md b/zh-cn/application-dev/device/input/inputconsumer-guidelines.md index a7bbd3cc10a..3ffe8c9a791 100644 --- a/zh-cn/application-dev/device/input/inputconsumer-guidelines.md +++ b/zh-cn/application-dev/device/input/inputconsumer-guidelines.md @@ -31,6 +31,8 @@ import { inputConsumer } from '@kit.InputKit'; 特定全局快捷键的应用开启时调用[on](../../reference/apis-input-kit/js-apis-inputconsumer-sys.md#inputconsumeron)方法订阅全局快捷键,应用关闭时再用[off](../../reference/apis-input-kit/js-apis-inputconsumer-sys.md#inputconsumeroff)方法取消订阅全局快捷键。 ```js +import { inputConsumer } from '@kit.InputKit'; + let leftAltKey = 2045; let tabKey = 2049; let callback = (keyOptions: inputConsumer.KeyOptions) => { @@ -41,14 +43,14 @@ let keyOption: inputConsumer.KeyOptions = {preKeys: [leftAltKey], finalKey: tabK try { inputConsumer.on("key", keyOption, callback);//订阅系统快捷键 } catch (error) { - console.log(`Execute failed, error: ${JSON.stringify(error, [`code`, `message`])}`); + console.error(`Execute failed, error: ${JSON.stringify(error, [`code`, `message`])}`); } //应用关闭 try { inputConsumer.off("key", keyOption, callback);//取消订阅系统快捷键 console.log(`Unsubscribe success`); } catch (error) { - console.log(`Execute failed, error: ${JSON.stringify(error, [`code`, `message`])}`); + console.error(`Execute failed, error: ${JSON.stringify(error, [`code`, `message`])}`); } let leftCtrlKey = 2072; @@ -65,13 +67,13 @@ inputConsumer.getAllSystemHotkeys().then((data: Array {//设置截屏应用screenshot延迟时间为5秒(500毫秒) if (error) { @@ -33,7 +34,7 @@ try { console.log(`Set key down duration success`); }); } catch (error) { - console.log(`Set key down duration failed, error: ${JSON.stringify(error, [`code`, `message`])}`); + console.error(`Set key down duration failed, error: ${JSON.stringify(error, [`code`, `message`])}`); } ``` diff --git a/zh-cn/application-dev/reference/apis-input-kit/js-apis-touchevent.md b/zh-cn/application-dev/reference/apis-input-kit/js-apis-touchevent.md index 04d2547c240..c3dd6adbda4 100644 --- a/zh-cn/application-dev/reference/apis-input-kit/js-apis-touchevent.md +++ b/zh-cn/application-dev/reference/apis-input-kit/js-apis-touchevent.md @@ -1,6 +1,6 @@ # @ohos.multimodalInput.touchEvent (触摸输入事件) -设备上报的触摸(触屏)事件,继承自[InputEvent](./js-apis-inputevent.md)。 +设备上报的触摸事件,继承自[InputEvent](./js-apis-inputevent.md)。 > **说明:** > @@ -83,13 +83,13 @@ import { Action,ToolType,SourceType,Touch,TouchEvent } from '@kit.InputKit'; ## TouchEvent -触屏事件。 +触摸事件。 **系统能力:** SystemCapability.MultimodalInput.Input.Core | 名称 | 类型 | 只读 | 可选 | 说明 | | ---------- | ---------- | ---- | ---- | --------- | -| action | [Action](#action) | 否 | 否 | 触屏事件类型。 | +| action | [Action](#action) | 否 | 否 | 触摸事件类型。 | | touch | [Touch](#touch) | 否 | 否 | 当前触摸点信息。 | | touches | [Touch](#touch)[] | 否 | 否 | 所有触摸点。 | | sourceType | [SourceType](#sourcetype) | 否 | 否 | 触摸来源的设备类型。 | -- Gitee