From 09d4e2f1a1bc206c80d8d3287d070c70ec7fd63d Mon Sep 17 00:00:00 2001
From: chunhualin1 <chunhualin1@lenovo.com>
Date: 星期五, 14 八月 2026 20:00:52 +0800
Subject: [PATCH] Merge branch 'master' of http://git.linmoli.cn/r/Moli.Desktop
---
src/Moli.Desktop/Runtime/IHotkeyService.cs | 42 ++++++++++++++++++++++++++++++++++++++++++
1 files changed, 42 insertions(+), 0 deletions(-)
diff --git a/src/Moli.Desktop/Runtime/IHotkeyService.cs b/src/Moli.Desktop/Runtime/IHotkeyService.cs
new file mode 100644
index 0000000..89a6ba7
--- /dev/null
+++ b/src/Moli.Desktop/Runtime/IHotkeyService.cs
@@ -0,0 +1,42 @@
+using Moli.Desktop.Hotkeys;
+
+namespace Moli.Desktop.Runtime;
+
+public enum HotkeyRegistrationState
+{
+ Registered,
+ Conflict,
+ Disabled,
+ Invalid
+}
+
+public sealed record HotkeyRegistration
+{
+ public required string BindingId { get; init; }
+ public required string Keys { get; init; }
+ public required HotkeyRegistrationState State { get; init; }
+ public string? Detail { get; init; }
+}
+
+public interface IHotkeyService : IDisposable
+{
+ event Func<HotkeyBinding, Task>? HotkeyPressed;
+ IReadOnlyList<HotkeyRegistration> Registrations { get; }
+ Task ReplaceBindingsAsync(IReadOnlyList<HotkeyBinding> bindings, CancellationToken cancellationToken = default);
+ void Pause();
+ void Resume();
+ void UnregisterAll();
+}
+
+public interface INativeHotkeyApi
+{
+ bool Register(IntPtr hwnd, int id, uint modifiers, uint virtualKey, out int win32Error);
+ bool Unregister(IntPtr hwnd, int id);
+}
+
+public interface IHotkeyMessageWindow : IDisposable
+{
+ IntPtr Handle { get; }
+ event Action<int>? HotkeyPosted;
+ void EnsureCreated();
+}
--
Gitblit v1.9.1