- Cmd_AddCommand ("bind", Key_Bind_f);
- Cmd_AddCommand ("unbind", Key_Unbind_f);
- Cmd_AddCommand ("unbindall", Key_Unbindall_f);
+ Cmd_AddCommand ("bind", Key_Bind_f, "binds a command to the specified key in bindmap 0");
+ Cmd_AddCommand ("unbind", Key_Unbind_f, "removes a command on the specified key in bindmap 0");
+ Cmd_AddCommand ("unbindall", Key_Unbindall_f, "removes all commands from all keys in all bindmaps (leaving only shift-escape and escape)");
+}
+
+const char *Key_GetBind (int key)
+{
+ const char *bind;
+ bind = keybindings[key_bmap][key];
+ if (!bind)
+ bind = keybindings[key_bmap2][key];
+ return bind;