MCPcopy Create free account
hub / github.com/Hopson97/HopsonCraft / checkInput

Method checkInput

Source/Input/Function_Toggle_Key.cpp:14–25  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12}
13
14void Toggle::checkInput()
15{
16 if (m_toggleDelay.asMilliseconds() <
17 m_toggleTimer.getElapsedTime().asMilliseconds())
18 {
19 if (sf::Keyboard::isKeyPressed(m_toggleKey))
20 {
21 m_isToogleOn = !m_isToogleOn;
22 m_toggleTimer.restart();
23 }
24 }
25}
26
27Toggle_Bool::Toggle_Bool(sf::Keyboard::Key key, sf::Time delay, bool& value)
28: m_toggleKey (key)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected