From 2671957f2aaea921d67f2774a44b9307c09727c6 Mon Sep 17 00:00:00 2001 From: mayunteng_1 Date: Tue, 11 Oct 2022 15:02:36 +0800 Subject: [PATCH] Signed-off-by: mayunteng_1 Change-Id: I3b92d6bc1ef720d8f5a5ef3b05fdf240fdae49ae --- en/application-dev/reference/apis/js-apis-inputconsumer.md | 3 ++- .../application-dev/reference/apis/js-apis-inputconsumer.md | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/en/application-dev/reference/apis/js-apis-inputconsumer.md b/en/application-dev/reference/apis/js-apis-inputconsumer.md index 98529f0625..2dc2edc4bc 100644 --- a/en/application-dev/reference/apis/js-apis-inputconsumer.md +++ b/en/application-dev/reference/apis/js-apis-inputconsumer.md @@ -68,7 +68,8 @@ This is a system API. **Example** ``` -let keyOptions = {preKeys: [], finalKey: 3, isFinalKeyDown: true, finalKeyDownDuration: 0} +// 18为电源键键值 +let keyOptions = {preKeys: [], finalKey: 18, isFinalKeyDown: true, finalKeyDownDuration: 0} let callback = function(keyOptions) { console.info("preKeys: " + keyOptions.preKeys, "finalKey: " + keyOptions.finalKey, "isFinalKeyDown: " + keyOptions.isFinalKeyDown, "finalKeyDownDuration: " + keyOptions.finalKeyDownDuration) diff --git a/zh-cn/application-dev/reference/apis/js-apis-inputconsumer.md b/zh-cn/application-dev/reference/apis/js-apis-inputconsumer.md index 12b468dea4..485e10661d 100755 --- a/zh-cn/application-dev/reference/apis/js-apis-inputconsumer.md +++ b/zh-cn/application-dev/reference/apis/js-apis-inputconsumer.md @@ -36,7 +36,8 @@ on(type: "key", keyOptions: KeyOptions, callback: Callback<KeyOptions>): v **示例:** ```js -let keyOptions = { preKeys: [], finalKey: 3, isFinalKeyDown: true, finalKeyDownDuration: 0 } +// 18为电源键键值 +let keyOptions = { preKeys: [], finalKey: 18, isFinalKeyDown: true, finalKeyDownDuration: 0 } let callback = function (keyOptions) { console.info("preKeys: " + keyOptions.preKeys, "finalKey: " + keyOptions.finalKey, "isFinalKeyDown: " + keyOptions.isFinalKeyDown, "finalKeyDownDuration: " + keyOptions.finalKeyDownDuration) @@ -68,7 +69,8 @@ off(type: "key", keyOptions: KeyOptions, callback?: Callback<KeyOptions>): **示例:** ```js -let keyOptions = { preKeys: [], finalKey: 3, isFinalKeyDown: true, finalKeyDownDuration: 0 } +// 18为电源键键值 +let keyOptions = { preKeys: [], finalKey: 18, isFinalKeyDown: true, finalKeyDownDuration: 0 } let callback = function (keyOptions) {示例:** console.info("preKeys: " + keyOptions.preKeys, "finalKey: " + keyOptions.finalKey, "isFinalKeyDown: " + keyOptions.isFinalKeyDown, "finalKeyDownDuration: " + keyOptions.finalKeyDownDuration) -- GitLab