mirror of
https://github.com/vale981/VoiDPlugins
synced 2025-03-04 16:51:38 -05:00
TouchPointerHandler: Implement ISynchronousPointer
This commit is contained in:
parent
8fa4e35b7f
commit
a01a3831ca
1 changed files with 12 additions and 2 deletions
|
@ -3,7 +3,7 @@ using OpenTabletDriver.Plugin.Platform.Pointer;
|
|||
|
||||
namespace VoiDPlugins.OutputMode
|
||||
{
|
||||
public class TouchPointerHandler : IAbsolutePointer, IPressureHandler
|
||||
public class TouchPointerHandler : IAbsolutePointer, IPressureHandler, ISynchronousPointer
|
||||
{
|
||||
private readonly TouchDevice _touchDevice;
|
||||
private bool _inContact;
|
||||
|
@ -16,8 +16,19 @@ namespace VoiDPlugins.OutputMode
|
|||
_lastContact = false;
|
||||
}
|
||||
|
||||
public void Flush()
|
||||
{
|
||||
_touchDevice.Inject();
|
||||
}
|
||||
|
||||
public void Reset()
|
||||
{
|
||||
_touchDevice.UnsetPointerFlags(POINTER_FLAGS.INRANGE);
|
||||
}
|
||||
|
||||
public void SetPosition(Vector2 pos)
|
||||
{
|
||||
_touchDevice.SetPointerFlags(POINTER_FLAGS.INRANGE);
|
||||
_touchDevice.SetPosition(new POINT((int)pos.X, (int)pos.Y));
|
||||
if (_inContact != _lastContact)
|
||||
{
|
||||
|
@ -39,7 +50,6 @@ namespace VoiDPlugins.OutputMode
|
|||
_touchDevice.SetPointerFlags(POINTER_FLAGS.UPDATE);
|
||||
}
|
||||
_touchDevice.SetTarget();
|
||||
_touchDevice.Inject();
|
||||
}
|
||||
|
||||
public void SetPressure(float percentage)
|
||||
|
|
Loading…
Add table
Reference in a new issue