Fix virtual key check missing

This commit is contained in:
Infi
2024-07-15 12:27:08 +02:00
parent 764d608663
commit 6f1a3fc548
2 changed files with 7 additions and 5 deletions
+3 -3
View File
@@ -394,11 +394,11 @@ internal sealed unsafe class Chat : IDisposable
private static byte[] EncodeMessage(string str) { private static byte[] EncodeMessage(string str) {
using var input = new Utf8String(str); using var input = new Utf8String(str);
using var ouput = new Utf8String(); using var output = new Utf8String();
input.Copy(PronounModule.Instance()->ProcessString(&input, true)); input.Copy(PronounModule.Instance()->ProcessString(&input, true));
ouput.Copy(PronounModule.Instance()->ProcessString(&input, false)); output.Copy(PronounModule.Instance()->ProcessString(&input, false));
return ouput.AsSpan().ToArray(); return output.AsSpan().ToArray();
} }
internal bool IsCharValid(char c) internal bool IsCharValid(char c)
+4 -2
View File
@@ -315,9 +315,7 @@ internal unsafe class KeybindManager : IDisposable {
private void UpdateKeybinds() private void UpdateKeybinds()
{ {
foreach (var name in KeybindsToIntercept.Keys) foreach (var name in KeybindsToIntercept.Keys)
{
Keybinds[name] = GetKeybind(name); Keybinds[name] = GetKeybind(name);
}
} }
private static ModifierFlag GetModifiers(KeyboardSource source) private static ModifierFlag GetModifiers(KeyboardSource source)
@@ -348,6 +346,10 @@ internal unsafe class KeybindManager : IDisposable {
{ {
if (key == VirtualKey.NO_KEY) if (key == VirtualKey.NO_KEY)
return false; return false;
if (!Plugin.KeyState.IsVirtualKeyValid(key))
return false;
if (source == KeyboardSource.Game) if (source == KeyboardSource.Game)
return Plugin.KeyState[key]; return Plugin.KeyState[key];