mirror of
https://github.com/vale981/VoiDPlugins
synced 2025-03-04 16:51: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 bool _inContact;
|
||||
private bool _lastContact;
|
||||
private bool _dirty;
|
||||
|
||||
public TouchPointerHandler()
|
||||
{
|
||||
|
@ -18,7 +19,11 @@ namespace VoiDPlugins.OutputMode
|
|||
|
||||
public void Flush()
|
||||
{
|
||||
_touchDevice.Inject();
|
||||
if (_dirty)
|
||||
{
|
||||
_touchDevice.Inject();
|
||||
_dirty = false;
|
||||
}
|
||||
}
|
||||
|
||||
public void Reset()
|
||||
|
@ -28,6 +33,7 @@ namespace VoiDPlugins.OutputMode
|
|||
|
||||
public void SetPosition(Vector2 pos)
|
||||
{
|
||||
_dirty = true;
|
||||
_touchDevice.SetPointerFlags(POINTER_FLAGS.INRANGE);
|
||||
_touchDevice.SetPosition(new POINT((int)pos.X, (int)pos.Y));
|
||||
if (_inContact != _lastContact)
|
||||
|
|
Loading…
Add table
Reference in a new issue