16 #ifndef SURGSIM_BLOCKS_KEYBOARDCALLBACKBEHAVIOR_H 17 #define SURGSIM_BLOCKS_KEYBOARDCALLBACKBEHAVIOR_H 21 #include "SurgSim/Devices/Keyboard/KeyCode.h" 22 #include "SurgSim/Framework/Behavior.h" 33 SURGSIM_STATIC_REGISTRATION(KeyboardCallbackBehavior);
39 typedef std::function<void()> CallbackType;
49 void setInputComponent(std::shared_ptr<Framework::Component> inputComponent);
53 std::shared_ptr<Input::InputComponent> getInputComponent()
const;
57 void registerKey(
int key);
62 void registerCallback(CallbackType func);
64 void update(
double dt)
override;
71 bool doInitialize()
override;
73 bool doWakeUp()
override;
77 bool m_keyPressedLastUpdate;
83 CallbackType m_callback;
86 std::shared_ptr<Input::InputComponent> m_inputComponent;
92 #endif //SURGSIM_BLOCKS_KEYBOARDCALLBACKBEHAVIOR_H Wraps glewInit() to separate the glew opengl definitions from the osg opengl definitions only imgui n...
Definition: AddRandomSphereBehavior.cpp:36
Behaviors perform actions.
Definition: Behavior.h:40
This behavior will call the registered callback function when the registered key is pressed...
Definition: KeyboardCallbackBehavior.h:36