- Removed InputSystemCreators from ANX.InputDevices.OpenTK and ANX.InputDevices.Windows.Kinect as they don't host InputSystems anymore.
- Improved handling of GameWindow handle (needed for mouse and keyboard support) - Improved exception handling while creating mouse and keyboard instances from InputDevice AddIns. - Fixed some sample issues (and opened issues at codeplex for some remaining issues)
This commit is contained in:
parent
9ff4fcc9b1
commit
1a03ea2ad2
@ -430,6 +430,7 @@
|
||||
<Compile Include="NonXNA\InputSystem\IKeyboardCreator.cs" />
|
||||
<Compile Include="NonXNA\InputSystem\IMouseCreator.cs" />
|
||||
<Compile Include="NonXNA\InputSystem\IMotionSensingDeviceCreator.cs" />
|
||||
<Compile Include="NonXNA\NoInputDeviceException.cs" />
|
||||
<Compile Include="NonXNA\RenderSystem\EffectProcessorOutputFormat.cs" />
|
||||
<Compile Include="NonXNA\ICreator.cs" />
|
||||
<Compile Include="NonXNA\InputSystem\IGamePad.cs" />
|
||||
|
@ -73,6 +73,8 @@ namespace ANX.Framework.NonXNA
|
||||
private Dictionary<string, IMotionSensingDeviceCreator> motionSensingDeviceCreators;
|
||||
#endif
|
||||
|
||||
private IntPtr windowHandle;
|
||||
|
||||
private static Logger logger = LogManager.GetCurrentClassLogger();
|
||||
|
||||
#endregion // Private Members
|
||||
@ -178,9 +180,17 @@ namespace ANX.Framework.NonXNA
|
||||
{
|
||||
//TODO: this is a very basic implementation only which needs some more work
|
||||
|
||||
if (this.WindowHandle == null ||
|
||||
this.WindowHandle == IntPtr.Zero)
|
||||
{
|
||||
throw new Exception("Unable to create a mouse instance because the WindowHandle was not set.");
|
||||
}
|
||||
|
||||
if (this.mouseCreators.Count > 0)
|
||||
{
|
||||
return this.mouseCreators.Values.First<IMouseCreator>().CreateMouseInstance();
|
||||
IMouse mouse = this.mouseCreators.Values.First<IMouseCreator>().CreateMouseInstance();
|
||||
mouse.WindowHandle = this.windowHandle;
|
||||
return mouse;
|
||||
}
|
||||
|
||||
throw new Exception("Unable to create instance of Mouse because no MouseCreator was registered.");
|
||||
@ -190,9 +200,17 @@ namespace ANX.Framework.NonXNA
|
||||
{
|
||||
//TODO: this is a very basic implementation only which needs some more work
|
||||
|
||||
if (this.WindowHandle == null ||
|
||||
this.WindowHandle == IntPtr.Zero)
|
||||
{
|
||||
throw new Exception("Unable to create a keyboard instance because the WindowHandle was not set.");
|
||||
}
|
||||
|
||||
if (this.keyboardCreators.Count > 0)
|
||||
{
|
||||
return this.keyboardCreators.Values.First<IKeyboardCreator>().CreateKeyboardInstance();
|
||||
IKeyboard keyboard = this.keyboardCreators.Values.First<IKeyboardCreator>().CreateKeyboardInstance();
|
||||
keyboard.WindowHandle = this.windowHandle;
|
||||
return keyboard;
|
||||
}
|
||||
|
||||
throw new Exception("Unable to create instance of Keyboard because no KeyboardCreator was registered.");
|
||||
@ -212,5 +230,16 @@ namespace ANX.Framework.NonXNA
|
||||
}
|
||||
#endif
|
||||
|
||||
public IntPtr WindowHandle
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.windowHandle;
|
||||
}
|
||||
internal set
|
||||
{
|
||||
this.windowHandle = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
78
ANX.Framework/NonXNA/NoInputDeviceException.cs
Normal file
78
ANX.Framework/NonXNA/NoInputDeviceException.cs
Normal file
@ -0,0 +1,78 @@
|
||||
#region Using Statements
|
||||
using System;
|
||||
using System.Runtime.Serialization;
|
||||
#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.Framework.NonXNA
|
||||
{
|
||||
public class NoInputDeviceException : Exception
|
||||
{
|
||||
public NoInputDeviceException()
|
||||
: base()
|
||||
{
|
||||
}
|
||||
|
||||
protected NoInputDeviceException(SerializationInfo info, StreamingContext context)
|
||||
: base(info, context)
|
||||
{
|
||||
}
|
||||
|
||||
public NoInputDeviceException(string message)
|
||||
: base(message)
|
||||
{
|
||||
}
|
||||
|
||||
public NoInputDeviceException(string message, Exception innerException)
|
||||
: base(message, innerException)
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -48,15 +48,17 @@
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
</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>
|
||||
|
@ -7,6 +7,7 @@ using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using ANX.Framework.NonXNA;
|
||||
using NLog;
|
||||
using ANX.Framework.NonXNA.InputSystem;
|
||||
|
||||
#endregion // Using Statements
|
||||
|
||||
@ -59,75 +60,29 @@ using NLog;
|
||||
|
||||
namespace ANX.InputDevices.OpenTK
|
||||
{
|
||||
public class Creator : IInputSystemCreator
|
||||
public class GamePadCreator : IGamePadCreator
|
||||
{
|
||||
private static Logger logger = LogManager.GetCurrentClassLogger();
|
||||
|
||||
public string Name
|
||||
{
|
||||
get
|
||||
{
|
||||
return "OpenTK";
|
||||
return "OpenTK.GamePad";
|
||||
}
|
||||
}
|
||||
|
||||
public void RegisterCreator(InputDeviceFactory factory)
|
||||
{
|
||||
factory.AddCreator(this);
|
||||
}
|
||||
|
||||
public int Priority
|
||||
{
|
||||
get { return 100; }
|
||||
}
|
||||
|
||||
public bool IsSupported
|
||||
public IGamePad CreateGamePadInstance()
|
||||
{
|
||||
get
|
||||
{
|
||||
//TODO: this is just a very basic version of test for support
|
||||
return AddInSystemFactory.Instance.OperatingSystem.Platform == PlatformID.Win32NT ||
|
||||
AddInSystemFactory.Instance.OperatingSystem.Platform == PlatformID.Unix ||
|
||||
AddInSystemFactory.Instance.OperatingSystem.Platform == PlatformID.MacOSX;
|
||||
}
|
||||
return new GamePad();
|
||||
}
|
||||
|
||||
public void RegisterCreator(AddInSystemFactory factory)
|
||||
{
|
||||
logger.Debug("adding OpenTK InputSystem creator to creator collection of AddInSystemFactory");
|
||||
factory.AddCreator(this);
|
||||
}
|
||||
|
||||
public IGamePad GamePad
|
||||
{
|
||||
get
|
||||
{
|
||||
logger.Debug("returning a new OpenTK GamePad device");
|
||||
AddInSystemFactory.Instance.PreventInputSystemChange();
|
||||
return new GamePad();
|
||||
}
|
||||
}
|
||||
|
||||
public IMouse Mouse
|
||||
{
|
||||
get
|
||||
{
|
||||
logger.Debug("returning a new OpenTK Mouse device");
|
||||
AddInSystemFactory.Instance.PreventInputSystemChange();
|
||||
return new Mouse();
|
||||
}
|
||||
}
|
||||
|
||||
public IKeyboard Keyboard
|
||||
{
|
||||
get
|
||||
{
|
||||
logger.Debug("returning a new OpenTK Keyboard device");
|
||||
AddInSystemFactory.Instance.PreventInputSystemChange();
|
||||
return new Keyboard();
|
||||
}
|
||||
}
|
||||
|
||||
#if XNAEXT
|
||||
public IMotionSensingDevice MotionSensingDevice
|
||||
{
|
||||
get { return null; }
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
88
InputSystems/ANX.InputDevices.OpenTK/KeyboardCreator.cs
Normal file
88
InputSystems/ANX.InputDevices.OpenTK/KeyboardCreator.cs
Normal file
@ -0,0 +1,88 @@
|
||||
#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.OpenTK
|
||||
{
|
||||
public class KeyboardCreator : IKeyboardCreator
|
||||
{
|
||||
public string Name
|
||||
{
|
||||
get
|
||||
{
|
||||
return "OpenTK.Keyboard";
|
||||
}
|
||||
}
|
||||
|
||||
public void RegisterCreator(InputDeviceFactory factory)
|
||||
{
|
||||
factory.AddCreator(this);
|
||||
}
|
||||
|
||||
public int Priority
|
||||
{
|
||||
get { return 100; }
|
||||
}
|
||||
|
||||
public IKeyboard CreateKeyboardInstance()
|
||||
{
|
||||
return new Keyboard();
|
||||
}
|
||||
}
|
||||
}
|
88
InputSystems/ANX.InputDevices.OpenTK/MouseCreator.cs
Normal file
88
InputSystems/ANX.InputDevices.OpenTK/MouseCreator.cs
Normal file
@ -0,0 +1,88 @@
|
||||
#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.OpenTK
|
||||
{
|
||||
public class MouseCreator : IMouseCreator
|
||||
{
|
||||
public string Name
|
||||
{
|
||||
get
|
||||
{
|
||||
return "OpenTK.Mouse";
|
||||
}
|
||||
}
|
||||
|
||||
public void RegisterCreator(InputDeviceFactory factory)
|
||||
{
|
||||
factory.AddCreator(this);
|
||||
}
|
||||
|
||||
public int Priority
|
||||
{
|
||||
get { return 100; }
|
||||
}
|
||||
|
||||
public IMouse CreateMouseInstance()
|
||||
{
|
||||
return new Mouse();
|
||||
}
|
||||
}
|
||||
}
|
@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
||||
// Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern
|
||||
// übernehmen, indem Sie "*" eingeben:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("0.0.2.0")]
|
||||
[assembly: AssemblyFileVersion("0.0.2.0")]
|
||||
[assembly: AssemblyVersion("0.0.3.0")]
|
||||
[assembly: AssemblyFileVersion("0.0.3.0")]
|
||||
|
@ -41,6 +41,14 @@
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\lib\KinectSDK\Microsoft.Research.Kinect.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="NLog, Version=2.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\lib\NLog\NLog.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="NLog.Extended, Version=2.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\lib\NLog\NLog.Extended.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
@ -53,13 +61,13 @@
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Creator.cs" />
|
||||
<Compile Include="Kinect.cs" />
|
||||
<Compile Include="Metadata.Designer.cs">
|
||||
<DependentUpon>Metadata.resx</DependentUpon>
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
</Compile>
|
||||
<Compile Include="MotionSensingDeviceCreator.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<EmbeddedResource Include="Metadata.resx">
|
||||
<Generator>PublicResXFileCodeGenerator</Generator>
|
||||
|
@ -1,7 +1,13 @@
|
||||
#region Using Statements
|
||||
using System;
|
||||
using ANX.Framework.Input;
|
||||
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
|
||||
|
||||
@ -52,62 +58,34 @@ using ANX.Framework.NonXNA;
|
||||
|
||||
#endregion // License
|
||||
|
||||
|
||||
namespace ANX.InputDevices.Windows.Kinect
|
||||
{
|
||||
public class Creator : IInputSystemCreator
|
||||
public class MotionSensingDeviceCreator : IMotionSensingDeviceCreator
|
||||
{
|
||||
public string Name
|
||||
{
|
||||
get { return "Kinect"; }
|
||||
}
|
||||
|
||||
public int Priority
|
||||
{
|
||||
get { return int.MaxValue; }
|
||||
}
|
||||
|
||||
public bool IsSupported
|
||||
{
|
||||
get
|
||||
{
|
||||
//TODO: this is just a very basic version of test for support
|
||||
return AddInSystemFactory.Instance.OperatingSystem.Platform == PlatformID.Win32NT;
|
||||
get
|
||||
{
|
||||
return "Kinect";
|
||||
}
|
||||
}
|
||||
|
||||
public void RegisterCreator(AddInSystemFactory factory)
|
||||
public void RegisterCreator(InputDeviceFactory factory)
|
||||
{
|
||||
factory.AddCreator(this);
|
||||
}
|
||||
|
||||
#region IInputSystemCreator Member
|
||||
|
||||
public IGamePad GamePad
|
||||
{
|
||||
get { throw new NotImplementedException(); }
|
||||
}
|
||||
|
||||
public IMouse Mouse
|
||||
{
|
||||
get { return null; }
|
||||
}
|
||||
|
||||
public IMotionSensingDevice MotionSensingDevice
|
||||
public int Priority
|
||||
{
|
||||
get
|
||||
{
|
||||
AddInSystemFactory.Instance.PreventInputSystemChange();
|
||||
return new Kinect();
|
||||
{
|
||||
return 10000;
|
||||
}
|
||||
}
|
||||
|
||||
public IKeyboard Keyboard
|
||||
public IMotionSensingDevice CreateMotionSensingDeviceInstance()
|
||||
{
|
||||
get { throw new NotImplementedException(); }
|
||||
return new Kinect();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
||||
// Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern
|
||||
// übernehmen, indem Sie "*" eingeben:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("0.5.4.0")]
|
||||
[assembly: AssemblyFileVersion("0.5.4.0")]
|
||||
[assembly: AssemblyVersion("0.5.5.0")]
|
||||
[assembly: AssemblyFileVersion("0.5.5.0")]
|
||||
|
@ -63,6 +63,9 @@ namespace ANX.InputDevices.Windows.XInput
|
||||
{
|
||||
private static Logger logger = LogManager.GetCurrentClassLogger();
|
||||
|
||||
private IKeyboard keyboard;
|
||||
private IMouse mouse;
|
||||
|
||||
public string Name
|
||||
{
|
||||
get
|
||||
@ -104,9 +107,18 @@ namespace ANX.InputDevices.Windows.XInput
|
||||
{
|
||||
get
|
||||
{
|
||||
logger.Debug("returning a new Mouse device");
|
||||
AddInSystemFactory.Instance.PreventInputSystemChange();
|
||||
return InputDeviceFactory.Instance.GetDefaultMouse();
|
||||
if (this.mouse == null)
|
||||
{
|
||||
this.mouse = InputDeviceFactory.Instance.GetDefaultMouse();
|
||||
if (this.mouse == null)
|
||||
{
|
||||
throw new NoInputDeviceException("couldn't find a default mouse device creator. Unable to create a mouse instance.");
|
||||
}
|
||||
logger.Debug("created a new Mouse device");
|
||||
AddInSystemFactory.Instance.PreventInputSystemChange();
|
||||
}
|
||||
|
||||
return this.mouse;
|
||||
}
|
||||
}
|
||||
|
||||
@ -114,9 +126,18 @@ namespace ANX.InputDevices.Windows.XInput
|
||||
{
|
||||
get
|
||||
{
|
||||
logger.Debug("returning a new Keyboard device");
|
||||
AddInSystemFactory.Instance.PreventInputSystemChange();
|
||||
return InputDeviceFactory.Instance.GetDefaultKeyboard();
|
||||
if (this.keyboard == null)
|
||||
{
|
||||
this.keyboard = InputDeviceFactory.Instance.GetDefaultKeyboard();
|
||||
if (this.keyboard == null)
|
||||
{
|
||||
throw new NoInputDeviceException("couldn't find a default keyboard device creator. Unable to create a keyboard instance.");
|
||||
}
|
||||
logger.Debug("created a new Keyboard device");
|
||||
AddInSystemFactory.Instance.PreventInputSystemChange();
|
||||
}
|
||||
|
||||
return this.keyboard;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -32,7 +32,7 @@ using System.Runtime.InteropServices;
|
||||
// Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern
|
||||
// übernehmen, indem Sie "*" eingeben:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("0.7.11.0")]
|
||||
[assembly: AssemblyFileVersion("0.7.11.0")]
|
||||
[assembly: AssemblyVersion("0.7.12.0")]
|
||||
[assembly: AssemblyFileVersion("0.7.12.0")]
|
||||
|
||||
[assembly: InternalsVisibleTo("ANX.Framework.ContentPipeline")]
|
||||
|
@ -6,6 +6,7 @@ using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using ANX.Framework.Windows.DX10;
|
||||
using ANX.Framework.Input;
|
||||
using ANX.Framework.NonXNA;
|
||||
|
||||
#endregion // Using Statements
|
||||
|
||||
@ -70,8 +71,7 @@ namespace ANX.Framework
|
||||
this.game = game;
|
||||
//this.LockThreadToProcessor();
|
||||
this.gameWindow = new WindowsGameWindow();
|
||||
Mouse.WindowHandle = this.gameWindow.Handle; //TODO: find a way to initialize all InputSystems with one Handle
|
||||
Keyboard.WindowHandle = this.gameWindow.Handle;
|
||||
InputDeviceFactory.Instance.WindowHandle = this.gameWindow.Handle;
|
||||
//TouchPanel.WindowHandle = this.gameWindow.Handle;
|
||||
//this.gameWindow.IsMouseVisible = game.IsMouseVisible;
|
||||
this.gameWindow.Activated += new EventHandler<EventArgs>(this.GameWindowActivated);
|
||||
|
@ -32,7 +32,7 @@ using System.Runtime.InteropServices;
|
||||
// Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern
|
||||
// übernehmen, indem Sie "*" eingeben:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("0.5.9.0")]
|
||||
[assembly: AssemblyFileVersion("0.5.9.0")]
|
||||
[assembly: AssemblyVersion("0.5.10.0")]
|
||||
[assembly: AssemblyFileVersion("0.5.10.0")]
|
||||
|
||||
[assembly: InternalsVisibleTo("ANX.Framework.ContentPipeline")]
|
||||
|
@ -2,6 +2,7 @@
|
||||
using System.Windows.Forms;
|
||||
using NLog;
|
||||
using ANX.Framework.Input;
|
||||
using ANX.Framework.NonXNA;
|
||||
|
||||
|
||||
#region License
|
||||
@ -83,8 +84,7 @@ namespace ANX.Framework.Windows.GL3
|
||||
logger.Info("creating a new GameWindow");
|
||||
gameWindow = new WindowsGameWindow();
|
||||
|
||||
Mouse.WindowHandle = this.gameWindow.Handle; //TODO: find a way to initialize all InputSystems with one Handle
|
||||
Keyboard.WindowHandle = this.gameWindow.Handle;
|
||||
InputDeviceFactory.Instance.WindowHandle = this.gameWindow.Handle;
|
||||
|
||||
logger.Info("hook up GameWindow events");
|
||||
gameWindow.Activated += delegate
|
||||
|
@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
||||
// Buildnummer
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.7.3.0")]
|
||||
[assembly: AssemblyFileVersion("0.7.3.0")]
|
||||
[assembly: AssemblyVersion("0.7.4.0")]
|
||||
[assembly: AssemblyFileVersion("0.7.4.0")]
|
||||
|
@ -7,6 +7,7 @@ using System.Windows.Forms;
|
||||
using ANX.Framework.Windows.DX10;
|
||||
using ANX.Framework.Input;
|
||||
using ANX.Framework;
|
||||
using ANX.Framework.NonXNA;
|
||||
|
||||
#endregion // Using Statements
|
||||
|
||||
@ -71,8 +72,7 @@ namespace ANX.RenderSystem.Windows.DX11
|
||||
this.game = game;
|
||||
//this.LockThreadToProcessor();
|
||||
this.gameWindow = new WindowsGameWindow();
|
||||
Mouse.WindowHandle = this.gameWindow.Handle; //TODO: find a way to initialize all InputSystems with one Handle
|
||||
Keyboard.WindowHandle = this.gameWindow.Handle;
|
||||
InputDeviceFactory.Instance.WindowHandle = this.gameWindow.Handle;
|
||||
//TouchPanel.WindowHandle = this.gameWindow.Handle;
|
||||
//this.gameWindow.IsMouseVisible = game.IsMouseVisible;
|
||||
this.gameWindow.Activated += new EventHandler<EventArgs>(this.GameWindowActivated);
|
||||
|
@ -33,7 +33,6 @@ namespace KeyboardSample
|
||||
|
||||
protected override void Initialize()
|
||||
{
|
||||
//TODO: see CodePlex issue #454
|
||||
this.lastKeyState = Keyboard.GetState();
|
||||
|
||||
base.Initialize();
|
||||
|
@ -83,6 +83,14 @@
|
||||
<Project>{6899F0C9-70B9-4EB0-9DD3-E598D4BE3E35}</Project>
|
||||
<Name>ANX.Framework</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\InputSystems\ANX.InputDevices.Windows.XInput\ANX.InputDevices.Windows.XInput.csproj">
|
||||
<Project>{60D08399-244F-46A3-91F1-4CFD26D961A3}</Project>
|
||||
<Name>ANX.InputDevices.Windows.XInput</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\InputSystems\ANX.InputSystem.Standard\ANX.InputSystem.Standard.csproj">
|
||||
<Project>{49066074-3B7B-4A55-B122-6BD33AB73558}</Project>
|
||||
<Name>ANX.InputSystem.Standard</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\RenderSystems\ANX.Framework.Windows.DX10\ANX.Framework.Windows.DX10.csproj">
|
||||
<Project>{5BE49183-2F6F-4527-AC90-D816911FCF90}</Project>
|
||||
<Name>ANX.Framework.Windows.DX10</Name>
|
||||
|
@ -110,6 +110,14 @@
|
||||
<Project>{6899F0C9-70B9-4EB0-9DD3-E598D4BE3E35}</Project>
|
||||
<Name>ANX.Framework</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\InputSystems\ANX.InputDevices.Windows.Kinect\ANX.InputDevices.Windows.Kinect.csproj">
|
||||
<Project>{E5D69E75-D77C-493F-BBDA-6F9E73B82549}</Project>
|
||||
<Name>ANX.InputDevices.Windows.Kinect</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\InputSystems\ANX.InputSystem.Standard\ANX.InputSystem.Standard.csproj">
|
||||
<Project>{49066074-3B7B-4A55-B122-6BD33AB73558}</Project>
|
||||
<Name>ANX.InputSystem.Standard</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\RenderSystems\ANX.Framework.Windows.DX10\ANX.Framework.Windows.DX10.csproj">
|
||||
<Project>{5BE49183-2F6F-4527-AC90-D816911FCF90}</Project>
|
||||
<Name>ANX.Framework.Windows.DX10</Name>
|
||||
|
@ -11,8 +11,6 @@ namespace Kinect
|
||||
/// </summary>
|
||||
static void Main(string[] args)
|
||||
{
|
||||
AddInSystemFactory.Instance.PreferredInputSystem = "Kinect";
|
||||
|
||||
using (Game1 game = new Game1())
|
||||
{
|
||||
game.Run();
|
||||
|
@ -83,6 +83,14 @@
|
||||
<Project>{6899F0C9-70B9-4EB0-9DD3-E598D4BE3E35}</Project>
|
||||
<Name>ANX.Framework</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\InputSystems\ANX.InputDevices.Windows.XInput\ANX.InputDevices.Windows.XInput.csproj">
|
||||
<Project>{60D08399-244F-46A3-91F1-4CFD26D961A3}</Project>
|
||||
<Name>ANX.InputDevices.Windows.XInput</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\InputSystems\ANX.InputSystem.Standard\ANX.InputSystem.Standard.csproj">
|
||||
<Project>{49066074-3B7B-4A55-B122-6BD33AB73558}</Project>
|
||||
<Name>ANX.InputSystem.Standard</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\RenderSystems\ANX.Framework.Windows.DX10\ANX.Framework.Windows.DX10.csproj">
|
||||
<Project>{5BE49183-2F6F-4527-AC90-D816911FCF90}</Project>
|
||||
<Name>ANX.Framework.Windows.DX10</Name>
|
||||
|
@ -83,6 +83,14 @@
|
||||
<Project>{6899F0C9-70B9-4EB0-9DD3-E598D4BE3E35}</Project>
|
||||
<Name>ANX.Framework</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\InputSystems\ANX.InputDevices.Windows.XInput\ANX.InputDevices.Windows.XInput.csproj">
|
||||
<Project>{60D08399-244F-46A3-91F1-4CFD26D961A3}</Project>
|
||||
<Name>ANX.InputDevices.Windows.XInput</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\InputSystems\ANX.InputSystem.Standard\ANX.InputSystem.Standard.csproj">
|
||||
<Project>{49066074-3B7B-4A55-B122-6BD33AB73558}</Project>
|
||||
<Name>ANX.InputSystem.Standard</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\RenderSystems\ANX.Framework.Windows.DX10\ANX.Framework.Windows.DX10.csproj">
|
||||
<Project>{5BE49183-2F6F-4527-AC90-D816911FCF90}</Project>
|
||||
<Name>ANX.Framework.Windows.DX10</Name>
|
||||
|
@ -120,6 +120,14 @@
|
||||
<Project>{6899F0C9-70B9-4EB0-9DD3-E598D4BE3E35}</Project>
|
||||
<Name>ANX.Framework</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\InputSystems\ANX.InputDevices.Windows.XInput\ANX.InputDevices.Windows.XInput.csproj">
|
||||
<Project>{60D08399-244F-46A3-91F1-4CFD26D961A3}</Project>
|
||||
<Name>ANX.InputDevices.Windows.XInput</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\InputSystems\ANX.InputSystem.Standard\ANX.InputSystem.Standard.csproj">
|
||||
<Project>{49066074-3B7B-4A55-B122-6BD33AB73558}</Project>
|
||||
<Name>ANX.InputSystem.Standard</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\RenderSystems\ANX.Framework.Windows.DX10\ANX.Framework.Windows.DX10.csproj">
|
||||
<Project>{5BE49183-2F6F-4527-AC90-D816911FCF90}</Project>
|
||||
<Name>ANX.Framework.Windows.DX10</Name>
|
||||
|
@ -83,6 +83,14 @@
|
||||
<Project>{6899F0C9-70B9-4EB0-9DD3-E598D4BE3E35}</Project>
|
||||
<Name>ANX.Framework</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\InputSystems\ANX.InputDevices.Windows.XInput\ANX.InputDevices.Windows.XInput.csproj">
|
||||
<Project>{60D08399-244F-46A3-91F1-4CFD26D961A3}</Project>
|
||||
<Name>ANX.InputDevices.Windows.XInput</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\InputSystems\ANX.InputSystem.Standard\ANX.InputSystem.Standard.csproj">
|
||||
<Project>{49066074-3B7B-4A55-B122-6BD33AB73558}</Project>
|
||||
<Name>ANX.InputSystem.Standard</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\RenderSystems\ANX.Framework.Windows.DX10\ANX.Framework.Windows.DX10.csproj">
|
||||
<Project>{5BE49183-2F6F-4527-AC90-D816911FCF90}</Project>
|
||||
<Name>ANX.Framework.Windows.DX10</Name>
|
||||
|
@ -83,6 +83,14 @@
|
||||
<Project>{6899F0C9-70B9-4EB0-9DD3-E598D4BE3E35}</Project>
|
||||
<Name>ANX.Framework</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\InputSystems\ANX.InputDevices.Windows.XInput\ANX.InputDevices.Windows.XInput.csproj">
|
||||
<Project>{60D08399-244F-46A3-91F1-4CFD26D961A3}</Project>
|
||||
<Name>ANX.InputDevices.Windows.XInput</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\InputSystems\ANX.InputSystem.Standard\ANX.InputSystem.Standard.csproj">
|
||||
<Project>{49066074-3B7B-4A55-B122-6BD33AB73558}</Project>
|
||||
<Name>ANX.InputSystem.Standard</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\RenderSystems\ANX.Framework.Windows.DX10\ANX.Framework.Windows.DX10.csproj">
|
||||
<Project>{5BE49183-2F6F-4527-AC90-D816911FCF90}</Project>
|
||||
<Name>ANX.Framework.Windows.DX10</Name>
|
||||
|
@ -99,6 +99,18 @@
|
||||
<Project>{6899F0C9-70B9-4EB0-9DD3-E598D4BE3E35}</Project>
|
||||
<Name>ANX.Framework</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\InputSystems\ANX.InputDevices.OpenTK\ANX.InputDevices.OpenTK.csproj">
|
||||
<Project>{5CA3CDF5-4D2C-42AC-AD08-641BD3992B75}</Project>
|
||||
<Name>ANX.InputDevices.OpenTK</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\InputSystems\ANX.InputDevices.Windows.Kinect\ANX.InputDevices.Windows.Kinect.csproj">
|
||||
<Project>{E5D69E75-D77C-493F-BBDA-6F9E73B82549}</Project>
|
||||
<Name>ANX.InputDevices.Windows.Kinect</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\InputSystems\ANX.InputDevices.Windows.XInput\ANX.InputDevices.Windows.XInput.csproj">
|
||||
<Project>{60D08399-244F-46A3-91F1-4CFD26D961A3}</Project>
|
||||
<Name>ANX.InputDevices.Windows.XInput</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\InputSystems\ANX.InputSystem.Recording\ANX.InputSystem.Recording.csproj">
|
||||
<Project>{DB88DDEB-7281-405D-8FCA-5681B6B2BD7A}</Project>
|
||||
<Name>ANX.InputSystem.Recording</Name>
|
||||
|
Loading…
x
Reference in New Issue
Block a user