Capture mouse in window mode ?

Posted By: MaximilianPs

Capture mouse in window mode ? - 05/31/09 19:14

currently i'm developing my game in window mode, but the mouse go out of the window, and controll the camera is a mess crazy

any way to capture and keep the mouse, and in case to release it when i need it ? confused
Posted By: Widi

Re: Capture mouse in window mode ? - 05/31/09 19:53

#include <windows.h>
and then you can set the Window Mouse Position with
SetCursorPos (x,y);
Posted By: MaximilianPs

Re: Capture mouse in window mode ? - 06/01/09 08:35

ok, now i've a second problem
i can't find how to know the current window size blush

i suppose, that i've to say something like (in peudocode)

if(my_mouseX > windows_length) SetCursorPos(windows_length,my_mouseY)
if(my_mouseX < 0 SetCursorPos) SetCursorPos(0,my_mouseY)
if(my_mouseY > windows_height) SetCursorPos(my_mouseX, windows_height)
if(my_mouseY < 0 SetCursorPos) SetCursorPos(my_mouseX,0)

i'm in heading on the right direction ?
also, can i hide the mouse cursor in window mode ?
actually i've a finger, just like when you have a link in abrowser confused
© 2024 lite-C Forums