This commit is contained in:
@@ -115,9 +115,28 @@ public sealed class CapsLockHotkeyService : ICapsLockHotkeyService, IDisposable
|
||||
return true;
|
||||
}
|
||||
|
||||
private void OnHoldTimerTick(object? sender, EventArgs e)
|
||||
private void OnHoldTimerTick(object? sender, EventArgs e) => HandleHoldElapsed();
|
||||
|
||||
/// <summary>
|
||||
/// The hold countdown has run out.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// The key being down is checked rather than assumed. A countdown started on the
|
||||
/// press can still be delivered just after the release — Windows does not withdraw a
|
||||
/// WM_TIMER it has already posted — and announcing a hold then would put the popup on
|
||||
/// screen showing the layout the tap is about to change away from.
|
||||
///
|
||||
/// The tests reach this directly: that ordering is the whole point and a real clock
|
||||
/// will not reproduce it on demand.
|
||||
/// </remarks>
|
||||
internal void HandleHoldElapsed()
|
||||
{
|
||||
_holdTimer.Stop();
|
||||
if (!_isPressed)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
_isHolding = true;
|
||||
HoldStarted?.Invoke(this, EventArgs.Empty);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user