| 267 | } |
| 268 | |
| 269 | std::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 | |
| 293 | std::vector<KeyBinding> HotkeyManager::listAllKeybinds() { |
| 294 | std::lock_guard<std::mutex> l(lock); |
no test coverage detected