sinshu / managed-doom

A Doom port written in C#
408 stars 62 forks source link

Add an option to release a mouse on a key press #4

Closed PiotrZierhoffer closed 1 year ago

PiotrZierhoffer commented 4 years ago

Great work on the project! Runs on Linux with zero additional effort, just as it should!

I think it would make sense to allow users to unlock the mouse on a keypress. It's especially relevant for systems with "focus on hover", which you can't really do anything without turning the game off.

It should be relatively simple - SfmlUserInput.BuildTicCmd could just check for a special button, calling

window.SetMouseCursorVisible(true);
window.SetMouseCursorGrabbed(false);

and setting a flag. On click, if the flag is set, restore the cursor being grabbed. If the flag is set, UpdateMouse should not be called I am not sure how to add this keybinding to the help screen, if possible at all. Are these screens rendered or just taken from wad?

DamianSuess commented 1 year ago

For future readers, as per PR #5, Press the ESC key which brings up the Main Menu and released the mouse.