preliminary moose support
This commit is contained in:
parent
d1e7ed9d91
commit
9730d06a46
|
@ -338,6 +338,21 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
}
|
||||
|
||||
// analyse moose
|
||||
// other sorts of mouse api (raw input) could easily be added as a separate listing under a different class
|
||||
{
|
||||
var P = System.Windows.Forms.Control.MousePosition;
|
||||
if (trackdeltas)
|
||||
{
|
||||
// these are relative to screen coordinates, but that's not terribly important
|
||||
FloatDeltas["WMouse X"] += Math.Abs(P.X - FloatValues["WMouse X"]) * 50;
|
||||
FloatDeltas["WMouse Y"] += Math.Abs(P.Y - FloatValues["WMouse Y"]) * 50;
|
||||
}
|
||||
// coordinate translation happens later
|
||||
FloatValues["WMouse X"] = P.X;
|
||||
FloatValues["WMouse Y"] = P.Y;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
bool swallow = !GlobalWin.MainForm.AllowInput;
|
||||
|
|
|
@ -686,7 +686,26 @@ namespace BizHawk.Client.EmuHawk
|
|||
} // foreach event
|
||||
|
||||
// also handle floats
|
||||
conInput.AcceptNewFloats(Input.Instance.GetFloats());
|
||||
conInput.AcceptNewFloats(Input.Instance.GetFloats().Select(o =>
|
||||
{
|
||||
// hackish
|
||||
if (o.Item1 == "WMouse X")
|
||||
{
|
||||
var P = GlobalWin.DisplayManager.UntransformPoint(new System.Drawing.Point((int)o.Item2, 0));
|
||||
float x = P.X / (float)Global.Emulator.VideoProvider.BufferWidth;
|
||||
return new Tuple<string, float>("WMouse X", x * 20000 - 10000);
|
||||
}
|
||||
else if (o.Item1 == "WMouse Y")
|
||||
{
|
||||
var P = GlobalWin.DisplayManager.UntransformPoint(new System.Drawing.Point(0, (int)o.Item2));
|
||||
float y = P.Y / (float)Global.Emulator.VideoProvider.BufferHeight;
|
||||
return new Tuple<string, float>("WMouse Y", y * 20000 - 10000);
|
||||
}
|
||||
else
|
||||
{
|
||||
return o;
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
public void RebootCore()
|
||||
|
|
Loading…
Reference in New Issue