Blue Brain BioExplorer
core::KeyboardHandler Class Reference

The KeyboardHandler class manages keyboard shortcuts and special keys. More...

#include <KeyboardHandler.h>

Public Member Functions

void registerKeyboardShortcut (const unsigned char key, const std::string &description, std::function< void()> functor)
 Registers a keyboard shortcut. More...
 
void unregisterKeyboardShortcut (const unsigned char key)
 Unregisters a keyboard shortcut. More...
 
void handleKeyboardShortcut (const unsigned char key)
 Handles a keyboard shortcut. More...
 
void registerSpecialKey (const SpecialKey key, const std::string &description, std::function< void()> functor)
 Registers a special key. More...
 
void unregisterSpecialKey (const SpecialKey key)
 Unregisters a special key. More...
 
void handle (const SpecialKey key)
 Handles a special key. More...
 
const std::vector< std::string > & help () const
 Returns a vector of help string descriptions for all registered keyboard shortcuts and special keys. More...
 
const std::string getKeyboardShortcutDescription (const unsigned char key)
 Returns the description of a specific keyboard shortcut. More...
 

Detailed Description

The KeyboardHandler class manages keyboard shortcuts and special keys.

Definition at line 48 of file KeyboardHandler.h.

Member Function Documentation

◆ getKeyboardShortcutDescription()

const std::string core::KeyboardHandler::getKeyboardShortcutDescription ( const unsigned char  key)

Returns the description of a specific keyboard shortcut.

Parameters
keyThe unsigned char representing the key of the shortcut
Returns
A const string reference to the description of the keyboard shortcut

Definition at line 144 of file KeyboardHandler.cpp.

◆ handle()

void core::KeyboardHandler::handle ( const SpecialKey  key)

Handles a special key.

Parameters
keyThe SpecialKey enum value representing the special key

Definition at line 93 of file KeyboardHandler.cpp.

◆ handleKeyboardShortcut()

void core::KeyboardHandler::handleKeyboardShortcut ( const unsigned char  key)

Handles a keyboard shortcut.

Parameters
keyThe unsigned char representing the key of the shortcut

Definition at line 58 of file KeyboardHandler.cpp.

◆ help()

const std::vector< std::string > & core::KeyboardHandler::help ( ) const

Returns a vector of help string descriptions for all registered keyboard shortcuts and special keys.

Returns
A const reference to a vector of help string descriptions

Definition at line 139 of file KeyboardHandler.cpp.

◆ registerKeyboardShortcut()

void core::KeyboardHandler::registerKeyboardShortcut ( const unsigned char  key,
const std::string &  description,
std::function< void()>  functor 
)

Registers a keyboard shortcut.

Parameters
keyThe unsigned char representing the key to be pressed
descriptionA string description of the shortcut
functorA void function to be called when the shortcut is triggered

Definition at line 33 of file KeyboardHandler.cpp.

◆ registerSpecialKey()

void core::KeyboardHandler::registerSpecialKey ( const SpecialKey  key,
const std::string &  description,
std::function< void()>  functor 
)

Registers a special key.

Parameters
keyThe SpecialKey enum value representing the special key
descriptionA string description of the special key
functorA void function to be called when the special key is triggered

Definition at line 68 of file KeyboardHandler.cpp.

◆ unregisterKeyboardShortcut()

void core::KeyboardHandler::unregisterKeyboardShortcut ( const unsigned char  key)

Unregisters a keyboard shortcut.

Parameters
keyThe unsigned char representing the key of the shortcut

Definition at line 50 of file KeyboardHandler.cpp.

◆ unregisterSpecialKey()

void core::KeyboardHandler::unregisterSpecialKey ( const SpecialKey  key)

Unregisters a special key.

Parameters
keyThe SpecialKey enum value representing the special key

Definition at line 85 of file KeyboardHandler.cpp.


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