Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (7th_zorro), 1,390 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 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 | chip programmers | 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