Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
2 registered members (AndrewAMD, TipmyPip), 13,557 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Capture mouse in window mode ? #268922
05/31/09 19:14
05/31/09 19:14
Joined: Feb 2008
Posts: 36
Pesaro, Italy, Europe
MaximilianPs Offline OP
Newbie
MaximilianPs  Offline OP
Newbie

Joined: Feb 2008
Posts: 36
Pesaro, Italy, Europe
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

Re: Capture mouse in window mode ? [Re: MaximilianPs] #268924
05/31/09 19:53
05/31/09 19:53
Joined: Aug 2007
Posts: 1,922
Schweiz
Widi Offline
Serious User
Widi  Offline
Serious User

Joined: Aug 2007
Posts: 1,922
Schweiz
#include <windows.h>
and then you can set the Window Mouse Position with
SetCursorPos (x,y);

Re: Capture mouse in window mode ? [Re: Widi] #268985
06/01/09 08:35
06/01/09 08:35
Joined: Feb 2008
Posts: 36
Pesaro, Italy, Europe
MaximilianPs Offline OP
Newbie
MaximilianPs  Offline OP
Newbie

Joined: Feb 2008
Posts: 36
Pesaro, Italy, Europe
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

Last edited by MaximilianPs; 06/01/09 08:38. Reason: syntax correction ^^

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1