Announcement

Collapse
No announcement yet.

Stop grabbing my keyboard :(

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #21
    Originally posted by NeoBrain View Post
    http://www.alientrap.org/forum/viewt...42389724feca6b

    This has been somewhat useful for me, esp. since it works for every game that supports windowed mode (which should cover 99% of existing apps).

    The only problem seems to be fglrx, which keeps drawing the game's window even if it is minimized (worked once, but since 9.2 or something it does not). It does that also for the games, which support "real" minimizing, though...
    Looks like that is exactly what I put in the code to fix this for warsow: make a game windows and then let the windows manager set it fullscreen with _NET_WM_STATE_FULLSCREEN.
    But it doesn't change the keyboard grabbing, you'll have to remove the xgrabkeyboard in the input code.

    For those whodon't understand whati just wrote: It's very simple to fix this problem, with only a few changes to the source code of the game.

    Comment


    • #22
      Sometimes it's down to practicality - and may depend on the window manager. Mouse and keyboard grabs are there to redirect keyboard input to a game (this being somewhat useful). The mouse in particular will likely require a relative motion mode within the game to avoid limits on mouse motion.
      I'm not sure how it goes these days, but the option of running in a windowed "fullscreen" mode may carry performance penalties that make it an undesirable approach. And I won't even get started on cross-platform problems with that too.
      An in-game option or key combo to switch to windowed mode and release mouse/keyboard might be a better option.

      Comment


      • #23
        Originally posted by RealNC View Post
        The majority of Windows games stopped crashing while Atl+Tabbing after the Windows 98 days were over. That's not an issue anymore. I take it now for granted that I can task switch while a game is running. And when I can't, I'm pretty heavily annoyed.

        The last few games I played on Windows did have problems with this.


        Of course, me saying this is just as meaningless as your quoted statement

        Comment


        • #24
          Originally posted by mirv View Post
          Sometimes it's down to practicality - and may depend on the window manager. Mouse and keyboard grabs are there to redirect keyboard input to a game (this being somewhat useful). The mouse in particular will likely require a relative motion mode within the game to avoid limits on mouse motion.
          I'm not sure how it goes these days, but the option of running in a windowed "fullscreen" mode may carry performance penalties that make it an undesirable approach. And I won't even get started on cross-platform problems with that too.
          An in-game option or key combo to switch to windowed mode and release mouse/keyboard might be a better option.
          The mouse can be grabbed for a game, but should be ungrabbed when the game loses focus (after alt tab).
          There is also a solution that doesn't involve mousegrabbing: mousewarping. This way the mouse wontleave the game since it will be warped back to the center

          As for the second part of your post: I don't know how it was back in your days , but fullscreen or windowed shouldn't make much of a difference in performance.

          Comment


          • #25
            like said above, under linux we can just switch workspaces... thats what it's for anyways.
            i get mine to some quick access shortcuts and all is well, when it ends well.

            Comment


            • #26
              Originally posted by blablabla View Post
              The mouse can be grabbed for a game, but should be ungrabbed when the game loses focus (after alt tab).
              There is also a solution that doesn't involve mousegrabbing: mousewarping. This way the mouse wontleave the game since it will be warped back to the center

              As for the second part of your post: I don't know how it was back in your days , but fullscreen or windowed shouldn't make much of a difference in performance.
              Fullscreen / windowed won't make much difference in games that don't need much power (by today's standards) but I'm not convinced that recent stuff will enjoy it. But hey, I could be wrong! Guess I'll have to test it out now.
              In any case, I'm still of the opinion that important key events should be taken care of before they reach the game (for example, ctrl+alt+f[x] is never grabbed by any game, or even X, on my system); games shouldn't need to be aware of the window manager, though I agree they should be aware that something else may exist and be able to give control back to it easily.

              Comment


              • #27
                man xorg.conf

                xorg.conf(5)

                ServerFlags section

                <...>

                Option "AllowDeactivateGrabs" "boolean"
                This option enables the use of the Ctrl+Alt+Keypad-Divide key sequence to deactivate any active keyboard and mouse grabs. Default: off.

                <...>

                Comment


                • #28
                  Originally posted by NeoBrain View Post
                  http://www.alientrap.org/forum/viewt...42389724feca6b

                  This has been somewhat useful for me, esp. since it works for every game that supports windowed mode (which should cover 99% of existing apps).

                  The only problem seems to be fglrx, which keeps drawing the game's window even if it is minimized (worked once, but since 9.2 or something it does not). It does that also for the games, which support "real" minimizing, though...
                  This method also works with most of the other games I play, like Sauerbraten and Tremulous. And the nvidia driver seems to have no problem with this method.
                  Last edited by thefirstm; 13 August 2009, 07:59 AM.

                  Comment


                  • #29
                    +1

                    Same thing with Warzone2100.

                    Comment


                    • #30
                      Well, over three years later and it's still an issue.

                      I just tried The Book of Unwritten Tales.

                      * It starts up in fullscreen and changes your screen resolution to 1024x768
                      * It doesn't have a windowed mode
                      * It grabs all mouse and keyboard input EVEN with the steam overlay

                      Seriously, what year is it?

                      I have had two problems with that:

                      * I first started a new game and the sound was too quiet. It also grabbed the multimedia keys so I couldn't increasy my volume. I then pressed escape to access the menu and increase the ingame volume. This skipped the cutscene so I missed the introduction, had to exit the whole game to increasy my system volume and start a new game again
                      * I'm using hybrid GPUs and when using the radeon gpu for rendering with opengl compositing there's sometimes a little bug that the screen is black and I have to disable and re-enable compositing. The game also blocked the ctrl-shift-f12 hotkey for doing that. The game did not react to shortcuts like alt+f4. So I had to go to a tty (ctrl-alt-f1 is a key combination applications normally can't grab, but I'm sure if they could have done it, they would, just to maximally annoy the user) and kill the process. Well, after I found it, because it is named kAGE which doesn't have that much to do with the name of the game.

                      That's when I googled a bit and found this thread.

                      But I also found something even better: the archlinux package libx11-ldpreloadnograb. https://aur.archlinux.org/packages/l...ograb/PKGBUILD
                      It's libx11 but with the grab functions patched out and you can LD_PRELOAD it. Nice. At least this game doesn't seem to have a single adverse effect except crashing on the settings screen, but I can finally use alt+tab, change my volume with the multimedia keys, etc.

                      I wonder if there's a similar library to disable changing of resolutions. Then we had the basics to fight against the developers of games who go out of their way to annoy their users.

                      Comment

                      Working...
                      X