InputReader.KeyDown don't work

LuRenJia

06-11-2006 09:28:17

Hi, I have some code as following:

public override void CreateInput()
{
base.CreateInput();
input.KeyDown += new Axiom.KeyboardEventHandler(input_KeyDown);
}

public void input_KeyDown(object sender, Axiom.KeyEventArgs e)
{
if (e.Key == KeyCodes.C)
{
ChangeViewpoint();
}
}


But "input_KeyDown" never be handled, what's wrong about this? :?

Thanks in advance.

Bekas

06-11-2006 11:00:42

Use
public override void CreateInput()
{
base.CreateInput();
input.UseKeyboardEvents = true;
input.KeyDown += new Axiom.KeyboardEventHandler(input_KeyDown);
}

LuRenJia

06-11-2006 14:43:59

Thank you very much! I love Mogre!