Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: clear imgui inputs when window focus lost (alt-tabbing) #162

Merged
merged 1 commit into from
Jan 30, 2024

Conversation

FlayaN
Copy link
Collaborator

@FlayaN FlayaN commented Jan 29, 2024

Implemented wndproc hook to catch WM_KILLFOCUS and call

Menu::GetSingleton()->OnFocusLost();
auto& io = ImGui::GetIO();
io.ClearInputKeys();
io.ClearEventsQueue();

Got some added info from "FiveLimbedCat/ProfJack" on discord, that we should also clear the io inputkeys

Got the addresses and offsets from Open Animation Replacer. Had to convert it to use the thunk/func version instead though!

Tested this on skyrim 1.6.1170.0

Now it will clear all ImGui input states when alt-tabbing

Link to diskussion on discord here:
https://discord.com/channels/1080142797870485606/1082470343119216751/1201664684261130250

@FlayaN FlayaN changed the title fix: clear imgui keyEventQueue when window focus lost (alt-tabbing) fix: clear imgui inputs when window focus lost (alt-tabbing) Jan 29, 2024
@alandtse alandtse merged commit f52563b into doodlum:dev Jan 30, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants