Hello,
My colleague and I are developing an network based application but we did not manage to put the keyboard listening event into an SFML thread.
We would like the listening events to be non blocking:
Our application must have 2 infinite loops allowing us to :
1. Listen to the network requests. ( synchronized sockets)
2. Listen to the keyboard events.
All we've manage to do so fare when putting the listening events in a thread is either a segmentation fault or the application would simply ignore those events.
So our question is :
How can we create a non blocking keyboard listening event?
An other thing would be how could we avoid being in the pollEvent loop all the time :
while (renderWindow.isOpen())
{
sf::Event event;
while (renderWindow.pollEvent(event))
{
//handle events
}
}
when we are trying to actions which are not related to events?
Thanks
PS: If a solution existe using the SFML network module we are not allowed to use it and we have to use the Posix sockets.