16 #ifndef SURGSIM_BLOCKS_KEYBEHAVIOR_H 17 #define SURGSIM_BLOCKS_KEYBEHAVIOR_H 22 #include "SurgSim/Framework/Behavior.h" 45 void update(
double dt)
override;
46 bool doInitialize()
override;
47 bool doWakeUp()
override;
51 void setInputComponent(std::shared_ptr<Framework::Component> inputComponent);
55 std::shared_ptr<Input::InputComponent> getInputComponent()
const;
61 static bool registerKey(
int keycode,
const std::string& description);
66 static bool unregisterKey(
int keycode);
73 static void clearKeyMap();
78 virtual void onKeyDown(
int key) = 0;
82 virtual void onKeyUp(
int key) = 0;
93 static std::unordered_map<int, std::string> m_keyMap;
Wraps glewInit() to separate the glew opengl definitions from the osg opengl definitions only imgui n...
Definition: AddRandomSphereBehavior.cpp:36
int m_lastKey
Keep track if the key was pressed the last time around.
Definition: KeyBehavior.h:88
std::shared_ptr< Input::InputComponent > m_inputComponent
Input component needs to provide key.
Definition: KeyBehavior.h:85
Behaviors perform actions.
Definition: Behavior.h:40
Behavior to abstract the functionality of keyboard driven behaviors, can be programmed to react to a ...
Definition: KeyBehavior.h:36
static boost::mutex m_keyMapMutex
Definition: KeyBehavior.h:92