Add a callback for when key_dest is set.

This commit is contained in:
Bill Currie 2012-06-29 17:16:19 +09:00
parent 52146947c1
commit 603fe92cba
2 changed files with 4 additions and 0 deletions

View file

@ -431,6 +431,7 @@ extern keydest_t key_dest;
extern imt_t key_game_target;
extern knum_t key_togglemenu;
extern knum_t key_toggleconsole;
extern void (*key_dest_callback) (void);
extern struct keybind_s {
char *str;

View file

@ -59,6 +59,7 @@ VISIBLE keydest_t key_dest = key_console;
VISIBLE imt_t key_game_target = IMT_0;
VISIBLE knum_t key_togglemenu = QFK_ESCAPE;
VISIBLE knum_t key_toggleconsole = QFK_BACKQUOTE;
VISIBLE void (*key_dest_callback) (void);
VISIBLE struct keybind_s keybindings[IMT_LAST][QFK_LAST];
VISIBLE int keydown[QFK_LAST];
@ -980,4 +981,6 @@ Key_SetKeyDest(keydest_t kd)
game_target = IMT_CONSOLE;
break;
}
if (key_dest_callback)
key_dest_callback ();
}