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

Author Topic: How to catch mouse  (Read 2279 times)

0 Members and 1 Guest are viewing this topic.

Ockonal

  • Jr. Member
  • **
  • Posts: 58
    • ICQ Messenger - 449909010
    • View Profile
    • WinCode
How to catch mouse
« 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?
Developing 2d engine&game using: sfml, box2d, librocket, spark2, zoom&zoost, thor

Mindiell

  • Hero Member
  • *****
  • Posts: 1261
    • ICQ Messenger - 41484135
    • View Profile
How to catch mouse
« Reply #1 on: August 24, 2010, 09:28:30 am »
Normally, there is a sf::Window::SetCrsorPosition.
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).
Mindiell
----

newn

  • Guest
How to catch mouse
« Reply #2 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. ;)

 

anything