Skip to content
This repository was archived by the owner on Jun 16, 2025. It is now read-only.

Commit 511982e

Browse files
committed
#501 Fix keybind errors found in 1.2.0
1 parent ec3b248 commit 511982e

File tree

2 files changed

+12
-25
lines changed

2 files changed

+12
-25
lines changed

src/Sidekick.Application/Keybinds/KeybindsExecutor.cs

Lines changed: 11 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,18 @@ private bool KeybindsProvider_OnKeyDown(string arg)
103103
}
104104
else
105105
{
106+
// We need to make sure some key combinations make it into the game no matter what
106107
Task.Run(async () =>
107108
{
108-
await task;
109+
var result = await task;
110+
111+
if (!result)
112+
{
113+
Enabled = false;
114+
keybindsProvider.PressKey(arg);
115+
await Task.Delay(200);
116+
}
117+
109118
Enabled = true;
110119
});
111120
}
@@ -119,10 +128,7 @@ private void ExecuteCustomChat(CustomChatSetting customChatSetting, string input
119128
{
120129
logger.LogInformation($"Keybind detected: {customChatSetting.Key}! Executing the custom chat command '{customChatSetting.ChatCommand}'");
121130

122-
var task = mediator.Send(new CustomChatCommand(customChatSetting.ChatCommand));
123-
124-
GetKeybindTask(customChatSetting.Key, input, task);
125-
returnTask = task;
131+
returnTask = mediator.Send(new CustomChatCommand(customChatSetting.ChatCommand));
126132
}
127133
}
128134

@@ -135,7 +141,6 @@ private void ExecuteKeybind<TCommand>(string keybind, string input, ref Task<boo
135141

136142
var task = mediator.Send(new TCommand());
137143

138-
GetKeybindTask(keybind, input, task);
139144
if (returnTask == null)
140145
{
141146
returnTask = task;
@@ -152,24 +157,6 @@ private void ExecuteKeybind<TCommand>(string keybind, string input, ref Task<boo
152157
}
153158
}
154159

155-
private void GetKeybindTask(string keybind, string input, Task<bool> task)
156-
{
157-
// We need to make sure some key combinations make it into the game no matter what
158-
if (task != null && input == keybind)
159-
{
160-
Task.Run(async () =>
161-
{
162-
if (!await task)
163-
{
164-
Enabled = false;
165-
keybindsProvider.PressKey(keybind);
166-
await Task.Delay(200);
167-
Enabled = true;
168-
}
169-
});
170-
}
171-
}
172-
173160
public void Dispose()
174161
{
175162
Dispose(true);

src/Sidekick.Presentation.Wpf/Startup.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public static ServiceProvider InitializeServices(App application)
2626
Assembly.Load("Sidekick.Infrastructure"),
2727
Assembly.Load("Sidekick.Persistence"),
2828
Assembly.Load("Sidekick.Presentation"),
29-
Assembly.Load("Sidekick.Presentation.Wpf"))
29+
Assembly.Load("Sidekick"))
3030

3131
// Layers
3232
.AddSidekickApplication()

0 commit comments

Comments
 (0)