mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-03 18:29:09 +00:00
improved docs for key-pressed, key-released events
This commit is contained in:
parent
6a54eb2434
commit
12ec7d1512
2 changed files with 12 additions and 2 deletions
|
@ -151,6 +151,15 @@ described by the `Point` argument.
|
|||
### edited()
|
||||
Invoked when the text has changed because the user modified it.
|
||||
|
||||
### key-pressed(KeyEvent) -> EventResult
|
||||
Invoked when a key is pressed, the argument is a <Link type="KeyEvent" /> struct. Use this callback to
|
||||
handle keys before `TextInput` does. Return `accept` to indicate that you've handled the event, or return
|
||||
`reject` to let `TextInput` handle it.
|
||||
|
||||
### key-released(KeyEvent) -> EventResult
|
||||
Invoked when a key is released, the argument is a <Link type="KeyEvent" /> struct. The returned `EventResult`
|
||||
indicates whether to accept or ignore the event. Ignored events are forwarded to the parent element.
|
||||
|
||||
## TextInputInterface
|
||||
|
||||
The `TextInputInterface.text-input-focused` property can be used to find out if a `TextInput` element has the focus.
|
||||
|
|
|
@ -98,8 +98,9 @@ TextEdit {
|
|||
```
|
||||
|
||||
### key-pressed(KeyEvent) -> EventResult
|
||||
Invoked when a key is pressed, the argument is a <Link type="KeyEvent" /> struct. The returned `EventResult`
|
||||
indicates whether to accept or ignore the event. Ignored events are forwarded to the parent element.
|
||||
Invoked when a key is pressed, the argument is a <Link type="KeyEvent" /> struct. Use this callback to
|
||||
handle keys before `TextEdit` does. Return `accept` to indicate that you've handled the event, or return
|
||||
`reject` to let `TextEdit` handle it.
|
||||
|
||||
### key-released(KeyEvent) -> EventResult
|
||||
Invoked when a key is released, the argument is a <Link type="KeyEvent" /> struct. The returned `EventResult`
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue