Commit Description:
Start decoupling input....
Commit Description:
Start decoupling input. (grafted from c917ecbef5cd2ff3893c85b443a84b706f293554)
Show/Diff file:
Action:
isometric-park-fna/Engines/InputEngine.cs
38 lines | 713 B | text/x-csharp | CSharpLexer
using Microsoft.Xna.Framework.Input;
using Encompass;
using isometricparkfna.Messages;
namespace isometricparkfna.Engines {
[Sends(typeof(ToggleDebugWindowMessage))]
public class InputEngine : Engine
{
private KeyboardState keyboardPrev;
public InputEngine() {
//initialize to blank for now
this.keyboardPrev = new KeyboardState();
}
public override void Update(double dt) {
var keyboardCur = Keyboard.GetState();
if (keyboardCur.IsKeyDown(Keys.OemBackslash) && keyboardPrev.IsKeyUp(Keys.OemBackslash))
{
// this.show_another_window = !this.show_another_window;
//
SendMessage(new ToggleDebugWindowMessage());
}
this.keyboardPrev = keyboardCur;
}
}
}