Skip to content

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

Merged
Lgt2x merged 1 commit intoDescentDevelopers:mainfrom
jengelh:grab
Jun 2, 2025
Merged

Revert "Grab keyboard when the game is not launched with -nomousegrab"#716
Lgt2x merged 1 commit intoDescentDevelopers:mainfrom
jengelh:grab

Conversation

@jengelh
Copy link
Copy Markdown
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
Copy Markdown
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