|
How do I cage the mouse within a window?
#270561
06/08/09 18:06
06/08/09 18:06
|
Joined: Aug 2005
Posts: 119 Madison, WI
JakeL
OP
Member
|
OP
Member
Joined: Aug 2005
Posts: 119
Madison, WI
|
Is there an easy way to keep the mouse curser inside the engine window while in windowed mode? I'm sure this has been done before because it seems like something that people would need.
Is there a .dll out there or some API function that makes this easy? Something I missed in the manual?
Sorry if this is out there already. I spent a couple hours looking. Maybe I just don't know the correct terminology.
If you need graphic resources, or just want to see some of my work, check out our site AdenFall Software.
|
|
|
Re: How do I cage the mouse within a window?
[Re: JakeL]
#270567
06/08/09 18:25
06/08/09 18:25
|
Joined: Oct 2007
Posts: 5,211 İstanbul, Turkey
Quad
Senior Expert
|
Senior Expert
Joined: Oct 2007
Posts: 5,211
İstanbul, Turkey
|
you can do it without need of a dll,
include windows.h and use
SetCursorPos(x,y); more info: http://msdn.microsoft.com/en-us/library/ms648394(VS.85).aspx
clamp x and y variables, and set mouse pos according to this variables in a loop.
3333333333
|
|
|
Re: How do I cage the mouse within a window?
[Re: Quad]
#270569
06/08/09 18:32
06/08/09 18:32
|
Joined: Aug 2005
Posts: 119 Madison, WI
JakeL
OP
Member
|
OP
Member
Joined: Aug 2005
Posts: 119
Madison, WI
|
Thanks Quadraxas! That is exactly what I needed.
If you need graphic resources, or just want to see some of my work, check out our site AdenFall Software.
|
|
|
|