wrap pollEvent() to guarantee all loops handle modifiers (#477)

This commit is contained in:
2024-11-23 16:46:54 -06:00
committed by GitHub
parent e39c930eed
commit b441401475
14 changed files with 45 additions and 27 deletions

View File

@@ -214,7 +214,7 @@ void handle_events() {
menuChoiceId=-1;
}
#endif
while(mainPtr.pollEvent(currentEvent)) handle_one_event(currentEvent);
while(pollEvent(mainPtr, currentEvent)) handle_one_event(currentEvent);
redraw_everything();
@@ -225,9 +225,6 @@ void handle_events() {
void handle_one_event (const sf::Event& event) {
// If it's just a modifier key, update the state
if(kb.handleModifier(event)) return;
// Check if the menubar wants to handle this event.
if(menuBarProcessEvent(event)) return;