Mouse motion question

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
kendric
Posts: 71
Joined: Tue May 29, 2007 9:05 pm

Mouse motion question

Post by kendric »

Learning this engine, its really cool. I have a question on mouse movement.
if(event.MouseInput.Event==EMIE_MOUSE_MOVED)
{
printf("Mouse is now at x=%d",event.MouseInput.X);
}

This gives me the position. But if I want to get motion, ie to control the camera myself, is there a function for that? Or is it my job to recenter the mouse after each event and just track the delta from the center? If so whats the recomended way to move the mouse.

Thanks in advance for any input.
Dances
Posts: 454
Joined: Sat Jul 02, 2005 1:45 am
Location: Canada
Contact:

Post by Dances »

Yes, you would need to reset it to center each time you use the value.
Mastiff
Posts: 17
Joined: Thu Apr 19, 2007 9:55 pm

Post by Mastiff »

To change the cursor position:

device->getCursorControl()->setPosition(int x,int y);

There are also more options listed in the Irrlicht API:
http://irrlicht.sourceforge.net/docu/cl ... ntrol.html
#include <"signature.h">

OS = Windows XP
IDE = Code::Blocks
Compiler = GCC MingW
Post Reply