Re: [AD] Suggestion: al_clear_keyboard_state()

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


I'm of the camp that says that this function should send KEY_UP events. Perhaps it could have a boolean for this purpose?

-SL

On 05/29/2015 02:11 PM, Beoran wrote:
Following a discussion on the forum here:
https://www.allegro.cc/forums/thread/615411/1013663#target

I propose we implement an API function al_clear_keyboard_state() that
clears ALLEGR's keyboatd state and sets all keys to unpressed. This
function is mainly for use when the ALLEGRO_EVENT_DISPLAY_SWITCH_OUT
is received, to prevent any pressed keys from getting "stuck" in the
down state because Allegro hasn't received the key up event while the
display wasn't active.

Would such a function be acceptable? Implementation is trivial, just a
memset() really; but the function is a bit of a workaround, os I
wonder if exposing such an API would be OK.

Kind Regards,

B.

------------------------------------------------------------------------------





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