Send unmodified position

This commit is contained in:
X9VoiD 2022-05-20 04:35:40 +08:00
parent 732182c9e5
commit 1321361946
4 changed files with 15 additions and 3 deletions

0
build.sh Normal file → Executable file
View file

View file

@ -21,6 +21,7 @@ namespace VoiDPlugins.OutputMode
if (pos == _prev)
return;
SetInternalPosition(pos);
Instance.EnableButtonBit((int)WindowsInkButtonFlags.InRange);
pos *= _conversionFactor;
RawPointer->X = (ushort)pos.X;

View file

@ -14,6 +14,7 @@ namespace VoiDPlugins.OutputMode
{
private readonly IVirtualScreen _screen;
private ThinVMultiAbsPointer? _osPointer;
private Vector2 _internalPos;
protected DigitizerInputReport* RawPointer { get; }
protected VMultiInstance<DigitizerInputReport> Instance { get; }
protected SharedStore SharedStore { get; }
@ -73,7 +74,7 @@ namespace VoiDPlugins.OutputMode
public void Reset()
{
if (_osPointer is not null && !ForcedSync)
_osPointer.SetPosition(new Vector2(RawPointer->X, RawPointer->Y));
SyncOSCursor();
}
public void Flush()
@ -83,10 +84,19 @@ namespace VoiDPlugins.OutputMode
Dirty = false;
if (ForcedSync)
_osPointer?.SetPosition(new Vector2(RawPointer->X, RawPointer->Y));
SyncOSCursor();
Instance.Write();
}
}
protected void SetInternalPosition(Vector2 pos)
{
_internalPos = pos;
}
private void SyncOSCursor()
{
_osPointer?.SetPosition(_internalPos);
}
}
}

View file

@ -28,6 +28,7 @@ namespace VoiDPlugins.OutputMode
delta += _error;
_error = new Vector2(delta.X % 1, delta.Y % 1);
_currentPoint = Vector2.Clamp(_currentPoint + delta, Vector2.Zero, _maxPoint);
SetInternalPosition(_currentPoint);
RawPointer->X = (ushort)_currentPoint.X;
RawPointer->Y = (ushort)_currentPoint.Y;
Dirty = true;