MCPcopy Create free account
hub / github.com/DFHack/dfhack / cleanupHotkeys

Function cleanupHotkeys

plugins/hotkeys.cpp:44–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42}
43
44static int cleanupHotkeys(lua_State *) {
45 DEBUG(log).print("cleaning up old stub keybindings for: {}\n", join_strings(", ", Gui::getCurFocus(true)));
46 std::for_each(sorted_keys.begin(), sorted_keys.end(), [](const string &sym) {
47 string keyspec = sym + "@" + MENU_SCREEN_FOCUS_STRING;
48 DEBUG(log).print("clearing keybinding: {}\n", keyspec);
49 Core::getInstance().getHotkeyManager()->removeKeybind(keyspec);
50 });
51 valid = false;
52 sorted_keys.clear();
53 current_bindings.clear();
54 return 0;
55}
56
57static bool should_hide_armok(color_ostream &out, const string &cmdline) {
58 bool should_hide = false;

Callers 2

find_active_keybindingsFunction · 0.85
listFunction · 0.85

Calls 7

getCurFocusFunction · 0.85
removeKeybindMethod · 0.80
join_stringsFunction · 0.50
printMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected