skyrim-community-shaders
skyrim-community-shaders copied to clipboard
Tab + Alt results in Tab key being stuck.
https://github.com/user-attachments/assets/465131f4-4442-494f-959f-1f753aab6b27
Video is taken with Community Shaders version 1.1.7 on Windows 10, Skyrim AE 1.6.1170. US keyboard.
Issue: If a user mistakenly or unintentionally presses and releases the Tab and Alt key (Tab before Alt, unlike Alt Tabbing), the Alt modifier key for some reason interrupts the Tab key release event, causing the Tab key to fire repeatedly.. indefinitely. Only upon pressing and releasing the Tab key again will it free issue. The video shows me pressing and releasing Tab + Alt, and ImGui's default window navigation cycling as if Tab was held down.
How to Replicate: Have the Community Shaders window focused, and Press Tab then Alt and release. You have to do it quickly, as if you were quickly alt tabbing. The faster you do it, the more reproduceable.
Note: This appears to be a common issue across many (if not all) ImGui based plugins for Skyrim. I have not created an issue on ImGui's repo because I think it stems from either the WndProc handle or the InputEvent implementation. I'm still investigating it.
Workaround:
In my personal project, I use this snippet inside my input manager ProcessInputEvent function which handles the RE::InputEvent* events. All it does is track this ultra-specific key combination and rule out this edge case. Not much of a "fix".
// lastKeyPress is stored beside io.AddKeyEvent() call.
if (lastKeyPress == 0x0F) { // 0x0F = Skyrim "Tab" key.
if (scanCode == 0x38 && buttonEvent->IsPressed()) { // 0x38 = Skyrim "L-Alt" key.
lastKeyPress = 0;
io.ClearInputKeys(); // This unlocks the Tab key.
}
}