[input] Set up default bindings for other imts

Now ` and F10 work by default in all contexts.
This commit is contained in:
Bill Currie 2021-03-31 17:51:11 +09:00
parent bc785ab2c2
commit 92859b7c2e

View file

@ -1268,6 +1268,24 @@ static struct {
{key_last, 0, 0},
};
static struct {
const char *imt;
const char *key;
const char *command;
} default_bindings[] = {
{"imt_mod", "K_F10", "quit"},
{"imt_mod", "K_BACKQUOTE", "toggleconsole"},
{"imt_0", "K_F10", "quit"},
{"imt_0", "K_BACKQUOTE", "toggleconsole"},
{"imt_demo", "K_F10", "quit"},
{"imt_demo", "K_BACKQUOTE", "toggleconsole"},
{"imt_console", "K_F10", "quit"},
{"imt_console", "K_BACKQUOTE", "toggleconsole"},
{"imt_menu", "K_F10", "quit"},
{"imt_console", "K_BACKQUOTE", "toggleconsole"},
{ }
};
static void
Key_CreateDefaultIMTs (void)
{
@ -1277,6 +1295,10 @@ Key_CreateDefaultIMTs (void)
Key_CreateIMT (default_imts[i].kd, default_imts[i].imt_name,
default_imts[i].chain_imt_name);
}
for (i = 0; default_bindings[i].imt; i++) {
Key_In_Bind (default_bindings[i].imt, default_bindings[i].key,
default_bindings[i].command);
}
}
void