MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / createTriggerGroups

Method createTriggerGroups

src/Core/Input/InputInitializer.cpp:293–314  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

291 }
292
293 void InputManager::createTriggerGroups(Triggers::TriggerManager& triggers)
294 {
295 t_inputs = triggers.createTriggerGroup("Event", "Keys");
296 for (auto const& [key, val] : m_inputs)
297 {
298 Input::InputButton* button = val.get();
299 t_inputs->add(button->getName());
300 t_inputs->onRegister(
301 button->getName(), [button, this](const Triggers::TriggerEnv& env) {
302 m_key_monitors.push_back(this->monitor(*button));
303 });
304 t_inputs->onUnregister(
305 button->getName(), [button, this](const Triggers::TriggerEnv& env) {
306 const auto position = std::find_if(m_key_monitors.begin(),
307 m_key_monitors.end(), [button](const auto& monitor) {
308 return &monitor->getButton() == button;
309 });
310 if (position != m_key_monitors.end())
311 m_key_monitors.erase(position);
312 });
313 }
314 }
315
316 std::vector<std::string> InputManager::getAllInputButtonNames() const
317 {

Callers 1

initMethod · 0.95

Calls 11

monitorMethod · 0.95
createTriggerGroupMethod · 0.80
getMethod · 0.45
addMethod · 0.45
getNameMethod · 0.45
onRegisterMethod · 0.45
push_backMethod · 0.45
onUnregisterMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
eraseMethod · 0.45

Tested by

no test coverage detected