SFML community forums

Help => Window => Topic started by: Crank1d on March 12, 2010, 05:51:33 pm

Title: Combined event types
Post by: Crank1d on March 12, 2010, 05:51:33 pm
I am new to SFML, so I still learn new stuff about library everyday but I am interested is it possible to combine event types? For example, i want to create rotational camera with OpenGL which user rotates when he press right mouse button and moves mouse. Ive tried something like this:

Code: [Select]
if ((Event.Type == sf::Event::MouseButtonPressed || sf::Event::MouseMoved) && (sf::Mouse::Right))


but it doesn´t do nothing.
If needed, I would post whole source code of application.
Title: Combined event types
Post by: Laurent on March 12, 2010, 07:58:29 pm
You don't want to combine mouse pressed + mouse moved, you want to react on mouse move when the mouse button is pressed, which is something different ;)
Code: [Select]
if (Event.Type == sf::Event::MouseMoved && Window.GetInput().IsMouseButtonDown(...))
Title: Combined event types
Post by: Crank1d on March 12, 2010, 08:47:21 pm
Thanks Laurent! Everything works just fine, you rule.  8)