I recommend to check the
updated tutorial for event handling, since it comes with example code for each event type (e.g.
MouseWheelScrolled).
You can use
event->is<T>() if you're not interested in any of the event data or the event doesn't have any data, otherwise you can use
event->getIf<T>() to get the event data.
You may also want to use
else if so you don't have to check all the event types.
//while (pWindow->pollEvent(Event))
while (const std::optional Event = pWindow->pollEvent())
{
//if (Event.type == sf::Event::Closed)
if (Event->is<sf::Event::Closed>())
{
pWindow->close(); //> Und raus ..:
}
//if (Event.type == sf::Event::GainedFocus)
else if (Event->is<sf::Event::GainedFocus>()) //> a) ???:
{ .. }
//if (Event.type == sf::Event::LostFocus)
else if (Event->is<sf::Event::LostFocus>()) //> b) ???:
{ .. }
//if (Event.type == sf::Event::MouseWheelScrolled)
else if (const auto* mouseWheelScrolled = Event->getIf<sf::Event::MouseWheelScrolled>())
{
#ifdef ZWIANER_VERSION_K
pMaus->SetlMausMoveZpp((long)mouseWheelScrolled->delta); //> c) ???:
#endif
}
..
}