Why wont the cursor leave the screen?

Advanced game related topics
..::Origin::..
Enthusiast
Enthusiast
Posts: 125
Joined: Sat Jun 17, 2006 3:15 pm

Why wont the cursor leave the screen?

Post 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?
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

See ReleaseMouse()
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8452
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Post 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.
BERESHEIT
..::Origin::..
Enthusiast
Enthusiast
Posts: 125
Joined: Sat Jun 17, 2006 3:15 pm

Post 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?
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

..::Origin::.. wrote:Alright, but ReleaseMouse() pretty much freezes the game itself...
Hmm, try to not call ExamineMouse() while RelaseMouse() is called.
Post Reply