mirror of
https://github.com/vale981/VoiDPlugins
synced 2025-03-04 08:41:40 -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)
|
||||
return;
|
||||
|
||||
SetInternalPosition(pos);
|
||||
Instance.EnableButtonBit((int)WindowsInkButtonFlags.InRange);
|
||||
pos *= _conversionFactor;
|
||||
RawPointer->X = (ushort)pos.X;
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue