2011-11-04 23:51:05 +00:00
|
|
|
using System;
|
|
|
|
using ANX.Framework.NonXNA;
|
2012-09-01 16:20:44 +00:00
|
|
|
using ANX.Framework.NonXNA.Development;
|
2011-11-04 23:51:05 +00:00
|
|
|
|
2012-08-09 09:45:04 +00:00
|
|
|
// 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
|
|
|
|
{
|
2012-09-01 16:20:44 +00:00
|
|
|
[PercentageComplete(100)]
|
|
|
|
[TestState(TestStateAttribute.TestState.Tested)]
|
2011-11-04 23:06:39 +00:00
|
|
|
public static class Mouse
|
|
|
|
{
|
2012-09-01 16:20:44 +00:00
|
|
|
private static IMouse mouse;
|
|
|
|
|
|
|
|
public static IntPtr WindowHandle
|
|
|
|
{
|
|
|
|
get
|
|
|
|
{
|
|
|
|
return mouse != null ? mouse.WindowHandle : IntPtr.Zero;
|
|
|
|
}
|
|
|
|
set
|
|
|
|
{
|
|
|
|
if (mouse != null)
|
|
|
|
mouse.WindowHandle = value;
|
|
|
|
}
|
|
|
|
}
|
2011-11-04 23:51:05 +00:00
|
|
|
|
|
|
|
static Mouse()
|
|
|
|
{
|
2011-11-11 15:21:41 +00:00
|
|
|
mouse = AddInSystemFactory.Instance.GetDefaultCreator<IInputSystemCreator>().Mouse;
|
2011-11-04 23:51:05 +00:00
|
|
|
}
|
|
|
|
|
2011-11-04 23:06:39 +00:00
|
|
|
public static MouseState GetState()
|
|
|
|
{
|
2012-09-01 16:20:44 +00:00
|
|
|
return (mouse != null) ? mouse.GetState() : new MouseState();
|
2011-11-04 23:06:39 +00:00
|
|
|
}
|
2011-11-09 12:31:32 +00:00
|
|
|
|
2011-11-04 23:06:39 +00:00
|
|
|
public static void SetPosition(int x, int y)
|
|
|
|
{
|
2011-11-09 12:31:32 +00:00
|
|
|
if (mouse != null)
|
|
|
|
mouse.SetPosition(x, y);
|
2011-11-04 23:06:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|