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

Author Topic: Mouse Leave event  (Read 1753 times)

0 Members and 1 Guest are viewing this topic.

Acrobat

  • Full Member
  • ***
  • Posts: 153
    • View Profile
Mouse Leave event
« 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/

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: Mouse Leave event
« Reply #1 on: May 22, 2012, 02:24:56 pm »
Thanks.

This should be added to the bug tracker so that it is not forgotten.
Laurent Gomila - SFML developer

Acrobat

  • Full Member
  • ***
  • Posts: 153
    • View Profile
Re: Mouse Leave event
« Reply #2 on: May 22, 2012, 02:28:56 pm »