Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added joystick.name accessor #73

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 12 additions & 2 deletions FreePIE.Core.Plugins/JoystickPlugin.cs
Expand Up @@ -77,7 +77,7 @@ public void Reset()

public void SetRange(int lowerRange, int upperRange)
{
foreach (DeviceObjectInstance deviceObject in joystick.GetObjects())
foreach (DeviceObjectInstance deviceObject in joystick.GetObjects())
{
if ((deviceObject.ObjectType & ObjectDeviceType.Axis) != 0)
joystick.GetObjectPropertiesById((int)deviceObject.ObjectType).SetRange(lowerRange, upperRange);
Expand All @@ -93,6 +93,11 @@ public bool GetDown(int button)
{
return State.IsPressed(button);
}

internal Joystick Joystick
{
get { return joystick; }
}
}

[Global(Name = "joystick")]
Expand Down Expand Up @@ -134,7 +139,7 @@ public int y

public int z
{
get { return State.Z; }
get { return State.Z; }
}

public int xRotation
Expand All @@ -161,5 +166,10 @@ public int[] pov
{
get { return State.GetPointOfViewControllers(); }
}

public string name
{
get { return device.Joystick.Information.InstanceName; }
}
}
}