[solved] MOIS doesn't trigger events


04-04-2007 14:33:37


I'm trying to use MOIS to handle the input, but when I run the Application and press any keys, nothing happens.
However, when I use Capture() and IsKeyDown(...), it works fine.

Here is my code:
// Create input manager
MOIS.ParamList pl = new MOIS.ParamList();
IntPtr windowHnd;
mWindow.GetCustomAttribute("WINDOW", out windowHnd);
pl.Insert("WINDOW", windowHnd.ToString());

mInputManager = MOIS.InputManager.CreateInputSystem(pl);

mKeyBoard = (MOIS.Keyboard)mInputManager.CreateInputObject(MOIS.Type.OISKeyboard, true);
mMouse = (MOIS.Mouse)mInputManager.CreateInputObject(MOIS.Type.OISMouse, true);

// Register input listeners
mKeyBoard.KeyPressed += new KeyListener.KeyPressedHandler(KeyPressed);
mKeyBoard.KeyReleased += new KeyListener.KeyReleasedHandler(KeyReleased);
mMouse.MouseMoved += new MouseListener.MouseMovedHandler(MouseMoved);


04-04-2007 17:38:54

Ok, I have forgot to call Capture().

It works now