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

Disable Background Input #27

Closed
sgtlaggy opened this issue Oct 31, 2023 · 1 comment · Fixed by #32
Closed

Disable Background Input #27

sgtlaggy opened this issue Oct 31, 2023 · 1 comment · Fixed by #32
Labels
MGS2 Metal Gear Solid 2 MGS3 Metal Gear Solid 3

Comments

@sgtlaggy
Copy link

I frequently Alt-Tab and type, but MGS3 acts a bit like a keylogger and reads all input, regardless of whether it has focus. As I type this, Snake is crouch spamming, shooting, spinning in circles, equipping and unequipping items, everything but standing still. Somehow I even managed to tranq something.

This feature may not entirely be within scope of the mod, but I figure it's worth a shot with the mouse settings implemented.

If possible, I'd like to keep background input only for controllers, but that may be asking a bit much.

@emoose
Copy link
Contributor

emoose commented Nov 1, 2023

Seems there's a NHT_GetIsMinimized function at 0x14004EA50 that the game checks with before it processes inputs, patching that to return 1 stops any keyboard inputs from working, looks like that func is checking some variable which is meant to be set by WndProc at 0x14004DA59, but I guess that wndproc might not be looking at the right message or something, hm.

E: ah seems that variable is only set by WndProc when windowed mode isn't enabled, guess this was just meant for when alt-tabbing in fullscreen, not sure how much it'd need to let it work with windowed too.

E2: seem to have some patches working for it, PR below

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
MGS2 Metal Gear Solid 2 MGS3 Metal Gear Solid 3
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants