problems with injectMousePosition and MQuickGUI


04-03-2008 05:20:08

I have installed the version of Mogre 1.4.6 and i use this code for mouse handling (from the wiki of MQuickGUI example):

MOIS.MouseState_NativePtr mouseState = inputMouse.MouseState;
MQuickGUI.GUIManager.Singleton.injectMousePosition(mouseState.X.abs, mouseState.Y.abs); // Mouse cursor movement.

the problem is that the mouseState.X.abs and mouseState.Y.abs only gives me "50" units as maximum, and the mouse does not move more than 50 units.
how I can do so that the mouse moves more along the X and Y axis?

thanks in advance.


05-03-2008 07:23:20

You must add the next code when you initialize Mois:

MOIS.MouseState_NativePtr state = mouseMoisDevice.MouseState;
state.width = (int)window.Width;
state.height = (int)window.Height;

The default width and height of MOIS is 50 and you must resize it manually.


10-03-2008 15:14:34

thanks Sickes