[AD] keyboard buffer (proposal)

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Attached are patches that implement the following proposed features:

1) keyboard polling

al_poll_keyboard();
al_key_down(NULL, keycode);

Basically it eliminates the need of an explicit
ALLEGRO_KEYBOARD_STATE. I'm on the fence regarding the usefulness of
this. At least it's easier to remember and keeps the verbosity down.

2) key buffer

al_enable_key_buffer(true); // called once
al_key_buffer_is_empty(); // i.e. A4's !keypressed()
int scancode = al_read_key(&unichar, &modifiers); // parameters are optional.
al_clear_key_buffer();

With this, Allegro 5 is as easy to use as 4 while still offering more
flexible event queues. (I have no suggestions for joystick & mouse, as
I think they are fine as is.)

--
Matthew Leverton

Attachment: keybuff.tar.gz
Description: GNU Zip compressed data



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/