yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
yaze::editor::ShortcutManager Class Reference

#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 ShortcutGetShortcut (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< ShortcutGetShortcutsByScope (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, Shortcutshortcuts_
 

Detailed Description

Definition at line 35 of file shortcut_manager.h.

Member Function Documentation

◆ RegisterShortcut() [1/3]

void yaze::editor::ShortcutManager::RegisterShortcut ( const std::string & name,
const std::vector< ImGuiKey > & keys,
Shortcut::Scope scope = Shortcut::Scope::kGlobal )
inline

◆ RegisterShortcut() [2/3]

void yaze::editor::ShortcutManager::RegisterShortcut ( const std::string & name,
const std::vector< ImGuiKey > & keys,
std::function< void()> callback,
Shortcut::Scope scope = Shortcut::Scope::kGlobal )
inline

Definition at line 42 of file shortcut_manager.h.

References shortcuts_.

◆ RegisterShortcut() [3/3]

void yaze::editor::ShortcutManager::RegisterShortcut ( const std::string & name,
ImGuiKey key,
std::function< void()> callback,
Shortcut::Scope scope = Shortcut::Scope::kGlobal )
inline

Definition at line 49 of file shortcut_manager.h.

References shortcuts_.

◆ RegisterCommand()

void yaze::editor::ShortcutManager::RegisterCommand ( const std::string & name,
std::function< void()> callback,
Shortcut::Scope scope = Shortcut::Scope::kGlobal )
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_.

◆ ExecuteShortcut()

void yaze::editor::ShortcutManager::ExecuteShortcut ( const std::string & name) const
inline

Definition at line 67 of file shortcut_manager.h.

References shortcuts_.

◆ GetShortcut()

const Shortcut & yaze::editor::ShortcutManager::GetShortcut ( const std::string & name) const
inline

Definition at line 72 of file shortcut_manager.h.

References shortcuts_.

◆ GetCallback()

std::function< void()> yaze::editor::ShortcutManager::GetCallback ( const std::string & name) const
inline

Definition at line 77 of file shortcut_manager.h.

References shortcuts_.

◆ GetKeys()

const std::string yaze::editor::ShortcutManager::GetKeys ( const std::string & name) const
inline

Definition at line 81 of file shortcut_manager.h.

References yaze::editor::PrintShortcut(), and shortcuts_.

Here is the call graph for this function:

◆ GetShortcuts()

auto yaze::editor::ShortcutManager::GetShortcuts ( ) const
inline

◆ UpdateShortcutKeys()

bool yaze::editor::ShortcutManager::UpdateShortcutKeys ( const std::string & name,
const std::vector< ImGuiKey > & keys )

◆ GetShortcutsByScope()

std::vector< Shortcut > yaze::editor::ShortcutManager::GetShortcutsByScope ( Shortcut::Scope scope) const
inline

◆ RegisterStandardShortcuts()

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().

Here is the call graph for this function:

◆ RegisterWindowNavigationShortcuts()

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().

Here is the call graph for this function:

Member Data Documentation

◆ shortcuts_

std::unordered_map<std::string, Shortcut> yaze::editor::ShortcutManager::shortcuts_
private

The documentation for this class was generated from the following files: