Orxonox
0.0.5 Codename: Arcturus
|
Handles the KeyBinders and supplies them throughout the game. More...
#include </home/jenkins/workspace/orxonox_doxygen_trunk/src/libraries/core/input/KeyBinderManager.h>
Public Member Functions | |
KeyBinderManager () | |
~KeyBinderManager () | |
KeyBinder * | get (const std::string &name) |
Returns a pointer to a KeyBinder (creates it if not yet loaded) More... | |
InputHandler * | getAsHandler (const std::string &name) |
Like get() but return value is of type InputHandler* (so you don't have to include KeyBinder.h) More... | |
KeyBinder * | getCurrent () |
Returns the currently selected KeyBinder. More... | |
InputHandler * | getCurrentAsHandler () |
Like getCurrent(), but returns it as InputHandler* (so you don't have to include KeyBinder.h) More... | |
KeyBinder * | getDefault () |
Returns the default KeyBinder. More... | |
InputHandler * | getDefaultAsHandler () |
Returns the default KeyBinder as InputHandler* (so you don't have to include KeyBinder.h) More... | |
const std::string & | getDefaultFilename () |
Returns the filename of the default key bindings. More... | |
void | keybind (const std::string &command) |
Bind 'command' to any key pressed after this call (use with care!) More... | |
void | load (const std::string &filename) |
Loads a KeyBinder by creating it (no different from get() except for the return value) More... | |
void | registerKeybindCallback (LuaFunctor *function) |
void | setConfigValues () |
void | setCurrent (const std::string &filename) |
Selects the current KeyBinder and creates it if not yet loaded. More... | |
void | setToDefault () |
Selects the default KeyBinder as current one. More... | |
void | tkeybind (const std::string &command) |
Bind 'command' to any key pressed after this call (use with care!), but temporarily (no file save) More... | |
void | tunbind (const std::string &binding) |
void | unbind (const std::string &binding) |
void | unload (const std::string &filename) |
Destroys a KeyBinder completely (does nothing if not yet loaded) More... | |
Public Member Functions inherited from orxonox::Configurable | |
Configurable () | |
void | setConfigValues () |
Function to collect the SetConfigValue-macro calls. More... | |
Public Member Functions inherited from orxonox::Listable | |
Listable () | |
Constructor: Allocates space in the element list. More... | |
Listable (Context *context) | |
Constructor: Allocates space in the element list and assigns the context. More... | |
virtual | ~Listable () |
Destructor: Removes the object from the object-lists. More... | |
Context * | getContext () const |
void | setContext (Context *context) |
Changes the context. More... | |
void | unregisterObject () |
Removes this object from the object-lists. More... | |
Public Member Functions inherited from orxonox::Identifiable | |
Identifiable () | |
Constructor: Sets the default values. More... | |
virtual | ~Identifiable () |
ORX_FORCEINLINE void * | getDerivedPointer (unsigned int classID) |
Returns a valid pointer of any derived type that is registered in the class hierarchy. More... | |
template<class T > | |
ORX_FORCEINLINE T * | getDerivedPointer (unsigned int classID) |
Version of getDerivedPointer with template. More... | |
template<class T > | |
ORX_FORCEINLINE const T * | getDerivedPointer (unsigned int classID) const |
Const version of getDerivedPointer with template. More... | |
Identifier * | getIdentifier () const |
Returns the Identifier of the object. More... | |
bool | isA (const Identifier *identifier) |
Returns true if the object's class is of the given type or a derivative. More... | |
template<class B > | |
bool | isA (const SubclassIdentifier< B > *identifier) |
Returns true if the object's class is of the given type or a derivative. More... | |
bool | isA (const Identifiable *object) |
Returns true if the object's class is of the given type or a derivative. More... | |
bool | isChildOf (const Identifier *identifier) |
Returns true if the object's class is a child of the given type. More... | |
template<class B > | |
bool | isChildOf (const SubclassIdentifier< B > *identifier) |
Returns true if the object's class is a child of the given type. More... | |
bool | isChildOf (const Identifiable *object) |
Returns true if the object's class is a child of the given type. More... | |
bool | isDirectChildOf (const Identifier *identifier) |
Returns true if the object's class is a direct child of the given type. More... | |
template<class B > | |
bool | isDirectChildOf (const SubclassIdentifier< B > *identifier) |
Returns true if the object's class is a direct child of the given type. More... | |
bool | isDirectChildOf (const Identifiable *object) |
Returns true if the object's class is a direct child of the given type. More... | |
bool | isDirectParentOf (const Identifier *identifier) |
Returns true if the object's class is a direct parent of the given type. More... | |
template<class B > | |
bool | isDirectParentOf (const SubclassIdentifier< B > *identifier) |
Returns true if the object's class is a direct parent of the given type. More... | |
bool | isDirectParentOf (const Identifiable *object) |
Returns true if the object's class is a direct child of the given type. More... | |
bool | isExactlyA (const Identifier *identifier) |
Returns true if the object's class is exactly of the given type. More... | |
template<class B > | |
bool | isExactlyA (const SubclassIdentifier< B > *identifier) |
Returns true if the object's class is exactly of the given type. More... | |
bool | isExactlyA (const Identifiable *object) |
Returns true if the object's class is exactly of the given type. More... | |
bool | isParentOf (const Identifier *identifier) |
Returns true if the object's class is a parent of the given type. More... | |
template<class B > | |
bool | isParentOf (const SubclassIdentifier< B > *identifier) |
Returns true if the object's class is a parent of the given type. More... | |
bool | isParentOf (const Identifiable *object) |
Returns true if the object's class is a parent of the given type. More... | |
Static Public Member Functions | |
static KeyBinderManager & | getInstance () |
Static Public Member Functions inherited from orxonox::Singleton< KeyBinderManager > | |
static bool | exists () |
Tells whether the singleton has been created. More... | |
static KeyBinderManager & | getInstance () |
Returns a reference to the singleton instance. More... | |
Private Member Functions | |
KeyBinderManager (const KeyBinderManager &)=delete | |
void | defaultFilenameChanged () |
void | keybindInternal (const std::string &command, bool bTemporary) |
void | keybindKeyPressed (const std::string &keyName) |
KeyBinderManager & | operator= (const KeyBinderManager &)=delete |
Private Attributes | |
bool | bBinding_ |
Function to be called when key was pressed after "keybind" command. More... | |
bool | bDefaultFileLoaded_ |
All loaded KeyBinders. More... | |
std::map< std::string, KeyBinder * > | binders_ |
Currently selected KeyBinder (never nullptr!) More... | |
bool | bTemporary_ |
Tells whether a key binding process is active. More... | |
std::shared_ptr< LuaFunctor > | callbackFunction_ |
Name of the file with the default key bindings. More... | |
std::string | command_ |
Stores tkeybind/keybind value. More... | |
KeyBinder * | currentBinder_ |
std::string | defaultFilename_ |
Tells whether the default one is loaded. More... | |
Static Private Attributes | |
static KeyBinderManager * | singletonPtr_s |
Stores the command received by (t)keybind. More... | |
Friends | |
class | Singleton< KeyBinderManager > |
Additional Inherited Members | |
Protected Member Functions inherited from orxonox::Singleton< KeyBinderManager > | |
Singleton () | |
Constructor sets the singleton instance pointer. More... | |
virtual | ~Singleton () |
Destructor resets the singleton instance pointer. More... | |
Handles the KeyBinders and supplies them throughout the game.
This interface merely serves to provide a static "keybind" command that always maps to the currently active KeyBinder. You can set that with setCurrent(). There is also a default one, retrieved with getDefault(). The idea is that mostly the default KeyBinder is active except for special situations (mini-game for inst).
orxonox::KeyBinderManager::KeyBinderManager | ( | ) |
orxonox::KeyBinderManager::~KeyBinderManager | ( | ) |
|
privatedelete |
|
private |
KeyBinder * orxonox::KeyBinderManager::get | ( | const std::string & | name | ) |
Returns a pointer to a KeyBinder (creates it if not yet loaded)
InputHandler * orxonox::KeyBinderManager::getAsHandler | ( | const std::string & | name | ) |
Like get() but return value is of type InputHandler* (so you don't have to include KeyBinder.h)
|
inline |
Returns the currently selected KeyBinder.
InputHandler * orxonox::KeyBinderManager::getCurrentAsHandler | ( | ) |
Like getCurrent(), but returns it as InputHandler* (so you don't have to include KeyBinder.h)
InputHandler * orxonox::KeyBinderManager::getDefaultAsHandler | ( | ) |
Returns the default KeyBinder as InputHandler* (so you don't have to include KeyBinder.h)
|
inline |
Returns the filename of the default key bindings.
|
inlinestatic |
|
inline |
Bind 'command' to any key pressed after this call (use with care!)
|
private |
|
private |
void orxonox::KeyBinderManager::load | ( | const std::string & | filename | ) |
|
privatedelete |
void orxonox::KeyBinderManager::registerKeybindCallback | ( | LuaFunctor * | function | ) |
void orxonox::KeyBinderManager::setCurrent | ( | const std::string & | filename | ) |
Selects the current KeyBinder and creates it if not yet loaded.
|
inline |
Selects the default KeyBinder as current one.
|
inline |
Bind 'command' to any key pressed after this call (use with care!), but temporarily (no file save)
|
inline |
|
inline |
void orxonox::KeyBinderManager::unload | ( | const std::string & | filename | ) |
Destroys a KeyBinder completely (does nothing if not yet loaded)
|
friend |
|
private |
Function to be called when key was pressed after "keybind" command.
|
private |
All loaded KeyBinders.
|
private |
Currently selected KeyBinder (never nullptr!)
|
private |
Tells whether a key binding process is active.
|
private |
Name of the file with the default key bindings.
|
private |
Stores tkeybind/keybind value.
|
private |
|
private |
Tells whether the default one is loaded.
|
staticprivate |
Stores the command received by (t)keybind.