Center the mouse?

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Irrlicht_Rocks
Posts: 25
Joined: Sun Aug 14, 2005 4:35 am

Center the mouse?

Post by Irrlicht_Rocks »

How can I keep the mouse inside of the window that will work with even non-Irrlicht apps?
I'm using Visual C++ 6.0.
Thanks.
Conquistador
Posts: 340
Joined: Wed Sep 28, 2005 4:38 pm
Location: Canada, Eh!

re:

Post by Conquistador »

Check out the cursor control functions.
Irrlicht_Rocks
Posts: 25
Joined: Sun Aug 14, 2005 4:35 am

Center the mouse?

Post by Irrlicht_Rocks »

That won't work with NON-IRRLICHT apps as well will it?
(I assume you are talking about the "cursor control functions" for Irrlicht)
afecelis
Admin
Posts: 3075
Joined: Sun Feb 22, 2004 10:44 pm
Location: Colombia
Contact:

Post by afecelis »

Please watch the double posting. I just deleted a thread you started as guest with the exact same topic.
Irrlicht_Rocks
Posts: 25
Joined: Sun Aug 14, 2005 4:35 am

Post by Irrlicht_Rocks »

Sorry there about the double post.
I usually have auto-login checked but I must have erased my cookies.
I went to press the "Post Reply" button but I have bad aim today. :oops:
I missed and hit the "New Thread" button without even noticing it until after I had looked back at this topic not seeing my reply but a duplicate topic(which was supposed to be my reply in this thread) posted by "guest". :?
Conquistador
Posts: 340
Joined: Wed Sep 28, 2005 4:38 pm
Location: Canada, Eh!

re:

Post by Conquistador »

I'm not too big on windows programming, but there is a way to center the mouse, if you check the source for the cursor control functions in Irrlicht, then you'll see how Niko did it, or you can just google for a tutorial.
Twinsen
Posts: 27
Joined: Thu Nov 03, 2005 2:05 pm
Location: Gold Coast

Post by Twinsen »

A nice simple sulution to your problem, is to say if the mouse is at a certai npoint then change its position to the center of the screen based on your resulution.
"Sorry, Twinsen, you don't have enough Kashes. "- Yeah right pal
Conquistador
Posts: 340
Joined: Wed Sep 28, 2005 4:38 pm
Location: Canada, Eh!

Post by Conquistador »

Twinsen wrote:A nice simple sulution to your problem, is to say if the mouse is at a certai npoint then change its position to the center of the screen based on your resulution.
Yes, but HOW to do that is the problem.
Delan
Posts: 24
Joined: Sun Nov 06, 2005 10:46 am
Location: Polend
Contact:

Post by Delan »

that functions might help you:

SetCursorPos(x,y);
mouse_event(MOUSEEVENTF_LEFTDOWN,0 ,0,0,0);
mouse_event(MOUSEEVENTF_LEFTUP,0 ,0,0,0);

the dimmensions what u need u can get in win api function like

Code: Select all

hwnd = CreateWindow("ClassNam",			//  Name of registered class
                       "Tytul okna", 	//  Window title
                       WS_OVERLAPPEDWINDOW, 		//  Styless
                       CW_USEDEFAULT, 			//  X coordinate
                       0, 				//  Y coordinate
                       CW_USEDEFAULT, 			//  Width
                       0, 				//  Height
                       NULL, 				//  Window parent handle
                       NULL, 				//  Handle to a menu
                       hInstance, 			//  hInstance handle
                       NULL);
Check also On Resize Event in win message control...
And time has come now to ride
before the end of the night
the march of the swordmaster
to the unholy fight
Guest

Post by Guest »

where do I have to use the cursor control in case I just wanted to use irrlicht. when I center the mouse in the event case-if my application freezes...
Post Reply