未验证 提交 f46789fa 编写于 作者: O openharmony_ci 提交者: Gitee

!11180 【轻量级 PR】:update zh-cn/application-dev/reference/arkui-ts/ts-universal-events-key.md.

Merge pull request !11180 from luoying_ace/N/A
...@@ -52,28 +52,6 @@ struct KeyEventExample { ...@@ -52,28 +52,6 @@ struct KeyEventExample {
Text(this.text).padding(15) Text(this.text).padding(15)
}.height(300).width('100%').padding(35) }.height(300).width('100%').padding(35)
} }
}// xxx.ets
@Entry
@Component
struct KeyEventExample {
@State text: string = ''
@State eventType: string = ''
build() {
Column() {
Button('KeyEvent').backgroundColor(0x2788D9)
.onKeyEvent((event: KeyEvent) => {
if (event.type === KeyType.Down) {
this.eventType = 'Down'
}
if (event.type === KeyType.Up) {
this.eventType = 'Up'
}
console.info(this.text = 'KeyType:' + this.eventType + '\nkeyCode:' + event.keyCode + '\nkeyText:' + event.keyText)
})
Text(this.text).padding(15)
}.height(300).width('100%').padding(35)
}
} }
``` ```
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册