Initial first steps in pulling the SFML event processing out of the gui::fsm so that I can handle more complex things like drag and drop.

This commit is contained in:
Zed A. Shaw 2025-06-05 01:23:52 -04:00
parent 0674908e49
commit 5aa54d875f
9 changed files with 194 additions and 146 deletions

View file

@ -282,9 +282,11 @@ namespace gui {
void FSM::handle_keyboard_mouse() {
while(const auto ev = $window.pollEvent()) {
auto gui_ev = $router.process_event(ev);
if(ev->is<sf::Event::Closed>()) {
event(Event::QUIT);
if(gui_ev != gui::Event::TICK) {
event(gui_ev);
continue;
}
if(const auto* mouse = ev->getIf<sf::Event::MouseButtonPressed>()) {