Skip to content

Commit ce93ed5

Browse files
committed
simplify action type
1 parent 3f83ae1 commit ce93ed5

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

ChefKeys/ChefKeysManager.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ private static bool HandleRegisteredKeyPress(IntPtr wParam, int vkCode, KeyRecor
122122

123123
if (triggerCombo)
124124
{
125-
comboFound.action?.Invoke("");
125+
comboFound.action?.Invoke();
126126
cancelAction = false;
127127

128128
return false;
@@ -143,7 +143,7 @@ private static bool HandleRegisteredKeyPress(IntPtr wParam, int vkCode, KeyRecor
143143

144144
StartMenuBlocked = true;
145145

146-
keyRecord.action?.Invoke("");
146+
keyRecord.action?.Invoke();
147147

148148
return true;
149149
}
@@ -157,7 +157,7 @@ private static bool HandleRegisteredKeyPress(IntPtr wParam, int vkCode, KeyRecor
157157
if (!cancelAction)
158158
{
159159
if (keyRecord.isSingleKeyRegistered)
160-
keyRecord.action?.Invoke("");
160+
keyRecord.action?.Invoke();
161161
}
162162

163163
cancelAction = false;
@@ -201,9 +201,9 @@ private static void BlockWindowsStartMenu()
201201

202202
#region key management
203203

204-
public static void RegisterHotkey(string hotkeys, Action<string> action) => RegisterHotkey(hotkeys, hotkeys, action);
204+
public static void RegisterHotkey(string hotkeys, Action action) => RegisterHotkey(hotkeys, hotkeys, action);
205205

206-
public static void RegisterHotkey(string hotkeys, string previousHotkey, Action<string> action)
206+
public static void RegisterHotkey(string hotkeys, string previousHotkey, Action action)
207207
{
208208
hotkeys = ConvertIncorrectKeyString(hotkeys);
209209
previousHotkey = ConvertIncorrectKeyString(previousHotkey);

ChefKeys/KeyRecords.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ internal record KeyRecord()
1313

1414
internal bool isSingleKeyRegistered { get; set; } = false;
1515

16-
internal Action<string> action;
16+
internal Action action;
1717

1818
internal Func<IntPtr, int, KeyRecord, bool> HandleKeyPress { get; set; }
1919

2020
internal bool AreKeyCombosRegistered() => KeyComboRecords.Count > 0;
2121

22-
internal void RegisterKeyCombo(string hotkey, int vk_code, Action<string> action, int vkCodeCombo0, int vkCodeCombo1 = 0, int vkCodeCombo2 = 0)
22+
internal void RegisterKeyCombo(string hotkey, int vk_code, Action action, int vkCodeCombo0, int vkCodeCombo1 = 0, int vkCodeCombo2 = 0)
2323
{
2424
if (KeyComboRecords.Any(x => x.comboRaw == hotkey))
2525
return;
@@ -43,7 +43,7 @@ internal record KeyComboRecord()
4343
{
4444
internal int vk_code { get; set; }
4545

46-
internal Action<string> action;
46+
internal Action action;
4747

4848
internal int vkCodeCombo0 { get; set; } = 0;
4949

0 commit comments

Comments
 (0)