Merge pull request #211 from cra0zy/unixgamepad

I was hoping someone else on the project had OSX access but that's looking unlikely. The changes look fairly benign so I'm just going to merge this in. Move fast and break things right :)
This commit is contained in:
Fraser Waters 2015-03-16 15:35:16 +00:00
commit 3efb4e303d
4 changed files with 24 additions and 0 deletions

View file

@ -92,5 +92,18 @@ namespace OpenTK.Input
{
return driver.SetVibration(index, left, right);
}
/// <summary>
/// Gets the name of this <see cref="GamePad"/>
/// </summary>
/// <returns>
/// Returns the name of the gamepad if the gamepad is connected.
/// Otherwise returns an empty string.
/// </returns>
/// <param name="index">A zero-based device index for the <c>GamePad</c> device to affect</param>
public static string GetName(int index)
{
return driver.GetName(index);
}
}
}

View file

@ -116,6 +116,7 @@ namespace OpenTK.Input
Add("030000005e0400008e02000010010000,X360 Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,");
Add("030000005e0400001907000000010000,X360 Wireless Controller,a:b0,b:b1,back:b6,dpdown:b14,dpleft:b11,dpright:b12,dpup:b13,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,");
Add("030000005e0400009102000007010000,X360 Wireless Controller,a:b0,b:b1,back:b6,dpdown:b14,dpleft:b11,dpright:b12,dpup:b13,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,");
Add("000000006258786f2033363020576972,X360 Wireless Controller,a:b0,b:b1,back:b8,dpdown:b16,dpleft:b13,dpright:b14,dpup:b15,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,");
// Android
Add("4e564944494120436f72706f72617469,NVIDIA Controller,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,");

View file

@ -242,6 +242,11 @@ namespace OpenTK.Platform.Linux
}
}
public override OpenTK.Input.IGamePadDriver CreateGamePadDriver()
{
return new MappedGamePadDriver();
}
#endregion
}
}

View file

@ -96,6 +96,11 @@ namespace OpenTK.Platform.MacOS
return InputDriver.JoystickDriver;
}
public override OpenTK.Input.IGamePadDriver CreateGamePadDriver()
{
return new MappedGamePadDriver();
}
#endregion
#region IDisposable Members