@@ -5,7 +5,7 @@ namespace ComputerLock.Platforms;
55/// <summary>
66/// 快捷键钩子
77/// </summary>
8- public class HotKeyHook : IDisposable
8+ public class HotkeyHook : IDisposable
99{
1010 [ DllImport ( "user32.dll" ) ]
1111 private static extern bool RegisterHotKey ( IntPtr hWnd , int id , uint fsModifiers , uint vk ) ;
@@ -16,13 +16,13 @@ public class HotKeyHook : IDisposable
1616 private const int HotkeyId = 90 ;
1717 private bool _isRegistered ;
1818
19- public event Action ? HotKeyPressed ;
19+ public event Action ? HotkeyPressed ;
2020
21- private sealed class HotKeyNativeWindow : NativeWindow
21+ private sealed class HotkeyNativeWindow : NativeWindow
2222 {
23- public event Action ? OnHotKeyPressed ;
23+ public event Action ? OnHotkeyPressed ;
2424
25- public HotKeyNativeWindow ( )
25+ public HotkeyNativeWindow ( )
2626 {
2727 this . CreateHandle ( new CreateParams ( ) ) ;
2828 }
@@ -33,7 +33,7 @@ protected override void WndProc(ref Message m)
3333 {
3434 if ( m . WParam . ToInt32 ( ) == HotkeyId )
3535 {
36- OnHotKeyPressed ? . Invoke ( ) ;
36+ OnHotkeyPressed ? . Invoke ( ) ;
3737 }
3838 }
3939 else
@@ -43,18 +43,18 @@ protected override void WndProc(ref Message m)
4343 }
4444 }
4545
46- private readonly HotKeyNativeWindow _nativeWindow ;
46+ private readonly HotkeyNativeWindow _nativeWindow ;
4747
48- public HotKeyHook ( )
48+ public HotkeyHook ( )
4949 {
50- _nativeWindow = new HotKeyNativeWindow ( ) ;
51- _nativeWindow . OnHotKeyPressed += ( ) => HotKeyPressed ? . Invoke ( ) ;
50+ _nativeWindow = new HotkeyNativeWindow ( ) ;
51+ _nativeWindow . OnHotkeyPressed += ( ) => HotkeyPressed ? . Invoke ( ) ;
5252 }
5353
5454 /// <summary>
5555 /// 注册快捷键
5656 /// </summary>
57- public void Register ( HotKey hotKey )
57+ public void Register ( Hotkey hotKey )
5858 {
5959 if ( _isRegistered )
6060 {
@@ -99,7 +99,7 @@ protected virtual void Dispose(bool disposing)
9999 _nativeWindow . DestroyHandle ( ) ;
100100 }
101101
102- ~ HotKeyHook ( )
102+ ~ HotkeyHook ( )
103103 {
104104 Dispose ( false ) ;
105105 }
0 commit comments