#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 |
| std::function< void()> | GetCallback (const std::string &name) const |
| const std::string | GetKeys (const std::string &name) const |
| auto | 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_.
|
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 77 of file shortcut_manager.h.
References shortcuts_.
|
inline |
Definition at line 81 of file shortcut_manager.h.
References yaze::editor::PrintShortcut(), and shortcuts_.

|
inline |
Definition at line 85 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 276 of file shortcut_manager.cc.
References shortcuts_.
Referenced by yaze::editor::SettingsPanel::DrawEditorShortcuts(), and yaze::editor::SettingsPanel::DrawGlobalShortcuts().
|
inline |
Definition at line 88 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 293 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 327 of file shortcut_manager.cc.
References RegisterShortcut().

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