mirror of
https://github.com/vale981/VoiDPlugins
synced 2025-03-04 16:51:38 -05:00
Send unmodified position
This commit is contained in:
parent
732182c9e5
commit
1321361946
4 changed files with 15 additions and 3 deletions
0
build.sh
Normal file → Executable file
0
build.sh
Normal file → Executable file
|
@ -21,6 +21,7 @@ namespace VoiDPlugins.OutputMode
|
||||||
if (pos == _prev)
|
if (pos == _prev)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
SetInternalPosition(pos);
|
||||||
Instance.EnableButtonBit((int)WindowsInkButtonFlags.InRange);
|
Instance.EnableButtonBit((int)WindowsInkButtonFlags.InRange);
|
||||||
pos *= _conversionFactor;
|
pos *= _conversionFactor;
|
||||||
RawPointer->X = (ushort)pos.X;
|
RawPointer->X = (ushort)pos.X;
|
||||||
|
|
|
@ -14,6 +14,7 @@ namespace VoiDPlugins.OutputMode
|
||||||
{
|
{
|
||||||
private readonly IVirtualScreen _screen;
|
private readonly IVirtualScreen _screen;
|
||||||
private ThinVMultiAbsPointer? _osPointer;
|
private ThinVMultiAbsPointer? _osPointer;
|
||||||
|
private Vector2 _internalPos;
|
||||||
protected DigitizerInputReport* RawPointer { get; }
|
protected DigitizerInputReport* RawPointer { get; }
|
||||||
protected VMultiInstance<DigitizerInputReport> Instance { get; }
|
protected VMultiInstance<DigitizerInputReport> Instance { get; }
|
||||||
protected SharedStore SharedStore { get; }
|
protected SharedStore SharedStore { get; }
|
||||||
|
@ -73,7 +74,7 @@ namespace VoiDPlugins.OutputMode
|
||||||
public void Reset()
|
public void Reset()
|
||||||
{
|
{
|
||||||
if (_osPointer is not null && !ForcedSync)
|
if (_osPointer is not null && !ForcedSync)
|
||||||
_osPointer.SetPosition(new Vector2(RawPointer->X, RawPointer->Y));
|
SyncOSCursor();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Flush()
|
public void Flush()
|
||||||
|
@ -83,10 +84,19 @@ namespace VoiDPlugins.OutputMode
|
||||||
Dirty = false;
|
Dirty = false;
|
||||||
|
|
||||||
if (ForcedSync)
|
if (ForcedSync)
|
||||||
_osPointer?.SetPosition(new Vector2(RawPointer->X, RawPointer->Y));
|
SyncOSCursor();
|
||||||
|
|
||||||
Instance.Write();
|
Instance.Write();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void SetInternalPosition(Vector2 pos)
|
||||||
|
{
|
||||||
|
_internalPos = pos;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SyncOSCursor()
|
||||||
|
{
|
||||||
|
_osPointer?.SetPosition(_internalPos);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -28,6 +28,7 @@ namespace VoiDPlugins.OutputMode
|
||||||
delta += _error;
|
delta += _error;
|
||||||
_error = new Vector2(delta.X % 1, delta.Y % 1);
|
_error = new Vector2(delta.X % 1, delta.Y % 1);
|
||||||
_currentPoint = Vector2.Clamp(_currentPoint + delta, Vector2.Zero, _maxPoint);
|
_currentPoint = Vector2.Clamp(_currentPoint + delta, Vector2.Zero, _maxPoint);
|
||||||
|
SetInternalPosition(_currentPoint);
|
||||||
RawPointer->X = (ushort)_currentPoint.X;
|
RawPointer->X = (ushort)_currentPoint.X;
|
||||||
RawPointer->Y = (ushort)_currentPoint.Y;
|
RawPointer->Y = (ushort)_currentPoint.Y;
|
||||||
Dirty = true;
|
Dirty = true;
|
||||||
|
|
Loading…
Add table
Reference in a new issue