Use IGamePadDriver through MappedGamePadDriver

This commit is contained in:
thefiddler 2013-12-24 17:16:16 +01:00
parent 0a71bbe065
commit bd1fb18836

View file

@ -50,7 +50,7 @@ namespace OpenTK.Platform.MacOS
// Requires Mac OS X 10.5 or higher. // Requires Mac OS X 10.5 or higher.
// Todo: create a driver for older installations. Maybe use CGGetLastMouseDelta for that? // Todo: create a driver for older installations. Maybe use CGGetLastMouseDelta for that?
class HIDInput : IInputDriver2, IMouseDriver2, IKeyboardDriver2, IGamePadDriver, IJoystickDriver2 class HIDInput : IInputDriver2, IMouseDriver2, IKeyboardDriver2, IJoystickDriver2
{ {
#region Fields #region Fields
@ -69,6 +69,8 @@ namespace OpenTK.Platform.MacOS
readonly CFString InputLoopMode = CF.RunLoopModeDefault; readonly CFString InputLoopMode = CF.RunLoopModeDefault;
readonly CFDictionary DeviceTypes = new CFDictionary(); readonly CFDictionary DeviceTypes = new CFDictionary();
readonly MappedGamePadDriver mapped_gamepad = new MappedGamePadDriver();
NativeMethods.IOHIDDeviceCallback HandleDeviceAdded; NativeMethods.IOHIDDeviceCallback HandleDeviceAdded;
NativeMethods.IOHIDDeviceCallback HandleDeviceRemoved; NativeMethods.IOHIDDeviceCallback HandleDeviceRemoved;
NativeMethods.IOHIDValueCallback HandleDeviceValueReceived; NativeMethods.IOHIDValueCallback HandleDeviceValueReceived;
@ -291,10 +293,9 @@ namespace OpenTK.Platform.MacOS
public IMouseDriver2 MouseDriver { get { return this; } } public IMouseDriver2 MouseDriver { get { return this; } }
public IKeyboardDriver2 KeyboardDriver { get { return this; } } public IKeyboardDriver2 KeyboardDriver { get { return this; } }
public IGamePadDriver GamePadDriver { get { return this; } } public IGamePadDriver GamePadDriver { get { return mapped_gamepad; } }
public IJoystickDriver2 JoystickDriver { get { return this; } } public IJoystickDriver2 JoystickDriver { get { return this; } }
#endregion #endregion
#region IMouseDriver2 Members #region IMouseDriver2 Members
@ -368,35 +369,16 @@ namespace OpenTK.Platform.MacOS
#endregion #endregion
#region IGamePadDriver Members
public GamePadState GetState(int index)
{
return new GamePadState();
}
public GamePadCapabilities GetCapabilities(int index)
{
return new GamePadCapabilities();
}
public string GetName(int index)
{
throw new NotImplementedException();
}
#endregion
#region IJoystickDriver2 Members #region IJoystickDriver2 Members
JoystickState IJoystickDriver2.GetState(int index) JoystickState IJoystickDriver2.GetState(int index)
{ {
throw new NotImplementedException(); return new JoystickState();
} }
JoystickCapabilities IJoystickDriver2.GetCapabilities(int index) JoystickCapabilities IJoystickDriver2.GetCapabilities(int index)
{ {
throw new NotImplementedException(); return new JoystickCapabilities();
} }
#endregion #endregion