MCPcopy Create free account
hub / github.com/Hopson97/MineCraft-One-Week-Challenge / isKeyPressed

Method isKeyPressed

Source/Input/ToggleKey.cpp:8–17  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6}
7
8bool ToggleKey::isKeyPressed()
9{
10 if (m_delayTimer.getElapsedTime().asSeconds() > 0.2) {
11 if (sf::Keyboard::isKeyPressed(m_key)) {
12 m_delayTimer.restart();
13 return true;
14 }
15 }
16 return false;
17}

Callers 4

updateMethod · 0.80
renderMethod · 0.80
handleInputMethod · 0.80
mouseInputMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected