fix heldkeys processing loop in updateEvents()
This commit is contained in:
parent
cb384a676f
commit
3da7e19b5f
10
input.cpp
10
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){
|
||||
@ -73,12 +72,13 @@ void Input::updateEvents(){
|
||||
//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
|
||||
|
Loading…
x
Reference in New Issue
Block a user