[Input] Improved GamePadButtons.ToString()
This commit is contained in:
parent
5c0923004a
commit
15a79e5213
1 changed files with 23 additions and 1 deletions
|
@ -160,7 +160,29 @@ namespace OpenTK.Input
|
|||
/// <returns>A <see cref="System.String"/> that represents the current <see cref="OpenTK.Input.GamePadButtons"/>.</returns>
|
||||
public override string ToString()
|
||||
{
|
||||
return Convert.ToString((int)buttons, 2).PadLeft(10, '0');
|
||||
System.Text.StringBuilder sb = new System.Text.StringBuilder();
|
||||
if (A == ButtonState.Pressed)
|
||||
sb.Append("A");
|
||||
if (B == ButtonState.Pressed)
|
||||
sb.Append("B");
|
||||
if (X == ButtonState.Pressed)
|
||||
sb.Append("X");
|
||||
if (Y == ButtonState.Pressed)
|
||||
sb.Append("Y");
|
||||
if (Start == ButtonState.Pressed)
|
||||
sb.Append("St");
|
||||
if (BigButton == ButtonState.Pressed)
|
||||
sb.Append("Gd");
|
||||
if (LeftShoulder == ButtonState.Pressed)
|
||||
sb.Append("L");
|
||||
if (RightShoulder == ButtonState.Pressed)
|
||||
sb.Append("R");
|
||||
if (LeftStick == ButtonState.Pressed)
|
||||
sb.Append("Ls");
|
||||
if (RightStick == ButtonState.Pressed)
|
||||
sb.Append("Rs");
|
||||
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
Loading…
Reference in a new issue