[Input] Added PacketNumber property

This commit is contained in:
thefiddler 2014-01-02 19:24:15 +01:00
parent b5d42b7992
commit 1ccf7e5ad2
3 changed files with 24 additions and 0 deletions

View file

@ -37,6 +37,7 @@ namespace OpenTK.Input
const float RangeMultiplier = 1.0f / (short.MaxValue + 1);
Buttons buttons;
int packet_number;
short left_stick_x;
short left_stick_y;
short right_stick_x;
@ -72,6 +73,11 @@ namespace OpenTK.Input
get { return is_connected; }
}
public int PacketNumber
{
get { return packet_number; }
}
public override string ToString()
{
return String.Format(
@ -167,6 +173,11 @@ namespace OpenTK.Input
right_trigger = right;
}
internal void SetPacketNumber(int number)
{
packet_number = number;
}
#endregion
#region Private Members

View file

@ -45,6 +45,7 @@ namespace OpenTK.Input
unsafe fixed short axes[MaxAxes];
int buttons;
int packet_number;
bool is_connected;
#region Public Members
@ -79,6 +80,11 @@ namespace OpenTK.Input
get { return is_connected; }
}
internal int PacketNumber
{
get { return packet_number; }
}
public override string ToString()
{
StringBuilder sb = new StringBuilder();
@ -167,6 +173,11 @@ namespace OpenTK.Input
is_connected = value;
}
internal void SetPacketNumber(int number)
{
packet_number = number;
}
#endregion
#region Private Members

View file

@ -65,6 +65,8 @@ namespace OpenTK.Platform
if (joy.IsConnected)
{
pad.SetConnected(true);
pad.SetPacketNumber(joy.PacketNumber);
GamePadConfiguration configuration = GetConfiguration(Joystick.GetGuid(index));
foreach (GamePadConfigurationItem map in configuration)