fix: various keybind fixes (modifiers and linkshells)

- Avoids overriding modifiers after leaving a vanilla text box. This
  would prevent you from holding e.g. Ctrl between multiple vanilla text
  boxes.
- Reworks linkshell rotation code to fix issues with LS number gaps
  causing linkshell rotation to not function.
This commit is contained in:
Dean Sheather
2024-07-27 03:31:19 +10:00
parent c9902dc28b
commit c22bde296d
3 changed files with 85 additions and 28 deletions
+5 -3
View File
@@ -396,11 +396,13 @@ internal unsafe class KeybindManager : IDisposable {
return;
}
// If the vanilla text input has just lost focus, clear all keys so we
// don't try to process them immediately.
// If the vanilla text input has just lost focus, clear all non-modifier
// keys so we don't try to process them immediately on the next frame.
if (VanillaTextInputHasFocus)
{
Plugin.KeyState.ClearAll();
foreach (var key in Plugin.KeyState.GetValidVirtualKeys())
if (key is not VirtualKey.CONTROL and not VirtualKey.SHIFT and not VirtualKey.MENU)
Plugin.KeyState[key] = false;
VanillaTextInputHasFocus = false;
return;
}