A key_data is the event<-detail
of the events of the keyboard. It holds whether a key-down is
auto-repeated and the key that a key_up event releases.
Releasing a key generates an event with key_data<-id key_up.
This event is not a keyboard event (event->is_a
fails), so key bindings, text items, editors and other code that handles
keys do not see it. Code that wants releases asks for them:
event(W, Ev:event) :->
( send(Ev, is_a, key_up)
-> get(Ev, key, Key), % Key is released
...
; send(Ev, is_a, keyboard)
-> get(Ev, key, Key), % Key is pressed
...
; send_super(W, event, Ev)
).
event<-key
of a key_up event is event<-key
of the key-down it releases, also if the modifiers changed in between:
releasing Shift before a after typing A releases A.
A key_up goes to the keyboard focus, as the key-down. Only keys that
generated a keyboard event generate a key_up: a modifier key, such as
Shift, generates neither. A key_up may arrive without a key-down event
at the same receiver if the keyboard focus moved while the key was held.
<-key
of the key-down: the character typed, e.g., a
or
A, or the name of the key, e.g., RET
or cursor_left.repeat defaults to @off.