Gamestudio Links
Zorro Links
Newest Posts
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 02/19/26 13:22
Camera always moves upwards?
by VoroneTZ. 02/19/26 13:13
Hedge on FXCM, 4 or 5?
by Martin_HH. 02/16/26 16:09
Zorro version 3.0 prerelease!
by jcl. 02/12/26 14:05
MarginCost discrepancy?
by jcl. 02/12/26 14:02
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
6 registered members (VoroneTZ, alx, titanicpiano14, paulk, Dirk4Vantas, 1 invisible), 7,446 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
alx, ApprenticeInMuc, PatrickH90, USER0328, Sfrdragon
19199 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