SFML community forums

Help => Window => Topic started by: Acrobat on May 22, 2012, 02:22:57 pm

Title: Mouse Leave event
Post by: Acrobat on May 22, 2012, 02:22:57 pm
recently noticed that sometimes MouseLeft event is not generated when the mouse button is pressed
Windows 7, VS2010 debug/release
to reproduce :
1. set a breakpoint
2. press left mouse button and move the mouse out of the window (fast,  cant reproduse while moving mouse slowly)
In that case event is generated when you release the button.

code:
   sf::RenderWindow win(sf::VideoMode(1024, 768), "Show", sf::Style::Close);
   while (win.isOpen()) {
      sf::Event event;
      while (win.pollEvent(event)) {
         if (event.type == sf::Event::MouseLeft) {
            int setBreakpointHere = 0;
            setBreakpointHere ++;
         }
         if (event.type == sf::Event::Closed) {
            win.close();
         }
      }
      win.clear();
      win.display();
   }
 

posible workaround : http://www.gamedev.net/topic/191870-wm_mouseleave-problem/ (http://www.gamedev.net/topic/191870-wm_mouseleave-problem/)
Title: Re: Mouse Leave event
Post by: Laurent on May 22, 2012, 02:24:56 pm
Thanks.

This should be added to the bug tracker so that it is not forgotten.
Title: Re: Mouse Leave event
Post by: Acrobat on May 22, 2012, 02:28:56 pm
added : https://github.com/SFML/SFML/issues/225