etra0 / botw-freecam

Freecam for the game Zelda: Breath of the Wild for the Wii U using the Cemu emulator
MIT License
67 stars 12 forks source link

Disable keyboard input #10

Open TheGordinho opened 3 years ago

TheGordinho commented 3 years ago

Set up a hotkey to disable keyboard input or automaticly disable when focus on window is lost

etra0 commented 3 years ago

Relevant to this issue: https://stackoverflow.com/questions/42589496/getting-a-list-of-all-open-windows-in-c-and-storing-them

etra0 commented 3 years ago

Well, seems like there's no easy way to quickly do this, in order to do a "proper" implementation I'd have to rewrite the entire input system. The quick way of doing this is a button to block keyboard input but doesn't seems to be a good solution since it'll require more interaction from the user.

This implementation will take me much more time than expected.

TheGordinho commented 3 years ago

Thanks for taking the time to look into it

mistermark commented 3 years ago

I understand this takes a lot of effort to fix, but I also am facing the same issue.

I often leave my game running while doing some other things on the side on the same PC, which makes Link move, or the cam move unintentionally because of inputs captured from outside the game.

etra0 commented 3 years ago

@mistermark Yes, it is something I have in mind, but as I already said, it'll take a lot of time because I have to rewrite the entire input system. Right now the solution I see is hooking into GetMessage to at least receive the message of when the window is on focus, but this means I have to update memory-rs to be able to easily hook to functions outside of Cemu.