Add a Keys namespace in the .60 language with all the string constant for special keys

This commit is contained in:
Olivier Goffart 2021-12-09 09:31:39 +01:00 committed by Olivier Goffart
parent 733d4ed365
commit f7c92183db
4 changed files with 47 additions and 0 deletions

View file

@ -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
}
}