未验证 提交 c794f577 编写于 作者: L luoying_ace 提交者: Gitee

update zh-cn/application-dev/reference/arkui-ts/ts-universal-events-key.md.

Signed-off-by: Nluoying_ace <luoying19@huawei.com>
上级 18c8cea1
......@@ -52,28 +52,6 @@ struct KeyEventExample {
Text(this.text).padding(15)
}.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.
先完成此消息的编辑!
想要评论请 注册