mirror of
git://git.tartarus.org/simon/puzzles.git
synced 2025-04-20 07:31:30 -07:00
Group: implement game_request_keys().
This should allow keyboard-less play with Rockbox (and other front ends).
This commit is contained in:

committed by
Simon Tatham

parent
1ece22b758
commit
877133ae5d
@ -816,6 +816,22 @@ static const struct groups groups[] = {
|
||||
|
||||
/* ----- data generated by group.gap ends ----- */
|
||||
|
||||
static key_label *game_request_keys(const game_params *params, int *nkeys)
|
||||
{
|
||||
int i;
|
||||
key_label *keys = snewn(params->w, key_label);
|
||||
*nkeys = params->w;
|
||||
|
||||
/* Sequence is either "eabcdf..." or "abcdef...", depending on
|
||||
* params.id. */
|
||||
for (i = 0; i < params->w; i++) {
|
||||
keys[i].label = NULL;
|
||||
keys[i].button = TOCHAR(i + 1, params->id);
|
||||
}
|
||||
|
||||
return keys;
|
||||
}
|
||||
|
||||
static char *new_game_desc(const game_params *params, random_state *rs,
|
||||
char **aux, bool interactive)
|
||||
{
|
||||
@ -2376,7 +2392,7 @@ const struct game thegame = {
|
||||
free_ui,
|
||||
NULL, /* encode_ui */
|
||||
NULL, /* decode_ui */
|
||||
NULL, /* game_request_keys */
|
||||
game_request_keys,
|
||||
game_changed_state,
|
||||
current_key_label,
|
||||
interpret_move,
|
||||
|
Reference in New Issue
Block a user