mirror of
https://github.com/vale981/VoiDPlugins
synced 2025-03-05 17:21:38 -05:00
Do not emit touch when no new position
This commit is contained in:
parent
37f0471982
commit
f73b73e543
1 changed files with 7 additions and 1 deletions
|
@ -8,6 +8,7 @@ namespace VoiDPlugins.OutputMode
|
||||||
private readonly TouchDevice _touchDevice;
|
private readonly TouchDevice _touchDevice;
|
||||||
private bool _inContact;
|
private bool _inContact;
|
||||||
private bool _lastContact;
|
private bool _lastContact;
|
||||||
|
private bool _dirty;
|
||||||
|
|
||||||
public TouchPointerHandler()
|
public TouchPointerHandler()
|
||||||
{
|
{
|
||||||
|
@ -17,8 +18,12 @@ namespace VoiDPlugins.OutputMode
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Flush()
|
public void Flush()
|
||||||
|
{
|
||||||
|
if (_dirty)
|
||||||
{
|
{
|
||||||
_touchDevice.Inject();
|
_touchDevice.Inject();
|
||||||
|
_dirty = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Reset()
|
public void Reset()
|
||||||
|
@ -28,6 +33,7 @@ namespace VoiDPlugins.OutputMode
|
||||||
|
|
||||||
public void SetPosition(Vector2 pos)
|
public void SetPosition(Vector2 pos)
|
||||||
{
|
{
|
||||||
|
_dirty = true;
|
||||||
_touchDevice.SetPointerFlags(POINTER_FLAGS.INRANGE);
|
_touchDevice.SetPointerFlags(POINTER_FLAGS.INRANGE);
|
||||||
_touchDevice.SetPosition(new POINT((int)pos.X, (int)pos.Y));
|
_touchDevice.SetPosition(new POINT((int)pos.X, (int)pos.Y));
|
||||||
if (_inContact != _lastContact)
|
if (_inContact != _lastContact)
|
||||||
|
|
Loading…
Add table
Reference in a new issue