MCPcopy Create free account
hub / github.com/NetHack/NetHack / commands_init

Function commands_init

src/cmd.c:2749–2782  ·  view source on GitHub ↗

initialize all keyboard commands */

Source from the content-addressed store, hash-verified

2747
2748/* initialize all keyboard commands */
2749staticfn void
2750commands_init(void)
2751{
2752 struct ext_func_tab *extcmd;
2753
2754 for (extcmd = extcmdlist; extcmd->ef_txt; extcmd++)
2755 if (extcmd->key)
2756 cmdbind_add(extcmd->key, extcmd, FALSE);
2757
2758 (void) bind_mousebtn(1, "therecmdmenu");
2759 (void) bind_mousebtn(2, "clicklook");
2760
2761 /* number_pad */
2762 (void) bind_key(C('l'), "redraw", FALSE);
2763 (void) bind_key('h', "help", FALSE);
2764 (void) bind_key('j', "jump", FALSE);
2765 (void) bind_key('k', "kick", FALSE);
2766 (void) bind_key('l', "loot", FALSE);
2767 (void) bind_key(C('n'), "annotate", FALSE);
2768 (void) bind_key('N', "name", FALSE);
2769 (void) bind_key('u', "untrap", FALSE);
2770 (void) bind_key('5', "run", FALSE);
2771 (void) bind_key(M('5'), "rush", FALSE);
2772 (void) bind_key('-', "fight", FALSE);
2773
2774 /* alt keys: */
2775 (void) bind_key(M('O'), "overview", FALSE);
2776 (void) bind_key(M('2'), "twoweapon", FALSE);
2777 (void) bind_key(M('N'), "name", FALSE);
2778#if 0
2779 /* don't do this until the rest_on_space option is set or cleared */
2780 (void) bind_key(' ', "wait", FALSE);
2781#endif
2782}
2783
2784staticfn boolean
2785keylist_func_has_key(const struct ext_func_tab *extcmd,

Callers 1

reset_commandsFunction · 0.85

Calls 3

cmdbind_addFunction · 0.85
bind_mousebtnFunction · 0.85
bind_keyFunction · 0.85

Tested by

no test coverage detected