SFML community forums

Help => General => Topic started by: Ockonal on August 24, 2010, 09:10:52 am

Title: How to catch mouse
Post by: Ockonal on August 24, 2010, 09:10:52 am
Hello, by default, mouse isn't catched by application, so I'm able to move cursor out the window area. How can I bind/catch it for my application?
Title: How to catch mouse
Post by: Mindiell on August 24, 2010, 09:28:30 am
Normally, there is a sf::Window::SetCrsorPosition (http://www.sfml-dev.org/documentation/2.0/classsf_1_1Window.htm#0f7ff2ff7d6f1af0e4a2b3b82b7336cc).
But if you are using a windowed app, you should not, IMO, block the cursor (apart if you have a key (like escape maybe) to release the mouse).
Title: How to catch mouse
Post by: newn on August 24, 2010, 09:46:47 am
http://www.sfml-dev.org/tutorials/1.6/graphics-views.php

This might be helpful, there's some code about the mouse... I'm a newbie myself, don't know if that's what you want, but maybe it'll help anyway. ;)