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

Method listActiveKeybinds

library/modules/Hotkey.cpp:269–291  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

267}
268
269std::vector<KeyBinding> HotkeyManager::listActiveKeybinds() {
270 std::lock_guard<std::mutex> l(lock);
271 std::vector<KeyBinding> out;
272
273 for(const auto& [_, bind_set] : bindings) {
274 for (const auto& binding : bind_set) {
275 if (binding.spec.focus.empty()) {
276 // Binding always active
277 out.emplace_back(binding);
278 continue;
279 }
280 for (const auto& focus : binding.spec.focus) {
281 // Determine if focus string allows this binding
282 if (Gui::matchFocusString(focus)) {
283 out.emplace_back(binding);
284 break;
285 }
286 }
287 }
288 }
289
290 return out;
291}
292
293std::vector<KeyBinding> HotkeyManager::listAllKeybinds() {
294 std::lock_guard<std::mutex> l(lock);

Callers 2

find_active_keybindingsFunction · 0.80

Calls 1

emptyMethod · 0.45

Tested by

no test coverage detected