#include <Keyboard.h>
Public Types | |
typedef bool(*) | KeyCallbackFunc (void *self, int key, int value) |
Public Member Functions | |
std::string | Keyboard::getCommandLineOptions () |
Static Public Member Functions | |
static Keyboard * | getInstance () |
static Keyboard * | getInstance (osg::ArgumentParser *ap) |
static bool | keyChange (int key, int value) |
static bool | addKey (int key, KeyCallbackFunc cb, const std::string &explanation, void *self=NULL) |
static bool | removeKey (int key) |
static bool | useKey (int key) |
static std::string | getDescription () |
static std::string | getCommandLineUsage () |
static std::string | getEnvironmentalVariables () |
static std::string | getKeyboardMouseBindings () |
Protected Types | |
typedef std::map< int, KeyCallbackFunc > | KeyMap |
typedef std::map< int, void * > | DataMap |
Protected Member Functions | |
Keyboard () | |
~Keyboard () | |
Static Protected Attributes | |
static Keyboard * | _single |
static KeyMap | _keyMap |
static DataMap | _dataMap |
static osg::ArgumentParser * | _info |
typedef bool(*) vhdOSG::Keyboard::KeyCallbackFunc(void *self, int key, int value) |
Callback prototype for KeyHandler function.
typedef std::map<int, KeyCallbackFunc> vhdOSG::Keyboard::KeyMap [protected] |
typedef std::map<int, void *> vhdOSG::Keyboard::DataMap [protected] |
vhdOSG::Keyboard::Keyboard | ( | ) | [inline, protected] |
vhdOSG::Keyboard::~Keyboard | ( | ) | [inline, protected] |
Keyboard * Keyboard::getInstance | ( | ) | [static] |
Constructor (static class)
Keyboard * Keyboard::getInstance | ( | osg::ArgumentParser * | ap | ) | [static] |
bool Keyboard::keyChange | ( | int | key, | |
int | value | |||
) | [static] |
Callback plugged to osg to get the keyboard events and refetch them to clients. Provided here for simulated keyboard events (care must be taken for operation requiring to be performed in the drawing thread...).
bool Keyboard::addKey | ( | int | key, | |
KeyCallbackFunc | cb, | |||
const std::string & | explanation, | |||
void * | self = NULL | |||
) | [static] |
Add a callback function for a given key, with client's own data.
key,: | the keyboard entry | |
cb,: | the client's callback function | |
self,: | client's own data provided back upon call to cb |
bool Keyboard::removeKey | ( | int | key | ) | [static] |
Removes an existing callback function for a given key.
key,: | the keyboard entry |
bool Keyboard::useKey | ( | int | key | ) | [static] |
Return true if there is already a callback associated with this key.
std::string Keyboard::getDescription | ( | ) | [static] |
Return the Application description.
std::string Keyboard::getCommandLineUsage | ( | ) | [static] |
Return the Command Line Usage.
std::string vhdOSG::Keyboard::Keyboard::getCommandLineOptions | ( | ) |
Return the Command Line Options.
std::string Keyboard::getEnvironmentalVariables | ( | ) | [static] |
Return the Environment Variables.
std::string Keyboard::getKeyboardMouseBindings | ( | ) | [static] |
Return the Keyboard and Mouse Bindings description.
Keyboard * Keyboard::_single [static, protected] |
Keyboard::KeyMap Keyboard::_keyMap [static, protected] |
Keyboard::DataMap Keyboard::_dataMap [static, protected] |
osg::ArgumentParser * Keyboard::_info [static, protected] |