[Y-devel] Key mappings
Chris Amshey ychris at amshey.net
Thu Feb 26 03:46:39 GMT 2004
On Wed, Feb 25, 2004 at 04:50:38PM -0800, Jay Sprenkle wrote:
> Why do you need both the key down and key up
> events? Are you planning on having behaviour
> triggered on either event? All the GUI's
> I'm familiar with have a single event which
> is delivered on key press or key release
> (depending on which GUI it is).
>
> Almost every package I'm familiar with
> does a virtual keyboard mapping:
> A constant name VK_F1 = 'someone pressed what
> passes for the F1 key on the keyboard'.
> It seems pretty logical to do it that way.
At the normal keyboard input level, this makes sense, but
the down/up notation was at the raw level. If an application
asks for raw, getting key press and release events is often
essential. The obvious example is a typing tutor program that
lights up the keys being pressed in an image of a keyboard -
it needs to know when they are released as well. It's also
useful for certain types of navigation - holding down an arrow
key and moving smoothly until release, for example. It's critical,
of course, for games of all flavours. Someone, at some level, also
needs to monitor how long a key is held for key-repeat effects.
At the 'text input' level, of course we only care about keystrokes,
not down and up.
--Chris
More information about the Y-devel mailing list
2026 © www.Y-Windows.Org - All Rights Reserved