MCPcopy Create free account
hub / github.com/diasurgical/DevilutionX / HandleInputEvent

Function HandleInputEvent

Source/control.cpp:1566–1579  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1564
1565template <typename InputStateType>
1566bool HandleInputEvent(const SDL_Event &event, std::optional<InputStateType> &inputState)
1567{
1568 if (!inputState) {
1569 return false; // No input state to handle
1570 }
1571
1572 if constexpr (std::is_same_v<InputStateType, TextInputState>) {
1573 return HandleTextInputEvent(event, *inputState);
1574 } else if constexpr (std::is_same_v<InputStateType, NumberInputState>) {
1575 return HandleNumberInputEvent(event, *inputState);
1576 }
1577
1578 return false; // Unknown input state type
1579}
1580
1581bool HandleTalkTextInputEvent(const SDL_Event &event)
1582{

Callers 2

HandleTalkTextInputEventFunction · 0.70

Calls 2

HandleTextInputEventFunction · 0.85
HandleNumberInputEventFunction · 0.85

Tested by

no test coverage detected