Editor API
UnigineEditor public API
UnigineEditor::ShortcutManager Class Reference

This class is used to manage all shortcuts (hotkeys and combinations) and shortcut contexts that you usually see in Windows - Settings - Hotkeys. More...

Static Public Member Functions

static Unigine::Ptr< ShortcutContextcreateContext (const char *context_id, const char *title, ShortcutContext::TYPE context_type=ShortcutContext::TYPE_SHARED, int priority=0)
 Creates a new context using the given parameters (ID, title, type, and priority). More...
 
static bool removeContext (const char *context_id)
 Removes the context with the given ID (all its shortcuts are removed as well). More...
 
static bool hasContext (const char *context_id)
 Returns a value indicating if a context with the given ID exists. More...
 
static Unigine::Ptr< ShortcutContextgetContext (const char *context_id)
 Returns the context with the given ID. More...
 
static void getContexts (Unigine::Vector< Unigine::Ptr< ShortcutContext >> &contexts)
 Collects all registered contexts and puts them to the specified output vector. More...
 
static Unigine::Event< const Unigine::Ptr< ShortcutContext > & > & getEventContextCreated ()
 Event triggered on context creation. More...
 
static Unigine::Event< const char * > & getEventContextRemoved ()
 Event triggered on context removal. More...
 
static Unigine::Event< const Unigine::Ptr< ShortcutContext > &, const Unigine::Ptr< Shortcut > & > & getEventShortcutCreated ()
 Event triggered on shortcut creation. More...
 
static Unigine::Event< const char *, const char * > & getEventShortcutRemoved ()
 Event triggered on shortcut removal. More...
 
static Unigine::Event & getEventKeyboardLayoutChanged ()
 Event triggered on changing keyboard layout. More...
 

Detailed Description

This class is used to manage all shortcuts (hotkeys and combinations) and shortcut contexts that you usually see in Windows - Settings - Hotkeys.

Member Function Documentation

◆ createContext()

static Unigine::Ptr<ShortcutContext> UnigineEditor::ShortcutManager::createContext ( const char *  context_id,
const char *  title,
ShortcutContext::TYPE  context_type = ShortcutContext::TYPE_SHARED,
int  priority = 0 
)
static

Creates a new context using the given parameters (ID, title, type, and priority).

Parameters
context_idID of the context to be created.
titleTitle of the context to be displayed in UnigineEditor.
context_typeType of the context (shared or exclusive).
priorityPriority of the context (a context with a higher priority value takes precedence over others).

◆ getContext()

static Unigine::Ptr<ShortcutContext> UnigineEditor::ShortcutManager::getContext ( const char *  context_id)
static

Returns the context with the given ID.

Parameters
context_idID of the context to be retrieved.

◆ getContexts()

static void UnigineEditor::ShortcutManager::getContexts ( Unigine::Vector< Unigine::Ptr< ShortcutContext >> &  contexts)
static

Collects all registered contexts and puts them to the specified output vector.

Parameters
contextsOutput vector, to receive the list of contexts.

◆ getEventContextCreated()

static Unigine::Event<const Unigine::Ptr<ShortcutContext> &>& UnigineEditor::ShortcutManager::getEventContextCreated ( )
static

Event triggered on context creation.

◆ getEventContextRemoved()

static Unigine::Event<const char *>& UnigineEditor::ShortcutManager::getEventContextRemoved ( )
static

Event triggered on context removal.

◆ getEventKeyboardLayoutChanged()

static Unigine::Event& UnigineEditor::ShortcutManager::getEventKeyboardLayoutChanged ( )
static

Event triggered on changing keyboard layout.

◆ getEventShortcutCreated()

static Unigine::Event<const Unigine::Ptr<ShortcutContext> &, const Unigine::Ptr<Shortcut> &>& UnigineEditor::ShortcutManager::getEventShortcutCreated ( )
static

Event triggered on shortcut creation.

◆ getEventShortcutRemoved()

static Unigine::Event<const char *, const char *>& UnigineEditor::ShortcutManager::getEventShortcutRemoved ( )
static

Event triggered on shortcut removal.

◆ hasContext()

static bool UnigineEditor::ShortcutManager::hasContext ( const char *  context_id)
static

Returns a value indicating if a context with the given ID exists.

Parameters
context_idID of the context to be checked.

◆ removeContext()

static bool UnigineEditor::ShortcutManager::removeContext ( const char *  context_id)
static

Removes the context with the given ID (all its shortcuts are removed as well).

Parameters
context_idID of the context to be removed.
Returns
true if the context was removed successfully.