#include <shortcut_manager.h>
Public Member Functions | |
| void | RegisterShortcut (const std::string &name, const std::vector< ImGuiKey > &keys, Shortcut::Scope scope=Shortcut::Scope::kGlobal) |
| void | RegisterShortcut (const std::string &name, const std::vector< ImGuiKey > &keys, std::function< void()> callback, Shortcut::Scope scope=Shortcut::Scope::kGlobal) |
| void | RegisterShortcut (const std::string &name, ImGuiKey key, std::function< void()> callback, Shortcut::Scope scope=Shortcut::Scope::kGlobal) |
| void | RegisterCommand (const std::string &name, std::function< void()> callback, Shortcut::Scope scope=Shortcut::Scope::kGlobal) |
| Register a command without keyboard shortcut (command palette only) | |
| void | ExecuteShortcut (const std::string &name) const |
| const Shortcut & | GetShortcut (const std::string &name) const |
| const Shortcut * | FindShortcut (const std::string &name) const |
| std::function< void()> | GetCallback (const std::string &name) const |
| const std::string | GetKeys (const std::string &name) const |
| const std::unordered_map< std::string, Shortcut > & | GetShortcuts () const |
| bool | UpdateShortcutKeys (const std::string &name, const std::vector< ImGuiKey > &keys) |
| std::vector< Shortcut > | GetShortcutsByScope (Shortcut::Scope scope) const |
| void | RegisterStandardShortcuts (std::function< void()> save_callback, std::function< void()> open_callback, std::function< void()> close_callback, std::function< void()> find_callback, std::function< void()> settings_callback) |
| void | RegisterWindowNavigationShortcuts (std::function< void()> focus_left, std::function< void()> focus_right, std::function< void()> focus_up, std::function< void()> focus_down, std::function< void()> close_window, std::function< void()> split_horizontal, std::function< void()> split_vertical) |
Private Attributes | |
| std::unordered_map< std::string, Shortcut > | shortcuts_ |
Definition at line 35 of file shortcut_manager.h.
|
inline |
Definition at line 37 of file shortcut_manager.h.
References shortcuts_.
Referenced by yaze::editor::anonymous_namespace{shortcut_configurator.cc}::RegisterIfValid(), yaze::editor::anonymous_namespace{shortcut_configurator.cc}::RegisterIfValid(), RegisterStandardShortcuts(), and RegisterWindowNavigationShortcuts().
|
inline |
Definition at line 42 of file shortcut_manager.h.
References shortcuts_.
|
inline |
Definition at line 49 of file shortcut_manager.h.
References shortcuts_.
|
inline |
Register a command without keyboard shortcut (command palette only)
These commands appear in the command palette but have no keyboard binding. Useful for layout presets and other infrequently used commands.
Definition at line 61 of file shortcut_manager.h.
References shortcuts_.
Referenced by yaze::editor::ConfigureEditorShortcuts().
|
inline |
Definition at line 67 of file shortcut_manager.h.
References shortcuts_.
|
inline |
Definition at line 72 of file shortcut_manager.h.
References shortcuts_.
|
inline |
Definition at line 76 of file shortcut_manager.h.
References shortcuts_.
Referenced by yaze::editor::RightPanelManager::GetShortcutLabel().
|
inline |
Definition at line 82 of file shortcut_manager.h.
References shortcuts_.
|
inline |
Definition at line 86 of file shortcut_manager.h.
References yaze::editor::PrintShortcut(), and shortcuts_.

|
inline |
Definition at line 90 of file shortcut_manager.h.
References shortcuts_.
Referenced by yaze::editor::UICoordinator::DrawCommandPalette(), and yaze::editor::ExecuteShortcuts().
| bool yaze::editor::ShortcutManager::UpdateShortcutKeys | ( | const std::string & | name, |
| const std::vector< ImGuiKey > & | keys ) |
Definition at line 264 of file shortcut_manager.cc.
References shortcuts_.
Referenced by yaze::editor::SettingsPanel::DrawEditorShortcuts(), and yaze::editor::SettingsPanel::DrawGlobalShortcuts().
|
inline |
Definition at line 95 of file shortcut_manager.h.
References shortcuts_.
Referenced by yaze::editor::SettingsPanel::DrawEditorShortcuts(), and yaze::editor::SettingsPanel::DrawGlobalShortcuts().
| void yaze::editor::ShortcutManager::RegisterStandardShortcuts | ( | std::function< void()> | save_callback, |
| std::function< void()> | open_callback, | ||
| std::function< void()> | close_callback, | ||
| std::function< void()> | find_callback, | ||
| std::function< void()> | settings_callback ) |
Definition at line 281 of file shortcut_manager.cc.
References RegisterShortcut().

| void yaze::editor::ShortcutManager::RegisterWindowNavigationShortcuts | ( | std::function< void()> | focus_left, |
| std::function< void()> | focus_right, | ||
| std::function< void()> | focus_up, | ||
| std::function< void()> | focus_down, | ||
| std::function< void()> | close_window, | ||
| std::function< void()> | split_horizontal, | ||
| std::function< void()> | split_vertical ) |
Definition at line 315 of file shortcut_manager.cc.
References RegisterShortcut().

|
private |
Definition at line 120 of file shortcut_manager.h.
Referenced by ExecuteShortcut(), FindShortcut(), GetCallback(), GetKeys(), GetShortcut(), GetShortcuts(), GetShortcutsByScope(), RegisterCommand(), RegisterShortcut(), RegisterShortcut(), RegisterShortcut(), and UpdateShortcutKeys().