fix heldkeys processing loop in updateEvents()
This commit is contained in:
parent
cb384a676f
commit
3da7e19b5f
12
input.cpp
12
input.cpp
@ -31,7 +31,6 @@ void Input::updateEvents(){
|
|||||||
/* global affectation */
|
/* global affectation */
|
||||||
kb = keybindings[current_context];
|
kb = keybindings[current_context];
|
||||||
|
|
||||||
|
|
||||||
/* event-parsing loop */
|
/* event-parsing loop */
|
||||||
while(window->pollEvent(event)){
|
while(window->pollEvent(event)){
|
||||||
switch(event.type){
|
switch(event.type){
|
||||||
@ -72,13 +71,14 @@ void Input::updateEvents(){
|
|||||||
case sf::Event::MouseLeft:
|
case sf::Event::MouseLeft:
|
||||||
//action MouseLeft
|
//action MouseLeft
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
for (auto key: heldkeys){
|
}
|
||||||
action_file.push(kb.getHoldAction(key));
|
for (auto key: heldkeys){
|
||||||
}
|
action_file.push(kb.getHoldAction(key));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int Input::getAction()
|
int Input::getAction()
|
||||||
{
|
{
|
||||||
if (action_file.empty())
|
if (action_file.empty())
|
||||||
@ -88,6 +88,7 @@ int Input::getAction()
|
|||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* context-related functions */
|
/* context-related functions */
|
||||||
void Input::addContext(Context context)
|
void Input::addContext(Context context)
|
||||||
{
|
{
|
||||||
@ -112,7 +113,6 @@ bool Input::isCloseRequested() const
|
|||||||
return closeRequested;
|
return closeRequested;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* keyboard-related functions */
|
/* keyboard-related functions */
|
||||||
|
|
||||||
bool Input::isKeyPressed(int key) const
|
bool Input::isKeyPressed(int key) const
|
||||||
|
Loading…
x
Reference in New Issue
Block a user