diff --git a/input.cpp b/input.cpp index 1688bd7..3dc2148 100644 --- a/input.cpp +++ b/input.cpp @@ -31,7 +31,6 @@ void Input::updateEvents(){ /* global affectation */ kb = keybindings[current_context]; - /* event-parsing loop */ while(window->pollEvent(event)){ switch(event.type){ @@ -72,13 +71,14 @@ void Input::updateEvents(){ case sf::Event::MouseLeft: //action MouseLeft break; - } - for (auto key: heldkeys){ - action_file.push(kb.getHoldAction(key)); - } + } + } + for (auto key: heldkeys){ + action_file.push(kb.getHoldAction(key)); } } + int Input::getAction() { if (action_file.empty()) @@ -88,6 +88,7 @@ int Input::getAction() return val; } + /* context-related functions */ void Input::addContext(Context context) { @@ -112,7 +113,6 @@ bool Input::isCloseRequested() const return closeRequested; } - /* keyboard-related functions */ bool Input::isKeyPressed(int key) const