some xinput stuff, can't test it here

This commit is contained in:
goyuken 2013-07-21 21:19:51 +00:00
parent 77a4eb098f
commit a5ec2f0f6d
2 changed files with 13 additions and 0 deletions

View File

@ -62,6 +62,17 @@ namespace BizHawk.MultiClient
state = controller.GetState();
}
public IEnumerable<Tuple<string, float>> GetFloats()
{
var g = state.Gamepad;
const float f = 3.2768f;
yield return new Tuple<string, float>("LeftThumbX", g.LeftThumbX / f);
yield return new Tuple<string, float>("LeftThumbY", g.LeftThumbY / f);
yield return new Tuple<string, float>("RightThumbX", g.RightThumbX / f);
yield return new Tuple<string, float>("RightThumbY", g.RightThumbY / f);
yield break;
}
public int NumButtons { get; private set; }
private readonly List<string> names = new List<string>();

View File

@ -298,6 +298,8 @@ namespace BizHawk.MultiClient
string xname = "X" + (i + 1) + " ";
for (int b = 0; b < pad.NumButtons; b++)
HandleButton(xname + pad.ButtonName(b), pad.Pressed(b));
foreach (var sv in pad.GetFloats())
FloatValues.Add(new Tuple<string,float>(xname + sv.Item1, sv.Item2));
}
//analyze joysticks