lightweight variant (#1)

Reviewed-on: #1
Co-authored-by: Aleksandr Neychev <alexnejchev73@gmail.com>
This commit was merged in pull request #1.
This commit is contained in:
2026-08-12 13:37:30 +00:00
committed by alex
parent a0d3098fe4
commit 55ac8e6556
147 changed files with 4055 additions and 2349 deletions
@@ -0,0 +1,29 @@
namespace CursorLang.Core.Services;
/// <summary>
/// Intercepts Caps Lock at the system level and splits the presses into short and
/// long ones. What to do with them is up to the subscribers.
/// </summary>
public interface ICapsLockHotkeyService
{
/// <summary>A short press: the key was released before the hold threshold.</summary>
event EventHandler? Tapped;
/// <summary>The hold threshold has passed, the key is still held.</summary>
event EventHandler? HoldStarted;
/// <summary>The hold is over: the key was released.</summary>
event EventHandler? HoldEnded;
/// <summary>Whether the hook is installed right now.</summary>
bool IsRunning { get; }
/// <summary>
/// Starts intercepting. Must be called from the user interface thread:
/// a system keyboard hook works only on a thread with a message loop.
/// </summary>
void Start();
/// <summary>Removes the hook, giving the key its usual behaviour back.</summary>
void Stop();
}