2011-12-01 09:16:01 +00:00
|
|
|
using System;
|
|
|
|
using ANX.Framework.NonXNA;
|
|
|
|
|
2012-08-09 09:45:04 +00:00
|
|
|
// This file is part of the ANX.Framework created by the
|
|
|
|
// "ANX.Framework developer group" and released under the Ms-PL license.
|
|
|
|
// For details see: http://anxframework.codeplex.com/license
|
2011-12-01 09:16:01 +00:00
|
|
|
|
|
|
|
namespace ANX.InputSystem.Recording
|
|
|
|
{
|
|
|
|
public class Creator : IInputSystemCreator
|
|
|
|
{
|
2011-12-20 20:16:50 +00:00
|
|
|
//It not a good idea to have more than one RecordingDevice per Input Device, so we cache the request.
|
|
|
|
RecordingMouse mouse;
|
|
|
|
RecordingKeyboard keyboard;
|
|
|
|
RecordingGamePad gamePad;
|
2012-01-27 17:15:57 +00:00
|
|
|
#if XNAEXT
|
2011-12-20 20:16:50 +00:00
|
|
|
RecordingMotionSensingDevice msd;
|
2012-01-27 17:15:57 +00:00
|
|
|
#endif
|
2012-08-08 12:04:37 +00:00
|
|
|
|
2012-08-22 09:51:35 +00:00
|
|
|
public ITouchPanel TouchPanel
|
|
|
|
{
|
|
|
|
get
|
|
|
|
{
|
|
|
|
AddInSystemFactory.Instance.PreventSystemChange(AddInType.InputSystem);
|
|
|
|
throw new NotImplementedException();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-12-01 09:16:01 +00:00
|
|
|
public IGamePad GamePad
|
|
|
|
{
|
2012-02-15 19:48:46 +00:00
|
|
|
get
|
2012-08-08 12:04:37 +00:00
|
|
|
{
|
2012-08-22 09:51:35 +00:00
|
|
|
AddInSystemFactory.Instance.PreventSystemChange(AddInType.InputSystem);
|
2011-12-20 20:16:50 +00:00
|
|
|
if (gamePad == null)
|
|
|
|
gamePad = new RecordingGamePad();
|
|
|
|
return gamePad;
|
2011-12-06 09:11:26 +00:00
|
|
|
}
|
2011-12-01 09:16:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public IMouse Mouse
|
|
|
|
{
|
2012-02-15 19:48:46 +00:00
|
|
|
get
|
2012-08-08 12:04:37 +00:00
|
|
|
{
|
2012-08-22 09:51:35 +00:00
|
|
|
AddInSystemFactory.Instance.PreventSystemChange(AddInType.InputSystem);
|
2011-12-20 20:16:50 +00:00
|
|
|
if (mouse == null)
|
|
|
|
mouse = new RecordingMouse();
|
|
|
|
return mouse;
|
2011-12-06 09:11:26 +00:00
|
|
|
}
|
2011-12-01 09:16:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public IKeyboard Keyboard
|
|
|
|
{
|
2012-02-15 19:48:46 +00:00
|
|
|
get
|
2012-08-08 12:04:37 +00:00
|
|
|
{
|
2012-08-22 09:51:35 +00:00
|
|
|
AddInSystemFactory.Instance.PreventSystemChange(AddInType.InputSystem);
|
2011-12-20 20:16:50 +00:00
|
|
|
if (keyboard == null)
|
|
|
|
keyboard = new RecordingKeyboard();
|
|
|
|
return keyboard;
|
2011-12-06 09:11:26 +00:00
|
|
|
}
|
2011-12-01 09:16:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#if XNAEXT
|
|
|
|
public IMotionSensingDevice MotionSensingDevice
|
|
|
|
{
|
2012-02-15 19:48:46 +00:00
|
|
|
get
|
2012-08-08 12:04:37 +00:00
|
|
|
{
|
2012-08-22 09:51:35 +00:00
|
|
|
AddInSystemFactory.Instance.PreventSystemChange(AddInType.InputSystem);
|
2011-12-20 20:16:50 +00:00
|
|
|
if (msd == null)
|
|
|
|
msd = new RecordingMotionSensingDevice();
|
|
|
|
return msd;
|
2011-12-06 09:11:26 +00:00
|
|
|
}
|
2011-12-01 09:16:01 +00:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2012-08-22 09:51:35 +00:00
|
|
|
public string Name
|
|
|
|
{
|
|
|
|
get
|
|
|
|
{
|
|
|
|
return "Recording";
|
|
|
|
}
|
|
|
|
}
|
2011-12-01 09:16:01 +00:00
|
|
|
|
2012-08-22 09:51:35 +00:00
|
|
|
public int Priority
|
|
|
|
{
|
|
|
|
get
|
|
|
|
{
|
|
|
|
return int.MaxValue;
|
|
|
|
}
|
|
|
|
}
|
2011-12-01 09:16:01 +00:00
|
|
|
|
2012-08-22 09:51:35 +00:00
|
|
|
public bool IsSupported
|
|
|
|
{
|
|
|
|
get
|
|
|
|
{
|
|
|
|
// This is just a proxy, so it runs on all plattforms
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
2011-12-01 09:16:01 +00:00
|
|
|
}
|
|
|
|
}
|