add new Inputsystem for Test
add MouseTest
This commit is contained in:
parent
9907d2c740
commit
3bcbe67d9c
@ -72,6 +72,7 @@
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Strukturen\Input\KeyboardStateTest.cs" />
|
||||
<Compile Include="Strukturen\Input\MouseStateTest.cs" />
|
||||
<Compile Include="Strukturen\Input\MouseTest.cs" />
|
||||
<Compile Include="Strukturen\Storage\StorageContainerTest.cs" />
|
||||
<Compile Include="Strukturen\Storage\StorageDeviceTest.cs" />
|
||||
<Compile Include="Strukturen\BoundingBoxTest.cs" />
|
||||
|
@ -55,6 +55,12 @@ using NUnit.Framework;
|
||||
#endregion // License
|
||||
|
||||
#region Datatype Usings
|
||||
using XNAMouseState = Microsoft.Xna.Framework.Input.MouseState;
|
||||
using ANXMouseState = ANX.Framework.Input.MouseState;
|
||||
|
||||
using XNAPoint = Microsoft.Xna.Framework.Point;
|
||||
using ANXPoint = ANX.Framework.Point;
|
||||
|
||||
using XNAColor = Microsoft.Xna.Framework.Color;
|
||||
using ANXColor = ANX.Framework.Color;
|
||||
|
||||
@ -965,8 +971,29 @@ namespace ANX.Framework.TestCenter
|
||||
}
|
||||
Assert.Pass(test + " passed");
|
||||
}
|
||||
|
||||
public static void ConvertEquals(XNAPoint xna, ANXPoint anx, String test)
|
||||
{
|
||||
if (xna.X == anx.X &&
|
||||
xna.Y == anx.Y)
|
||||
Assert.Pass(String.Format("{0} passed", test));
|
||||
else
|
||||
Assert.Fail(String.Format("{0} failed: xna({1}) anx({2})", test, xna.ToString(), anx.ToString()));
|
||||
}
|
||||
public static void ConvertEquals(ANXMouseState referenz, ANXMouseState toTest, String test)
|
||||
{
|
||||
if ((referenz.X == toTest.X) && (referenz.Y == toTest.Y) && (referenz.ScrollWheelValue == toTest.ScrollWheelValue) && (referenz.LeftButton == toTest.LeftButton) && (referenz.MiddleButton == toTest.MiddleButton) && (referenz.RightButton == toTest.RightButton) && (referenz.XButton1 == toTest.XButton1) && (referenz.XButton2 == toTest.XButton2))
|
||||
{
|
||||
Assert.Pass(String.Format("{0} passed", test));
|
||||
}
|
||||
else {
|
||||
Assert.Fail(String.Format("{0} failed: xna({1}) anx({2})", test, referenz.ToString(), toTest.ToString()));
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
91
ANX.Framework.TestCenter/Strukturen/Input/MouseTest.cs
Normal file
91
ANX.Framework.TestCenter/Strukturen/Input/MouseTest.cs
Normal file
@ -0,0 +1,91 @@
|
||||
#region Using Statements
|
||||
using System;
|
||||
using System.IO;
|
||||
using ANX.Framework.NonXNA;
|
||||
using NUnit.Framework;
|
||||
#endregion // Using Statements
|
||||
|
||||
using XNAButtonState = Microsoft.Xna.Framework.Input.ButtonState;
|
||||
using ANXButtonState = ANX.Framework.Input.ButtonState;
|
||||
|
||||
using XNAMouseState = Microsoft.Xna.Framework.Input.MouseState;
|
||||
using ANXMouseState = ANX.Framework.Input.MouseState;
|
||||
|
||||
using ANXMouse = ANX.Framework.Input.Mouse;
|
||||
|
||||
|
||||
|
||||
#region License
|
||||
|
||||
//
|
||||
// This file is part of the ANX.Framework created by the "ANX.Framework developer group".
|
||||
//
|
||||
// This file is released under the Ms-PL license.
|
||||
//
|
||||
//
|
||||
//
|
||||
// Microsoft Public License (Ms-PL)
|
||||
//
|
||||
// This license governs use of the accompanying software. If you use the software, you accept this license.
|
||||
// If you do not accept the license, do not use the software.
|
||||
//
|
||||
// 1.Definitions
|
||||
// The terms "reproduce," "reproduction," "derivative works," and "distribution" have the same meaning
|
||||
// here as under U.S. copyright law.
|
||||
// A "contribution" is the original software, or any additions or changes to the software.
|
||||
// A "contributor" is any person that distributes its contribution under this license.
|
||||
// "Licensed patents" are a contributor's patent claims that read directly on its contribution.
|
||||
//
|
||||
// 2.Grant of Rights
|
||||
// (A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations
|
||||
// in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to
|
||||
// reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution
|
||||
// or any derivative works that you create.
|
||||
// (B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in
|
||||
// section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed
|
||||
// patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution
|
||||
// in the software or derivative works of the contribution in the software.
|
||||
//
|
||||
// 3.Conditions and Limitations
|
||||
// (A) No Trademark License- This license does not grant you rights to use any contributors' name, logo, or trademarks.
|
||||
// (B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your
|
||||
// patent license from such contributor to the software ends automatically.
|
||||
// (C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution
|
||||
// notices that are present in the software.
|
||||
// (D) If you distribute any portion of the software in source code form, you may do so only under this license by including
|
||||
// a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or
|
||||
// object code form, you may only do so under a license that complies with this license.
|
||||
// (E) The software is licensed "as-is." You bear the risk of using it. The contributors give no express warranties, guarantees,
|
||||
// or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the
|
||||
// extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a
|
||||
// particular purpose and non-infringement.
|
||||
|
||||
#endregion // License
|
||||
namespace ANX.Framework.TestCenter.Strukturen.Input
|
||||
{
|
||||
[TestFixture]
|
||||
class MouseTest
|
||||
{
|
||||
static object[] twoInt =
|
||||
{
|
||||
new int[]{DataFactory.RandomBitPlus,DataFactory.RandomBitPlus},
|
||||
new int[]{0,0}
|
||||
};
|
||||
|
||||
[TestFixtureSetUp]
|
||||
public void Setup()
|
||||
{
|
||||
AddInSystemFactory.Instance.Initialize();
|
||||
AddInSystemFactory.Instance.PreferredInputSystem = "Test";
|
||||
|
||||
}
|
||||
|
||||
[TestCaseSource("twoInt")]
|
||||
public void GetState(int x, int y)
|
||||
{
|
||||
ANXMouse.SetPosition(x, y);
|
||||
AssertHelper.ConvertEquals(new ANXMouseState(x, y, 0, ANXButtonState.Released, ANXButtonState.Released, ANXButtonState.Released, ANXButtonState.Released, ANXButtonState.Released), ANXMouse.GetState(), "GetState");
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@ -80,14 +80,7 @@ namespace ANX.Framework.TestCenter.Strukturen
|
||||
};
|
||||
|
||||
|
||||
public void ConvertEquals(XNAPoint xna, ANXPoint anx, String test)
|
||||
{
|
||||
if (xna.X == anx.X &&
|
||||
xna.Y == anx.Y)
|
||||
Assert.Pass(String.Format("{0} passed", test));
|
||||
else
|
||||
Assert.Fail(String.Format("{0} failed: xna({1}) anx({2})", test, xna.ToString(), anx.ToString()));
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
@ -98,7 +91,7 @@ namespace ANX.Framework.TestCenter.Strukturen
|
||||
|
||||
ANXPoint anx = new ANXPoint();
|
||||
|
||||
ConvertEquals(xna, anx, "constructor0");
|
||||
AssertHelper.ConvertEquals(xna, anx, "constructor0");
|
||||
}
|
||||
|
||||
[Test, TestCaseSource("twoint")]
|
||||
@ -108,7 +101,7 @@ namespace ANX.Framework.TestCenter.Strukturen
|
||||
|
||||
ANXPoint anx = new ANXPoint(x, y);
|
||||
|
||||
ConvertEquals(xna, anx, "constructor1");
|
||||
AssertHelper.ConvertEquals(xna, anx, "constructor1");
|
||||
}
|
||||
#endregion
|
||||
|
||||
@ -144,6 +137,68 @@ namespace ANX.Framework.TestCenter.Strukturen
|
||||
else
|
||||
Assert.Fail(String.Format("Y failed: xna({0}) anx({1})", xna.ToString(), anx.ToString()));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Zero()
|
||||
{
|
||||
AssertHelper.ConvertEquals(XNAPoint.Zero, ANXPoint.Zero, "Zero");
|
||||
}
|
||||
|
||||
[TestCaseSource("twoint")]
|
||||
public void OpEqual(int x, int y)
|
||||
{
|
||||
XNAPoint xna = new XNAPoint(x, y);
|
||||
ANXPoint anx = new ANXPoint(x, y);
|
||||
XNAPoint xna2 = new XNAPoint(x, y);
|
||||
ANXPoint anx2 = new ANXPoint(x, y);
|
||||
|
||||
AssertHelper.ConvertEquals(xna == xna2, anx == anx2, "OpEqual");
|
||||
}
|
||||
|
||||
[TestCaseSource("twoint")]
|
||||
public void OpUnEqual(int x, int y)
|
||||
{
|
||||
XNAPoint xna = new XNAPoint(x, y);
|
||||
ANXPoint anx = new ANXPoint(x, y);
|
||||
XNAPoint xna2 = new XNAPoint(x, y);
|
||||
ANXPoint anx2 = new ANXPoint(x, y);
|
||||
|
||||
AssertHelper.ConvertEquals(xna != xna2, anx != anx2, "OpUnEqual");
|
||||
}
|
||||
[TestCaseSource("twoint")]
|
||||
public void Equals(int x, int y)
|
||||
{
|
||||
XNAPoint xna = new XNAPoint(x, y);
|
||||
ANXPoint anx = new ANXPoint(x, y);
|
||||
XNAPoint xna2 = new XNAPoint(x, y);
|
||||
ANXPoint anx2 = new ANXPoint(x, y);
|
||||
|
||||
AssertHelper.ConvertEquals(xna.Equals(xna2), anx.Equals(anx2), "Equals");
|
||||
}
|
||||
[TestCaseSource("twoint")]
|
||||
public void Equals2(int x, int y)
|
||||
{
|
||||
XNAPoint xna = new XNAPoint(x, y);
|
||||
ANXPoint anx = new ANXPoint(x, y);
|
||||
|
||||
AssertHelper.ConvertEquals(xna.Equals(null), anx.Equals(null), "Equals2");
|
||||
}
|
||||
[TestCaseSource("twoint")]
|
||||
public void ToString(int x, int y)
|
||||
{
|
||||
XNAPoint xna = new XNAPoint(x, y);
|
||||
ANXPoint anx = new ANXPoint(x, y);
|
||||
|
||||
AssertHelper.ConvertEquals(xna.ToString(), anx.ToString(), "ToString");
|
||||
}
|
||||
[TestCaseSource("twoint")]
|
||||
public void GetHashCode(int x, int y)
|
||||
{
|
||||
XNAPoint xna = new XNAPoint(x, y);
|
||||
ANXPoint anx = new ANXPoint(x, y);
|
||||
|
||||
AssertHelper.ConvertEquals(xna.GetHashCode(), anx.GetHashCode(), "GetHashCode");
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
@ -130,6 +130,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ANX.InputDevices.OpenTK", "
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ANX.InputDevices.Windows.Kinect", "InputSystems\ANX.InputDevices.Windows.Kinect\ANX.InputDevices.Windows.Kinect.csproj", "{E5D69E75-D77C-493F-BBDA-6F9E73B82549}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ANX.InputDevices.Test", "InputSystems\ANX.InputDevices.Test\ANX.InputDevices.Test.csproj", "{5040A9C7-6DEC-4613-8586-A598C4070B35}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SubversionScc) = preSolution
|
||||
Svn-Managed = True
|
||||
@ -432,6 +434,16 @@ Global
|
||||
{E5D69E75-D77C-493F-BBDA-6F9E73B82549}.Release|Mixed Platforms.Build.0 = Release|x86
|
||||
{E5D69E75-D77C-493F-BBDA-6F9E73B82549}.Release|x86.ActiveCfg = Release|x86
|
||||
{E5D69E75-D77C-493F-BBDA-6F9E73B82549}.Release|x86.Build.0 = Release|x86
|
||||
{5040A9C7-6DEC-4613-8586-A598C4070B35}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{5040A9C7-6DEC-4613-8586-A598C4070B35}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{5040A9C7-6DEC-4613-8586-A598C4070B35}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
||||
{5040A9C7-6DEC-4613-8586-A598C4070B35}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
|
||||
{5040A9C7-6DEC-4613-8586-A598C4070B35}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{5040A9C7-6DEC-4613-8586-A598C4070B35}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{5040A9C7-6DEC-4613-8586-A598C4070B35}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{5040A9C7-6DEC-4613-8586-A598C4070B35}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||
{5040A9C7-6DEC-4613-8586-A598C4070B35}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
||||
{5040A9C7-6DEC-4613-8586-A598C4070B35}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
@ -461,6 +473,7 @@ Global
|
||||
{60D08399-244F-46A3-91F1-4CFD26D961A3} = {7AD65E6B-2A48-437F-81D9-4CA9C9A85C64}
|
||||
{5CA3CDF5-4D2C-42AC-AD08-641BD3992B75} = {7AD65E6B-2A48-437F-81D9-4CA9C9A85C64}
|
||||
{E5D69E75-D77C-493F-BBDA-6F9E73B82549} = {7AD65E6B-2A48-437F-81D9-4CA9C9A85C64}
|
||||
{5040A9C7-6DEC-4613-8586-A598C4070B35} = {7AD65E6B-2A48-437F-81D9-4CA9C9A85C64}
|
||||
{6A582788-C4D2-410C-96CD-177F75712D65} = {5725DA44-4F5C-4E93-A957-AC5C85603EE9}
|
||||
{14EF49AB-6D3F-458D-9D5C-D120B86EDD7A} = {5725DA44-4F5C-4E93-A957-AC5C85603EE9}
|
||||
{CCB4679D-11AF-4EC6-AAA4-36619FCE70FA} = {60824BDB-AC8A-42ED-9B79-111FB44669FF}
|
||||
|
@ -0,0 +1,80 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>8.0.30703</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{5040A9C7-6DEC-4613-8586-A598C4070B35}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>ANX.InputDevices.Test</RootNamespace>
|
||||
<AssemblyName>ANX.InputDevices.Test</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>..\..\bin\Debug\</OutputPath>
|
||||
<DefineConstants>TRACE;DEBUG;XNAEXT</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="NLog">
|
||||
<HintPath>..\..\lib\NLog\NLog.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Creator.cs" />
|
||||
<Compile Include="GamePad.cs" />
|
||||
<Compile Include="GamePadCreator.cs" />
|
||||
<Compile Include="Keyboard.cs" />
|
||||
<Compile Include="KeyboardCreator.cs" />
|
||||
<Compile Include="Metadata.Designer.cs">
|
||||
<DependentUpon>Metadata.resx</DependentUpon>
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
</Compile>
|
||||
<Compile Include="Mouse.cs" />
|
||||
<Compile Include="MouseCreator.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\ANX.Framework\ANX.Framework.csproj">
|
||||
<Project>{6899F0C9-70B9-4EB0-9DD3-E598D4BE3E35}</Project>
|
||||
<Name>ANX.Framework</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Metadata.resx">
|
||||
<Generator>PublicResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Metadata.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
131
InputSystems/ANX.InputDevices.Test/Creator.cs
Normal file
131
InputSystems/ANX.InputDevices.Test/Creator.cs
Normal file
@ -0,0 +1,131 @@
|
||||
#region Using Statements
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using ANX.Framework.NonXNA;
|
||||
|
||||
#endregion
|
||||
|
||||
#region License
|
||||
|
||||
//
|
||||
// This file is part of the ANX.Framework created by the "ANX.Framework developer group".
|
||||
//
|
||||
// This file is released under the Ms-PL license.
|
||||
//
|
||||
//
|
||||
//
|
||||
// Microsoft Public License (Ms-PL)
|
||||
//
|
||||
// This license governs use of the accompanying software. If you use the software, you accept this license.
|
||||
// If you do not accept the license, do not use the software.
|
||||
//
|
||||
// 1.Definitions
|
||||
// The terms "reproduce," "reproduction," "derivative works," and "distribution" have the same meaning
|
||||
// here as under U.S. copyright law.
|
||||
// A "contribution" is the original software, or any additions or changes to the software.
|
||||
// A "contributor" is any person that distributes its contribution under this license.
|
||||
// "Licensed patents" are a contributor's patent claims that read directly on its contribution.
|
||||
//
|
||||
// 2.Grant of Rights
|
||||
// (A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations
|
||||
// in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to
|
||||
// reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution
|
||||
// or any derivative works that you create.
|
||||
// (B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in
|
||||
// section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed
|
||||
// patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution
|
||||
// in the software or derivative works of the contribution in the software.
|
||||
//
|
||||
// 3.Conditions and Limitations
|
||||
// (A) No Trademark License- This license does not grant you rights to use any contributors' name, logo, or trademarks.
|
||||
// (B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your
|
||||
// patent license from such contributor to the software ends automatically.
|
||||
// (C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution
|
||||
// notices that are present in the software.
|
||||
// (D) If you distribute any portion of the software in source code form, you may do so only under this license by including
|
||||
// a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or
|
||||
// object code form, you may only do so under a license that complies with this license.
|
||||
// (E) The software is licensed "as-is." You bear the risk of using it. The contributors give no express warranties, guarantees,
|
||||
// or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the
|
||||
// extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a
|
||||
// particular purpose and non-infringement.
|
||||
|
||||
#endregion // License
|
||||
|
||||
namespace ANX.InputDevices.Test
|
||||
{
|
||||
public class Creator:IInputSystemCreator
|
||||
{
|
||||
private Mouse _mouse;
|
||||
private Keyboard _keyboard;
|
||||
private GamePad _gamePad;
|
||||
|
||||
|
||||
|
||||
public IGamePad GamePad
|
||||
{
|
||||
get
|
||||
{
|
||||
AddInSystemFactory.Instance.PreventInputSystemChange();
|
||||
if (_gamePad == null)
|
||||
{
|
||||
_gamePad = new GamePad();
|
||||
}
|
||||
return _gamePad;
|
||||
}
|
||||
}
|
||||
|
||||
public IMouse Mouse
|
||||
{
|
||||
get
|
||||
{
|
||||
AddInSystemFactory.Instance.PreventInputSystemChange();
|
||||
if (_mouse == null)
|
||||
{
|
||||
_mouse = new Mouse();
|
||||
}
|
||||
return _mouse;
|
||||
}
|
||||
}
|
||||
|
||||
public IKeyboard Keyboard
|
||||
{
|
||||
get
|
||||
{
|
||||
AddInSystemFactory.Instance.PreventInputSystemChange();
|
||||
if (_keyboard == null)
|
||||
{
|
||||
_keyboard = new Keyboard();
|
||||
}
|
||||
return _keyboard;
|
||||
}
|
||||
}
|
||||
|
||||
public IMotionSensingDevice MotionSensingDevice
|
||||
{
|
||||
get { throw new NotImplementedException(); }
|
||||
}
|
||||
|
||||
public void RegisterCreator(AddInSystemFactory factory)
|
||||
{
|
||||
factory.AddCreator(this);
|
||||
}
|
||||
|
||||
public string Name
|
||||
{
|
||||
get { return "Test"; }
|
||||
}
|
||||
|
||||
public int Priority
|
||||
{
|
||||
get { return int.MaxValue; }
|
||||
}
|
||||
|
||||
public bool IsSupported
|
||||
{
|
||||
get { return true; } //This is just for test, so it runs on all plattforms
|
||||
}
|
||||
}
|
||||
}
|
84
InputSystems/ANX.InputDevices.Test/GamePad.cs
Normal file
84
InputSystems/ANX.InputDevices.Test/GamePad.cs
Normal file
@ -0,0 +1,84 @@
|
||||
#region Using Statements
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using ANX.Framework.NonXNA;
|
||||
using NLog;
|
||||
using ANX.Framework.NonXNA.InputSystem;
|
||||
|
||||
#endregion // Using Statements
|
||||
|
||||
#region License
|
||||
|
||||
//
|
||||
// This file is part of the ANX.Framework created by the "ANX.Framework developer group".
|
||||
//
|
||||
// This file is released under the Ms-PL license.
|
||||
//
|
||||
//
|
||||
//
|
||||
// Microsoft Public License (Ms-PL)
|
||||
//
|
||||
// This license governs use of the accompanying software. If you use the software, you accept this license.
|
||||
// If you do not accept the license, do not use the software.
|
||||
//
|
||||
// 1.Definitions
|
||||
// The terms "reproduce," "reproduction," "derivative works," and "distribution" have the same meaning
|
||||
// here as under U.S. copyright law.
|
||||
// A "contribution" is the original software, or any additions or changes to the software.
|
||||
// A "contributor" is any person that distributes its contribution under this license.
|
||||
// "Licensed patents" are a contributor's patent claims that read directly on its contribution.
|
||||
//
|
||||
// 2.Grant of Rights
|
||||
// (A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations
|
||||
// in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to
|
||||
// reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution
|
||||
// or any derivative works that you create.
|
||||
// (B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in
|
||||
// section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed
|
||||
// patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution
|
||||
// in the software or derivative works of the contribution in the software.
|
||||
//
|
||||
// 3.Conditions and Limitations
|
||||
// (A) No Trademark License- This license does not grant you rights to use any contributors' name, logo, or trademarks.
|
||||
// (B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your
|
||||
// patent license from such contributor to the software ends automatically.
|
||||
// (C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution
|
||||
// notices that are present in the software.
|
||||
// (D) If you distribute any portion of the software in source code form, you may do so only under this license by including
|
||||
// a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or
|
||||
// object code form, you may only do so under a license that complies with this license.
|
||||
// (E) The software is licensed "as-is." You bear the risk of using it. The contributors give no express warranties, guarantees,
|
||||
// or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the
|
||||
// extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a
|
||||
// particular purpose and non-infringement.
|
||||
|
||||
#endregion // License
|
||||
namespace ANX.InputDevices.Test
|
||||
{
|
||||
public class GamePad:IGamePad
|
||||
{
|
||||
public Framework.Input.GamePadCapabilities GetCapabilities(Framework.PlayerIndex playerIndex)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public Framework.Input.GamePadState GetState(Framework.PlayerIndex playerIndex, out bool isConnected, out int packetNumber)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public Framework.Input.GamePadState GetState(Framework.PlayerIndex playerIndex, Framework.Input.GamePadDeadZone deadZoneMode, out bool isConnected, out int packetNumber)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public bool SetVibration(Framework.PlayerIndex playerIndex, float leftMotor, float rightMotor)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
85
InputSystems/ANX.InputDevices.Test/GamePadCreator.cs
Normal file
85
InputSystems/ANX.InputDevices.Test/GamePadCreator.cs
Normal file
@ -0,0 +1,85 @@
|
||||
#region Using Statements
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using ANX.Framework.NonXNA;
|
||||
using NLog;
|
||||
using ANX.Framework.NonXNA.InputSystem;
|
||||
|
||||
#endregion // Using Statements
|
||||
|
||||
#region License
|
||||
|
||||
//
|
||||
// This file is part of the ANX.Framework created by the "ANX.Framework developer group".
|
||||
//
|
||||
// This file is released under the Ms-PL license.
|
||||
//
|
||||
//
|
||||
//
|
||||
// Microsoft Public License (Ms-PL)
|
||||
//
|
||||
// This license governs use of the accompanying software. If you use the software, you accept this license.
|
||||
// If you do not accept the license, do not use the software.
|
||||
//
|
||||
// 1.Definitions
|
||||
// The terms "reproduce," "reproduction," "derivative works," and "distribution" have the same meaning
|
||||
// here as under U.S. copyright law.
|
||||
// A "contribution" is the original software, or any additions or changes to the software.
|
||||
// A "contributor" is any person that distributes its contribution under this license.
|
||||
// "Licensed patents" are a contributor's patent claims that read directly on its contribution.
|
||||
//
|
||||
// 2.Grant of Rights
|
||||
// (A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations
|
||||
// in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to
|
||||
// reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution
|
||||
// or any derivative works that you create.
|
||||
// (B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in
|
||||
// section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed
|
||||
// patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution
|
||||
// in the software or derivative works of the contribution in the software.
|
||||
//
|
||||
// 3.Conditions and Limitations
|
||||
// (A) No Trademark License- This license does not grant you rights to use any contributors' name, logo, or trademarks.
|
||||
// (B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your
|
||||
// patent license from such contributor to the software ends automatically.
|
||||
// (C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution
|
||||
// notices that are present in the software.
|
||||
// (D) If you distribute any portion of the software in source code form, you may do so only under this license by including
|
||||
// a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or
|
||||
// object code form, you may only do so under a license that complies with this license.
|
||||
// (E) The software is licensed "as-is." You bear the risk of using it. The contributors give no express warranties, guarantees,
|
||||
// or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the
|
||||
// extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a
|
||||
// particular purpose and non-infringement.
|
||||
|
||||
#endregion // License
|
||||
|
||||
namespace ANX.InputDevices.Test
|
||||
{
|
||||
public class GamePadCreator:IGamePadCreator
|
||||
{
|
||||
public IGamePad CreateGamePadInstance()
|
||||
{
|
||||
return new GamePad();
|
||||
}
|
||||
|
||||
public string Name
|
||||
{
|
||||
get { return "Test.GamePad"; }
|
||||
}
|
||||
|
||||
public void RegisterCreator(InputDeviceFactory factory)
|
||||
{
|
||||
factory.AddCreator(this);
|
||||
}
|
||||
|
||||
public int Priority
|
||||
{
|
||||
get { return 99; }
|
||||
}
|
||||
}
|
||||
}
|
92
InputSystems/ANX.InputDevices.Test/Keyboard.cs
Normal file
92
InputSystems/ANX.InputDevices.Test/Keyboard.cs
Normal file
@ -0,0 +1,92 @@
|
||||
#region Using Statements
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using ANX.Framework.NonXNA;
|
||||
using NLog;
|
||||
using ANX.Framework.NonXNA.InputSystem;
|
||||
|
||||
#endregion // Using Statements
|
||||
|
||||
#region License
|
||||
|
||||
//
|
||||
// This file is part of the ANX.Framework created by the "ANX.Framework developer group".
|
||||
//
|
||||
// This file is released under the Ms-PL license.
|
||||
//
|
||||
//
|
||||
//
|
||||
// Microsoft Public License (Ms-PL)
|
||||
//
|
||||
// This license governs use of the accompanying software. If you use the software, you accept this license.
|
||||
// If you do not accept the license, do not use the software.
|
||||
//
|
||||
// 1.Definitions
|
||||
// The terms "reproduce," "reproduction," "derivative works," and "distribution" have the same meaning
|
||||
// here as under U.S. copyright law.
|
||||
// A "contribution" is the original software, or any additions or changes to the software.
|
||||
// A "contributor" is any person that distributes its contribution under this license.
|
||||
// "Licensed patents" are a contributor's patent claims that read directly on its contribution.
|
||||
//
|
||||
// 2.Grant of Rights
|
||||
// (A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations
|
||||
// in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to
|
||||
// reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution
|
||||
// or any derivative works that you create.
|
||||
// (B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in
|
||||
// section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed
|
||||
// patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution
|
||||
// in the software or derivative works of the contribution in the software.
|
||||
//
|
||||
// 3.Conditions and Limitations
|
||||
// (A) No Trademark License- This license does not grant you rights to use any contributors' name, logo, or trademarks.
|
||||
// (B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your
|
||||
// patent license from such contributor to the software ends automatically.
|
||||
// (C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution
|
||||
// notices that are present in the software.
|
||||
// (D) If you distribute any portion of the software in source code form, you may do so only under this license by including
|
||||
// a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or
|
||||
// object code form, you may only do so under a license that complies with this license.
|
||||
// (E) The software is licensed "as-is." You bear the risk of using it. The contributors give no express warranties, guarantees,
|
||||
// or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the
|
||||
// extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a
|
||||
// particular purpose and non-infringement.
|
||||
|
||||
#endregion // License
|
||||
|
||||
namespace ANX.InputDevices.Test
|
||||
{
|
||||
public class Keyboard:IKeyboard
|
||||
{
|
||||
public IntPtr WindowHandle
|
||||
{
|
||||
get
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
set
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
|
||||
public Framework.Input.KeyboardState GetState()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public Framework.Input.KeyboardState GetState(Framework.PlayerIndex playerIndex)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
85
InputSystems/ANX.InputDevices.Test/KeyboardCreator.cs
Normal file
85
InputSystems/ANX.InputDevices.Test/KeyboardCreator.cs
Normal file
@ -0,0 +1,85 @@
|
||||
#region Using Statements
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using ANX.Framework.NonXNA;
|
||||
using NLog;
|
||||
using ANX.Framework.NonXNA.InputSystem;
|
||||
|
||||
#endregion // Using Statements
|
||||
|
||||
#region License
|
||||
|
||||
//
|
||||
// This file is part of the ANX.Framework created by the "ANX.Framework developer group".
|
||||
//
|
||||
// This file is released under the Ms-PL license.
|
||||
//
|
||||
//
|
||||
//
|
||||
// Microsoft Public License (Ms-PL)
|
||||
//
|
||||
// This license governs use of the accompanying software. If you use the software, you accept this license.
|
||||
// If you do not accept the license, do not use the software.
|
||||
//
|
||||
// 1.Definitions
|
||||
// The terms "reproduce," "reproduction," "derivative works," and "distribution" have the same meaning
|
||||
// here as under U.S. copyright law.
|
||||
// A "contribution" is the original software, or any additions or changes to the software.
|
||||
// A "contributor" is any person that distributes its contribution under this license.
|
||||
// "Licensed patents" are a contributor's patent claims that read directly on its contribution.
|
||||
//
|
||||
// 2.Grant of Rights
|
||||
// (A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations
|
||||
// in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to
|
||||
// reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution
|
||||
// or any derivative works that you create.
|
||||
// (B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in
|
||||
// section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed
|
||||
// patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution
|
||||
// in the software or derivative works of the contribution in the software.
|
||||
//
|
||||
// 3.Conditions and Limitations
|
||||
// (A) No Trademark License- This license does not grant you rights to use any contributors' name, logo, or trademarks.
|
||||
// (B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your
|
||||
// patent license from such contributor to the software ends automatically.
|
||||
// (C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution
|
||||
// notices that are present in the software.
|
||||
// (D) If you distribute any portion of the software in source code form, you may do so only under this license by including
|
||||
// a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or
|
||||
// object code form, you may only do so under a license that complies with this license.
|
||||
// (E) The software is licensed "as-is." You bear the risk of using it. The contributors give no express warranties, guarantees,
|
||||
// or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the
|
||||
// extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a
|
||||
// particular purpose and non-infringement.
|
||||
|
||||
#endregion // License
|
||||
|
||||
namespace ANX.InputDevices.Test
|
||||
{
|
||||
public class KeyboardCreator:IKeyboardCreator
|
||||
{
|
||||
public IKeyboard CreateKeyboardInstance()
|
||||
{
|
||||
return new Keyboard();
|
||||
}
|
||||
|
||||
public string Name
|
||||
{
|
||||
get { return "Test.Keyboard"; }
|
||||
}
|
||||
|
||||
public void RegisterCreator(InputDeviceFactory factory)
|
||||
{
|
||||
factory.AddCreator(this);
|
||||
}
|
||||
|
||||
public int Priority
|
||||
{
|
||||
get { return 99; }
|
||||
}
|
||||
}
|
||||
}
|
72
InputSystems/ANX.InputDevices.Test/Metadata.Designer.cs
generated
Normal file
72
InputSystems/ANX.InputDevices.Test/Metadata.Designer.cs
generated
Normal file
@ -0,0 +1,72 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.239
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace ANX.InputDevices.Test {
|
||||
using System;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||
/// </summary>
|
||||
// This class was auto-generated by the StronglyTypedResourceBuilder
|
||||
// class via a tool like ResGen or Visual Studio.
|
||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
// with the /str option, or rebuild your VS project.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
public class Metadata {
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal Metadata() {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the cached ResourceManager instance used by this class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
public static global::System.Resources.ResourceManager ResourceManager {
|
||||
get {
|
||||
if (object.ReferenceEquals(resourceMan, null)) {
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ANX.InputDevices.Test.Metadata", typeof(Metadata).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Overrides the current thread's CurrentUICulture property for all
|
||||
/// resource lookups using this strongly typed resource class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
public static global::System.Globalization.CultureInfo Culture {
|
||||
get {
|
||||
return resourceCulture;
|
||||
}
|
||||
set {
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Win32NT.
|
||||
/// </summary>
|
||||
public static string SupportedPlatforms {
|
||||
get {
|
||||
return ResourceManager.GetString("SupportedPlatforms", resourceCulture);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
124
InputSystems/ANX.InputDevices.Test/Metadata.resx
Normal file
124
InputSystems/ANX.InputDevices.Test/Metadata.resx
Normal file
@ -0,0 +1,124 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="SupportedPlatforms" xml:space="preserve">
|
||||
<value>Win32NT</value>
|
||||
<comment>test only</comment>
|
||||
</data>
|
||||
</root>
|
96
InputSystems/ANX.InputDevices.Test/Mouse.cs
Normal file
96
InputSystems/ANX.InputDevices.Test/Mouse.cs
Normal file
@ -0,0 +1,96 @@
|
||||
#region Using Statements
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using ANX.Framework.NonXNA;
|
||||
using NLog;
|
||||
using ANX.Framework.NonXNA.InputSystem;
|
||||
using ANX.Framework.Input;
|
||||
|
||||
#endregion // Using Statements
|
||||
|
||||
#region License
|
||||
|
||||
//
|
||||
// This file is part of the ANX.Framework created by the "ANX.Framework developer group".
|
||||
//
|
||||
// This file is released under the Ms-PL license.
|
||||
//
|
||||
//
|
||||
//
|
||||
// Microsoft Public License (Ms-PL)
|
||||
//
|
||||
// This license governs use of the accompanying software. If you use the software, you accept this license.
|
||||
// If you do not accept the license, do not use the software.
|
||||
//
|
||||
// 1.Definitions
|
||||
// The terms "reproduce," "reproduction," "derivative works," and "distribution" have the same meaning
|
||||
// here as under U.S. copyright law.
|
||||
// A "contribution" is the original software, or any additions or changes to the software.
|
||||
// A "contributor" is any person that distributes its contribution under this license.
|
||||
// "Licensed patents" are a contributor's patent claims that read directly on its contribution.
|
||||
//
|
||||
// 2.Grant of Rights
|
||||
// (A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations
|
||||
// in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to
|
||||
// reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution
|
||||
// or any derivative works that you create.
|
||||
// (B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in
|
||||
// section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed
|
||||
// patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution
|
||||
// in the software or derivative works of the contribution in the software.
|
||||
//
|
||||
// 3.Conditions and Limitations
|
||||
// (A) No Trademark License- This license does not grant you rights to use any contributors' name, logo, or trademarks.
|
||||
// (B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your
|
||||
// patent license from such contributor to the software ends automatically.
|
||||
// (C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution
|
||||
// notices that are present in the software.
|
||||
// (D) If you distribute any portion of the software in source code form, you may do so only under this license by including
|
||||
// a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or
|
||||
// object code form, you may only do so under a license that complies with this license.
|
||||
// (E) The software is licensed "as-is." You bear the risk of using it. The contributors give no express warranties, guarantees,
|
||||
// or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the
|
||||
// extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a
|
||||
// particular purpose and non-infringement.
|
||||
|
||||
#endregion // License
|
||||
namespace ANX.InputDevices.Test
|
||||
{
|
||||
public class Mouse:IMouse
|
||||
{
|
||||
int _x;
|
||||
int _y;
|
||||
IntPtr _windowHandle;
|
||||
|
||||
|
||||
public IntPtr WindowHandle
|
||||
{
|
||||
|
||||
get
|
||||
{
|
||||
return _windowHandle;
|
||||
}
|
||||
set
|
||||
{
|
||||
this._windowHandle = value;
|
||||
}
|
||||
}
|
||||
|
||||
public MouseState GetState()
|
||||
{
|
||||
return new MouseState(this._x, this._y, 0, ButtonState.Released, ButtonState.Released, ButtonState.Released, ButtonState.Released, ButtonState.Released);
|
||||
}
|
||||
|
||||
public void SetPosition(int x, int y)
|
||||
{
|
||||
this._x = x;
|
||||
this._y = y;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
85
InputSystems/ANX.InputDevices.Test/MouseCreator.cs
Normal file
85
InputSystems/ANX.InputDevices.Test/MouseCreator.cs
Normal file
@ -0,0 +1,85 @@
|
||||
#region Using Statements
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using ANX.Framework.NonXNA;
|
||||
using NLog;
|
||||
using ANX.Framework.NonXNA.InputSystem;
|
||||
|
||||
#endregion // Using Statements
|
||||
|
||||
#region License
|
||||
|
||||
//
|
||||
// This file is part of the ANX.Framework created by the "ANX.Framework developer group".
|
||||
//
|
||||
// This file is released under the Ms-PL license.
|
||||
//
|
||||
//
|
||||
//
|
||||
// Microsoft Public License (Ms-PL)
|
||||
//
|
||||
// This license governs use of the accompanying software. If you use the software, you accept this license.
|
||||
// If you do not accept the license, do not use the software.
|
||||
//
|
||||
// 1.Definitions
|
||||
// The terms "reproduce," "reproduction," "derivative works," and "distribution" have the same meaning
|
||||
// here as under U.S. copyright law.
|
||||
// A "contribution" is the original software, or any additions or changes to the software.
|
||||
// A "contributor" is any person that distributes its contribution under this license.
|
||||
// "Licensed patents" are a contributor's patent claims that read directly on its contribution.
|
||||
//
|
||||
// 2.Grant of Rights
|
||||
// (A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations
|
||||
// in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to
|
||||
// reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution
|
||||
// or any derivative works that you create.
|
||||
// (B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in
|
||||
// section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed
|
||||
// patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution
|
||||
// in the software or derivative works of the contribution in the software.
|
||||
//
|
||||
// 3.Conditions and Limitations
|
||||
// (A) No Trademark License- This license does not grant you rights to use any contributors' name, logo, or trademarks.
|
||||
// (B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your
|
||||
// patent license from such contributor to the software ends automatically.
|
||||
// (C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution
|
||||
// notices that are present in the software.
|
||||
// (D) If you distribute any portion of the software in source code form, you may do so only under this license by including
|
||||
// a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or
|
||||
// object code form, you may only do so under a license that complies with this license.
|
||||
// (E) The software is licensed "as-is." You bear the risk of using it. The contributors give no express warranties, guarantees,
|
||||
// or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the
|
||||
// extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a
|
||||
// particular purpose and non-infringement.
|
||||
|
||||
#endregion // License
|
||||
|
||||
namespace ANX.InputDevices.Test
|
||||
{
|
||||
public class MouseCreator:IMouseCreator
|
||||
{
|
||||
public IMouse CreateMouseInstance()
|
||||
{
|
||||
return new Mouse();
|
||||
}
|
||||
|
||||
public string Name
|
||||
{
|
||||
get { return "Test.Mouse"; }
|
||||
}
|
||||
|
||||
public void RegisterCreator(InputDeviceFactory factory)
|
||||
{
|
||||
factory.AddCreator(this);
|
||||
}
|
||||
|
||||
public int Priority
|
||||
{
|
||||
get { return 99; }
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("ANX.InputDevices.Test")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("ANX.InputDevices.Test")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2012")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("84ed4be2-5305-45ba-9718-935d66bc74ef")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
Loading…
x
Reference in New Issue
Block a user