lancore89
04-04-2007 14:33:37
Hi,
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:
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);