Ascii Equivalents for KeyUp/KeyDown events
Marcel Weiher
marcel at metaobject.com
Mon Dec 11 15:47:48 UTC 2000
> From: Bob Arning <arning at charm.net>
>
> Marcel,
>
> If one were to combine key events and character events, how would one
>
> - handle keys auto-repeated by the keyboard/OS?
The event has a 'repeat' flag that is set if it is the result of a
repeat-action.
> - handle characters that were input from other than a keyboard?
Hmm, can't say I know. Would depend on what the source of
characters happens to be. What did you have in mind?
Probably the cleanest way would be to attach the translated string
to the event that caused the characters to be generated. An
interesting generalization: mouse-click with attached characters,
but an accurate one, I think.
It probably makes sense to have a single data-structure/object for
event-data, with as much data as relevant filled out.
Of course, you could also synthesize keyboard events and somehow
flag those in such a manner that it is clear there was no actualy
key-press, for example by leaving the raw-key code zero.
Marcel
More information about the Squeak-dev
mailing list
|