Fix: FFXI Keyboard Input Lockup After Hotkey Window Switching#10
Merged
Conversation
Resolves critical bug where FFXI game windows lose keyboard input (movement, menus, targeting, camera) after being activated via WIN+F1-F6 hotkeys. Only fix was force-closing the client. **Root Cause:** - Synthetic Alt keypresses (keybd_event) in aggressive window activation - No keyboard state cleanup after activation - DirectX input state corruption **Changes to Infrastructure/ProcessUtilityService.cs:** - Removed deprecated keybd_event synthetic Alt keypresses (lines 771-773) - Removed thread attachment strategy to prevent resource leaks - Removed focus stealing prevention manipulation - Added ResetKeyboardState() to clean modifier keys after activation - Added Win32 GetKeyboardState/SetKeyboardState/SendInput APIs - Simplified from 3 to 2 activation strategies: - Strategy 1: SwitchToThisWindow (optimal for DirectX games) - Strategy 2: Standard SetForegroundWindow fallback - Added 50ms post-activation delay for DirectX input reinitialization - Enhanced diagnostic logging for activation success/failure - Reduced activation attempts from 3 to 2 **Version Bump:** - 1.3.1 → 1.3.2 (bug fix release) **Testing:** - Build successful (0 errors) - Rapid hotkey switching should no longer cause keyboard lockup - DirectX input state remains clean after window activation 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Owner
Author
✅ Build Successful!Build #12 completed successfully for commit 🔗 View detailed build logs Automated build validation passed - ready for review! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Critical bug where FFXI game windows lose keyboard input (movement, menus, targeting, camera) after being activated via WIN+F1-F6 hotkeys. The keyboard becomes completely unresponsive for that character except for chatbar typing (A-Z keys work, but Enter doesn't). Only fix was force-closing the client and relaunching.
Root Cause
Synthetic Alt keypresses (
keybd_event) in the aggressive window activation strategy were corrupting DirectX input state:Solution
1. Removed Problematic Code:
keybd_event)2. Added Keyboard State Management:
ResetKeyboardState()cleans modifier keys after every activationGetKeyboardState,SetKeyboardState,SendInput3. Simplified Activation Strategies (3 → 2):
SwitchToThisWindow(optimal for DirectX games)SetForegroundWindowfallbackChanges
Infrastructure/ProcessUtilityService.cs: Complete window activation refactorFFXIManager.csproj: Version bump 1.3.1 → 1.3.2Testing
Performance Impact
🤖 Generated with Claude Code