Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - chatran20

Pages: [1]
1
System / Odd behaviour managing events in a threaded renderwindow
« on: July 02, 2011, 09:02:05 pm »
Still it's very suspicious that it can handle every event fine except the arrow keys..  :shock:
Anyway, thanks!

2
System / Odd behaviour managing events in a threaded renderwindow
« on: July 02, 2011, 09:20:22 am »
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:


Code: [Select]

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?

Pages: [1]
anything