Add regions

device-handlers
Clive Galway 2 years ago
parent f37055ecf8
commit a4b3f4ccf5

@ -26,6 +26,7 @@ namespace AutoHotInterception.DeviceHandlers
}
}
#region Input Synthesis
/// <summary>
/// Sends a keyboard key event
/// </summary>
@ -46,6 +47,7 @@ namespace AutoHotInterception.DeviceHandlers
stroke.key.state = (ushort)st;
ManagedWrapper.Send(DeviceContext, DeviceId, ref stroke, 1);
}
#endregion
// ScanCode notes: https://www.win.tue.nl/~aeb/linux/kbd/scancodes-1.html
public override void ProcessStroke(ManagedWrapper.Stroke stroke)

@ -17,6 +17,23 @@ namespace AutoHotInterception.DeviceHandlers
}
/// <summary>
/// Called when we are removing a Subscription or Context Mode
/// If there are no other subscriptions, and Context Mode is disabled, turn the filter off
/// </summary>
public override void DisableFilterIfNeeded()
{
if (AllButtonsMapping == null
&& SingleButtonMappings.Count == 0
&& ContextCallback == null
&& _mouseMoveRelativeMapping == null
&& _mouseMoveAbsoluteMapping == null)
{
IsFiltered = false;
}
}
#region Subscription Mode
/// <summary>
/// Subscribes to Absolute mouse movement
/// </summary>
@ -74,23 +91,9 @@ namespace AutoHotInterception.DeviceHandlers
WorkerThreads.TryRemove(8, out _);
}
}
#endregion
/// <summary>
/// Called when we are removing a Subscription or Context Mode
/// If there are no other subscriptions, and Context Mode is disabled, turn the filter off
/// </summary>
public override void DisableFilterIfNeeded()
{
if (AllButtonsMapping == null
&& SingleButtonMappings.Count == 0
&& ContextCallback == null
&& _mouseMoveRelativeMapping == null
&& _mouseMoveAbsoluteMapping == null)
{
IsFiltered = false;
}
}
#region Input Synthesis
/// <summary>
/// Sends Mouse button events
/// </summary>
@ -146,6 +149,7 @@ namespace AutoHotInterception.DeviceHandlers
{ mouse = { x = x, y = y, flags = (ushort)ManagedWrapper.MouseFlag.MouseMoveRelative } };
ManagedWrapper.Send(DeviceContext, DeviceId, ref stroke, 1);
}
#endregion
public override void ProcessStroke(ManagedWrapper.Stroke stroke)
{

Loading…
Cancel
Save