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

Author Topic: keep the mouse inside the window [ résolu / solved ]  (Read 2521 times)

0 Members and 1 Guest are viewing this topic.

kaz

  • Newbie
  • *
  • Posts: 3
    • View Profile
keep the mouse inside the window [ résolu / solved ]
« on: January 19, 2009, 04:58:22 pm »
Hello,

I started an OpenGL/SFML engine,
http://img259.imageshack.us/my.php?image=enginenl0.jpg
and I actualy working on camera class.
I would like to keep the mouse inside the window to allow
camera to make a full spin when the mouse stay near a border

I try to do that by moving the mouse position
but when the mouse moving very fast it still going out of the window
and when it working normally the mouse shaking so it s not so nice

If someone can give me some suggestion about an other way to process
or what is wrong in my way, I will really appreciate
 
Thanks,
SK


edit : solved
I made a fake mouse cursor when I want it
and the real one stay in the middle of the window
after each move I calculate relative position and replace it in middle :)

Daazku

  • Hero Member
  • *****
  • Posts: 896
    • View Profile
keep the mouse inside the window [ résolu / solved ]
« Reply #1 on: January 19, 2009, 06:01:43 pm »
Fullscreen is the only solution i think.

Because in windowed mode you have no control on mouse...
Pensez à mettre le tag [Résolu] une fois la réponse à votre question trouvée.
Remember to add the tag [Solved] when you got an answer to your question.

benschg

  • Newbie
  • *
  • Posts: 5
    • ICQ Messenger - 20609351
    • View Profile
    • http://www.virtamed.com
keep the mouse inside the window [ résolu / solved ]
« Reply #2 on: February 25, 2010, 10:38:22 am »
I have the same problem in our program.

When I push down a mouse button I want the application to grab the mouse.

For me it is not really an option that the mouse is then kept in the center of the screen, and hidden so the user does not realize what happenes.
The only way to do so is by setting the mouse position to the center of the screen which fires up an event and does not work if the window is too small and the mouse movement too fast. Also it defeats Drag'n'Drop...

So I wonder is there a way (Windows only) to get mouse move events that happen outside of the Window area while the window is focused?
Or is it possible to grab the mouse and keyboard input exclusively