MCPcopy Index your code
hub / github.com/NetHack/NetHack / bind_key_fn

Function bind_key_fn

src/cmd.c:2731–2746  ·  view source on GitHub ↗

bind key by ext cmd function */

Source from the content-addressed store, hash-verified

2729
2730/* bind key by ext cmd function */
2731staticfn boolean
2732bind_key_fn(uchar key, int (*fn)(void))
2733{
2734 struct ext_func_tab *extcmd;
2735
2736 for (extcmd = extcmdlist; extcmd->ef_txt; extcmd++) {
2737 if (extcmd->ef_funct != fn)
2738 continue;
2739 if ((extcmd->flags & INTERNALCMD) != 0)
2740 continue;
2741 cmdbind_add(key, extcmd, FALSE);
2742 return TRUE;
2743 }
2744
2745 return FALSE;
2746}
2747
2748/* initialize all keyboard commands */
2749staticfn void

Callers 1

reset_commandsFunction · 0.85

Calls 1

cmdbind_addFunction · 0.85

Tested by

no test coverage detected