mirror of
https://github.com/slint-ui/slint.git
synced 2025-10-01 14:21:16 +00:00
Add a Keys
namespace in the .60 language with all the string constant for special keys
This commit is contained in:
parent
733d4ed365
commit
f7c92183db
4 changed files with 47 additions and 0 deletions
|
@ -458,6 +458,10 @@ Example := Window {
|
|||
|
||||
The FocusScope exposes callback to intercept the pressed key when it has focus.
|
||||
|
||||
The KeyEvent has a text property which is a character of the key entered.
|
||||
When a non-printable key is pressed, the character will be either a control character,
|
||||
or a private unicode character. The special characters are available in the `Keys` namespace
|
||||
|
||||
### Properties
|
||||
|
||||
* **`has-focus`** (*bool*): Set to `true` when item is focused and receives keyboard events.
|
||||
|
@ -482,6 +486,9 @@ Example := Window {
|
|||
if (event.modifiers.control) {
|
||||
debug("control was pressed during this event");
|
||||
}
|
||||
if (event.text == Keys.Escape) {
|
||||
debug("Esc key was pressed")
|
||||
}
|
||||
accept
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue