49 lines
1.2 KiB
C#
Raw Normal View History

#region Using Statements
2011-11-04 23:51:05 +00:00
using System;
2011-11-14 16:19:58 +00:00
using ANX.Framework.NonXNA;
2011-11-04 23:51:05 +00:00
#endregion // Using Statements
// This file is part of the ANX.Framework created by the
// "ANX.Framework developer group" and released under the Ms-PL license.
// For details see: http://anxframework.codeplex.com/license
2011-11-04 23:06:39 +00:00
namespace ANX.Framework.Input
{
public static class Keyboard
{
2011-11-14 16:19:58 +00:00
private static IKeyboard keyboard;
static Keyboard()
{
keyboard = AddInSystemFactory.Instance.GetDefaultCreator<IInputSystemCreator>().Keyboard;
}
internal static IntPtr WindowHandle
{
get
{
return keyboard != null ? keyboard.WindowHandle : IntPtr.Zero;
}
set
{
if (keyboard != null)
{
keyboard.WindowHandle = value;
}
}
}
2011-11-04 23:06:39 +00:00
public static KeyboardState GetState()
2011-11-14 16:19:58 +00:00
{
return keyboard.GetState();
2011-11-04 23:06:39 +00:00
}
2011-11-04 23:06:39 +00:00
public static KeyboardState GetState (PlayerIndex playerIndex)
{
2011-11-14 16:19:58 +00:00
return keyboard.GetState(playerIndex);
2011-11-04 23:06:39 +00:00
}
}
}