Track modifier state in the main loops

Really fixes #291
This commit is contained in:
2023-01-13 19:55:24 -05:00
parent 6e238881ae
commit e0418c685a
3 changed files with 12 additions and 0 deletions

View File

@@ -29,6 +29,7 @@
#include "tools/framerate_limiter.hpp"
#include "tools/event_listener.hpp"
#include "tools/drawable_manager.hpp"
#include "tools/keymods.hpp"
#ifdef __APPLE__
short menuChoiceId=-1;
@@ -251,6 +252,9 @@ 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 any of the event listeners want this event.
for (auto& listener : event_listeners) {
if(listener.second->handle_event(event)) return;