mirror of
https://github.com/AlexMacocian/MonoGame.Extended.git
synced 2026-07-22 18:29:30 +00:00
22 lines
659 B
C#
22 lines
659 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()
|
|
{
|
|
return new KeyboardStateExtended(_currentKeyboardState, _previousKeyboardState);
|
|
}
|
|
|
|
public static void Refresh()
|
|
{
|
|
_previousKeyboardState = _currentKeyboardState;
|
|
_currentKeyboardState = Keyboard.GetState();
|
|
}
|
|
}
|
|
} |