16 #ifndef SURGSIM_BLOCKS_KEYBOARDTOGGLESCOMPONENTBEHAVIOR_H 17 #define SURGSIM_BLOCKS_KEYBOARDTOGGLESCOMPONENTBEHAVIOR_H 19 #include <unordered_map> 20 #include <unordered_set> 22 #include "SurgSim/Devices/Keyboard/KeyCode.h" 23 #include "SurgSim/Framework/Behavior.h" 24 #include "SurgSim/Framework/Macros.h" 41 SURGSIM_STATIC_REGISTRATION(KeyboardTogglesComponentBehavior);
47 typedef std::unordered_map<int, std::unordered_set<std::shared_ptr<SurgSim::Framework::Component>>>
58 void setInputComponent(std::shared_ptr<SurgSim::Framework::Component> inputComponent);
62 std::shared_ptr<SurgSim::Input::InputComponent> getInputComponent()
const;
68 void registerKey(SurgSim::Devices::KeyCode key, std::shared_ptr<SurgSim::Framework::Component> component);
72 void setKeyboardRegistry(
const KeyboardRegistryType& map);
76 const KeyboardRegistryType& getKeyboardRegistry()
const;
80 void update(
double dt)
override;
86 bool doInitialize()
override;
91 bool doWakeUp()
override;
95 bool m_keyPressedLastUpdate;
98 std::shared_ptr<SurgSim::Input::InputComponent> m_inputComponent;
101 KeyboardRegistryType m_registry;
107 #endif //SURGSIM_BLOCKS_KEYBOARDTOGGLESCOMPONENTBEHAVIOR_H Wraps glewInit() to separate the glew opengl definitions from the osg opengl definitions only imgui n...
Definition: AddRandomSphereBehavior.cpp:36
This behavior is used to control the activity of registered components.
Definition: KeyboardTogglesComponentBehavior.h:44
Behaviors perform actions.
Definition: Behavior.h:40