MOIS In buffered mode problem!!

Marioko

11-04-2007 23:30:49

Hi people.. first of all i want to say that MOGRE is the best=Ogre Power + C# Power.

I using in MOIS in buffered mode, if i hold press a key then keyPressed event is trigger, but i only get one event, and i need get events until the key is released. For example:



public bool keyPressed(KeyEvent e){
if(e.key == KeyCode.KC_W){
Console.WriteLine("W is pressed");
}
}


The "W is pressed" message should be printed many times until key W is released. But is printed one time.

How can i fix this?

Thankss 8)

bleubleu

11-04-2007 23:36:01

You could simply call the IsKeyDown() method on each frame instead of using the events. That should work.

Mat

grizzley90

11-04-2007 23:43:16

Use MOIS in unbuffered mode, unless you really need some key presses to be buffered.

Example:
mInputKeyboard = (MOIS.Keyboard)mInputManager.CreateInputObject(MOIS.Type.OISKeyboard, BufferedInput); Where BufferedInput is a boolean containing your choice of true or false.

Marioko

11-04-2007 23:55:35

Ok, thanksss

pjcast

12-04-2007 03:50:40

Also note, even if you are in buffered mode, you can query the state of the keys at any time.