Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » Change or hold position of mouse

Credits go to Edgar Reynaldo for helping out!
This thread is locked; no one can reply to it. rss feed Print
Change or hold position of mouse
DubbelD75
Member #12,959
June 2011

Hi,

I want to know if it's possible to change and/or hold the position of the mouse by code.

As example, I have an object,movable when dragged with the mouse, rotating around another object. I want the rotating object to move clockwise when the mouse moves right and counter clockwise when left. The rotating part isn't the problem. As you can see an infinite number of mickeys is possible to the left and right. This is a problem since I'm working in windowed mode and need the mouse to remain in the window.
My question is: how can I lock the mouse in place so it won't leave the screen when you hold the left mouse button down?

Help is really appreciated ^_^

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

DubbelD75
Member #12,959
June 2011

Wow I feel kinda stupid right now. I really couldn't find it.
Thanks!

Go to: