Merge MouseWheelTracker from MainForm interface into InputManager
This commit is contained in:
parent
f6d465a1ac
commit
29bceb272f
|
@ -9,13 +9,10 @@ namespace BizHawk.Client.Common
|
|||
|
||||
private readonly InputManager _inputManager;
|
||||
|
||||
private readonly IMainFormForApi _mainForm;
|
||||
|
||||
public InputApi(IMainFormForApi mainForm, IWindowCoordsTransformer displayManager, InputManager inputManager)
|
||||
public InputApi(IWindowCoordsTransformer displayManager, InputManager inputManager)
|
||||
{
|
||||
_displayManager = displayManager;
|
||||
_inputManager = inputManager;
|
||||
_mainForm = mainForm;
|
||||
}
|
||||
|
||||
public Dictionary<string, bool> Get()
|
||||
|
@ -27,7 +24,7 @@ namespace BizHawk.Client.Common
|
|||
|
||||
public Dictionary<string, object> GetMouse()
|
||||
{
|
||||
var (pos, lmb, mmb, rmb, x1mb, x2mb) = _inputManager.GetMainFormMouseInfo();
|
||||
var (pos, scroll, lmb, mmb, rmb, x1mb, x2mb) = _inputManager.GetMainFormMouseInfo();
|
||||
// TODO - need to specify whether in "emu" or "native" coordinate space.
|
||||
var p = _displayManager.UntransformPoint(pos);
|
||||
return new Dictionary<string, object>
|
||||
|
@ -39,7 +36,7 @@ namespace BizHawk.Client.Common
|
|||
["Right"] = rmb,
|
||||
["XButton1"] = x1mb,
|
||||
["XButton2"] = x2mb,
|
||||
["Wheel"] = _mainForm.MouseWheelTracker
|
||||
["Wheel"] = scroll
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,9 +26,6 @@ namespace BizHawk.Client.Common
|
|||
/// <remarks>only referenced from <c>EmuClientApi</c></remarks>
|
||||
bool IsTurboing { get; }
|
||||
|
||||
/// <remarks>only referenced from <c>InputApi</c></remarks>
|
||||
long MouseWheelTracker { get; }
|
||||
|
||||
/// <remarks>only referenced from <see cref="CommApi"/></remarks>
|
||||
(HttpCommunication HTTP, MemoryMappedFiles MMF, SocketServer Sockets) NetworkingHelpers { get; }
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ namespace BizHawk.Client.Common
|
|||
|
||||
public Controller ClientControls { get; set; }
|
||||
|
||||
public Func<(Point Pos, bool LMB, bool MMB, bool RMB, bool X1MB, bool X2MB)> GetMainFormMouseInfo { get; set; }
|
||||
public Func<(Point Pos, long Scroll, bool LMB, bool MMB, bool RMB, bool X1MB, bool X2MB)> GetMainFormMouseInfo { get; set; }
|
||||
|
||||
public void SyncControls(IEmulator emulator, IMovieSession session, Config config)
|
||||
{
|
||||
|
|
|
@ -290,6 +290,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
var b = Control.MouseButtons;
|
||||
return (
|
||||
Control.MousePosition,
|
||||
MouseWheelTracker,
|
||||
(b & MouseButtons.Left) != 0,
|
||||
(b & MouseButtons.Middle) != 0,
|
||||
(b & MouseButtons.Right) != 0,
|
||||
|
@ -799,7 +800,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
/// </summary>
|
||||
public bool InvisibleEmulation { get; set; }
|
||||
|
||||
public long MouseWheelTracker { get; private set; }
|
||||
private long MouseWheelTracker;
|
||||
|
||||
private int? _pauseOnFrame;
|
||||
public int? PauseOnFrame // If set, upon completion of this frame, the client wil pause
|
||||
|
|
Loading…
Reference in New Issue