MCPcopy Create free account
hub / github.com/EasyRPG/Player / SimulateButtonPress

Method SimulateButtonPress

src/input.cpp:411–434  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

409}
410
411void Input::SimulateButtonPress(Input::InputButton button) {
412 switch (button) {
413 case Input::UP:
414 case Input::DOWN:
415 case Input::LEFT:
416 case Input::RIGHT:
417 {
418 // Directional movement has its own input handling
419 // These buttons need to be simulated on a lower level,
420 // or else those movement actions will be overwritten
421 auto& cfg = source->GetConfig();
422 for (auto& bm : cfg.buttons) {
423 if (bm.first == button) {
424 source->SimulateKeyPress(bm.second);
425 break;
426 }
427 }
428 break;
429 }
430 default:
431 break;
432 }
433 UpdateButton(button, true);
434}

Callers

nothing calls this directly

Calls 3

UpdateButtonFunction · 0.85
SimulateKeyPressMethod · 0.80
GetConfigMethod · 0.45

Tested by

no test coverage detected