This one is giving me a hard time. In my program I have a main window and subwindow that runs in a separate thread. The threaded window manages its own events independently of the main window.
It should work fine, and it seems to be able to process every event except the arrow keys!!
It's very strange because if I change the arrow keys to a WASD control it works fine. It seems that the threaded window it's unable to catch the arrow keys events, but I see no reason why. I even checked the code in SFML library that processes key events and I can't see any substantial difference between WASD keys events and arrow keys. So I'm stuck...
My implementation it's something like this:
class MyClass : public sf::Thread
{
sf::RenderWindow *window;
sf::Event event;
bool ok;
public:
MyClass();
~ MyClass();
void Handle_Event();
virtual void Run();
};
void MyClass::Run()
{
while(ok)
{
Handle_Event(); //Handles key events
}
}
Am I doing something wrong?