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:
@@ -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();
|
||||
}
|
||||
Reference in New Issue
Block a user