diff --git a/en/application-dev/reference/apis/js-apis-inputconsumer.md b/en/application-dev/reference/apis/js-apis-inputconsumer.md index 98529f06257e7d2dfe3e9a395fd176dd413bb347..2dc2edc4bcaae63350085197983dfc991c8234f6 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 12b468dea4e2948d2698f4b6373efa94631552f6..485e10661dbd5e6c846137c7ceda8c7b56e60a2a 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)