[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MiNT] New AES keyboard messages



This is basically what X does if I remember right.  You get a "Key Down", "Key Press", and "Key Up", and you can ignore the Key Down and Key Up messages most of the time and just use Key Press, but games and things of that sort use just the Key Down and Key Up messages mostly.

I don't know how this would fit into the current AES evnt_multi() call.  Perhaps, add a KEYSTATE event mask type to evnt_multi() so when waiting on this you would get the Key Down and Key Up events.  The KEYSTATE event wouldn't even need extra places to store the information.  The key would be returned in the same manner as regular keyboard events, and the state could be another bit returned along with the status of the keyboard modifier keys (Shift, Control, Alt, etc).  If you use both the existing keyboard (key-press) events and the newer Key-State, we could return "Key Down" and the regular AES Keypress at the same time (the data is compatible) to consolidate events if needed.  For key-repeat, you'd get a new Key-Down with the keypress, then 1 or more keypress events, and then a keypress with a Key-Up, although I'd bet, for games and such, you'd turn off the old keyboard event so you don't get all repeat keys and just look at the Key Down and Key Up.

How's that sound?

-- Evan

On Wed, 2005-03-30 at 22:17 +0200, Adam Kłobukowski wrote:
Hello

I have idea of new type of messages AES could deliver to applications.

The messages are Key pressed, Key released.

Key pressed is sent only once when key is pressed, no mater what 
keyrepeat would produce.
Key released is also sent only once, when key is released.

That messages can be sent interleaved, ie when user presses multiple key 
at the same time.

That messages should be new class of the messages, not included in any 
other class (esp. keyboard messages), for a call like event_multi. This 
is so application/AES would not need to waste time for handling unwanted 
keyrepeat messages.

The main reason for adding this messages is SDL and gaming in overall 
under AES.

(btw. SHIF, ALT, CONTROL should be also sent as such messages)

Technical details lik API/ABI are left for discussion.

Thanks for Ozk for being interested.