Page 1 of 1

Why wont the cursor leave the screen?

Posted: Fri Aug 18, 2006 11:00 am
by ..::Origin::..
One thing i always fine when using the Mouse functions ( for games ) is that the mouse will never leave the window/screen.. This is kind of stupid, is there a way to allow it to leave?

Posted: Fri Aug 18, 2006 11:09 am
by Trond
See ReleaseMouse()

Posted: Fri Aug 18, 2006 11:09 am
by netmaestro
It's only an issue for windowed screens, as it would be odd indeed if the mouse would leave a fullscreen game. For windowed screens, if you don't use InitMouse() and ExamineMouse() the pointer will go anywhere on the desktop. You just have to use the API equivalents for the mouse functions, such as GetAsyncKeystate, GetCursorPos, etc.

Posted: Fri Aug 18, 2006 11:13 am
by ..::Origin::..
Alright, but ReleaseMouse() pretty much freezes the game itself...And no its not different for fullscreens, sorry if i added some confusion.

Incase your wondering, This is for a map editor/maker, i'm using API on the outside, but using a screen on the window.

It would be fine to freeze it when its lost focus, but.. the question is how on earth do they defocus it without Alt+Shift?

Posted: Fri Aug 18, 2006 11:43 am
by Trond
..::Origin::.. wrote:Alright, but ReleaseMouse() pretty much freezes the game itself...
Hmm, try to not call ExamineMouse() while RelaseMouse() is called.