Add a way for midend_process_key() to report whether it handled a keypress

This adds a new bool * argument, which can be NULL if front ends don't
care whether the keypress was handled.  Currently they all do that.

Currently, "undo" and "redo" keys are treated as not handled if there's
no move to undo or redo.  This may be a little too strict.
This commit is contained in:
Ben Harris
2022-11-05 16:05:39 +00:00
parent 4fdcc54975
commit 4a37f7cf78
8 changed files with 50 additions and 35 deletions

View File

@ -305,7 +305,7 @@ void midend_reset_tilesize(midend *me);
void midend_new_game(midend *me);
void midend_restart_game(midend *me);
void midend_stop_anim(midend *me);
bool midend_process_key(midend *me, int x, int y, int button);
bool midend_process_key(midend *me, int x, int y, int button, bool *handled);
key_label *midend_request_keys(midend *me, int *nkeys);
void midend_force_redraw(midend *me);
void midend_redraw(midend *me);