Skip to content

Revert "Grab keyboard when the game is not launched with -nomousegrab" #716

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

Merged
merged 1 commit into from
Jun 2, 2025

Conversation

jengelh
Copy link
Contributor

@jengelh jengelh commented May 27, 2025

This reverts commit 1707ee1.

Under X11, grabbing the keyboard has negative side effect of rendering Alt-Tab useless in windowed mode. Multimedia volume keys are rendered useless in windowed or fullscreen mode. When execution of descent3 is suspended (e.g. when running under a debugger), it would be impossible to get out of it even in fullscreen mode, since the SDL handler does not run.

Looking at other games, I find that many other engines (chocolate-doom, gzdoom, yquake2, sauerbraten, but also gl-117) do not exercise keyboard grabbing either and only use relative mouse mode (mouse grab).

Pull Request Type

  • Runtime changes
    • Input changes

Related Issues

#665

Checklist

  • I have tested my changes locally and verified that they work as intended.
  • I have reviewed the changes to ensure they do not introduce any unnecessary complexity or duplicate code.
  • I understand that by submitting this pull request, I am agreeing to license my contributions under the project's license.

This reverts commit 1707ee1.

Under X11, grabbing the keyboard has negative side effect of
rendering Alt-Tab useless in windowed mode. Multimedia volume keys
are rendered useless in windowed or fullscreen mode. When execution
of descent3 is suspended (e.g. when running under a debugger), it
would be impossible to get out of it even in fullscreen mode, since
the SDL handler does not run.

Looking at other games, I find that many other engines
(chocolate-doom, gzdoom, yquake2, sauerbraten, but also gl-117) do
not exercise keyboard grabbing either and only use relative mouse
mode (mouse grab).
@Lgt2x
Copy link
Member

Lgt2x commented Jun 2, 2025

I usually run debug builds with -nomousegrab, which also disables keyboard grab, so this has not been much an issue for me, but I agree that grabbing keyboard is not a great solution. That's the only way I found to solve #664 , because otherwise the OS has precedence over the game (which we want... most of the time?). I'm fine to assume that #664 should be solved with proper Desktop environment configuration and not by the game.

@Lgt2x Lgt2x merged commit a84848c into DescentDevelopers:main Jun 2, 2025
8 checks passed
@jengelh jengelh deleted the grab branch June 3, 2025 08:39
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