Files
MonoGame.Extended/Source/MonoGame.Extended.Input/KeyboardExtended.cs
T
2018-06-27 21:41:05 +10:00

18 lines
601 B
C#

using Microsoft.Xna.Framework.Input;
namespace MonoGame.Extended.Input
{
public static class KeyboardExtended
{
// TODO: This global static state was a horrible idea.
private static KeyboardState _currentKeyboardState;
private static KeyboardState _previousKeyboardState;
public static KeyboardStateExtended GetState()
{
_previousKeyboardState = _currentKeyboardState;
_currentKeyboardState = Keyboard.GetState();
return new KeyboardStateExtended(_currentKeyboardState, _previousKeyboardState);
}
}
}