Ubuntu – Prevent a fullscreen game from disabling the volume control keys

fullscreengamesshortcut-keysvolume-control

I just installed Puddle which automatically goes to full-screen when you start it. As soon as it starts, the keyboard shortcuts for increasing/decreasing the volume (Fn+F5 and Fn+F6) stop working. (I seem to remember the same thing happening for other games.) Is there a way to make those keys continue to work while the game is running?

Best Answer

  • There is no easy way I know of to do that, as the underlying problem is that fullscreen handling in Linux is fundamentally broken. Essentially the app, or in most cases SDL, grabs your keyboard exclusively and lets no one else use it.

    However there are a few ugly workarounds:

    The sdl-hack tool in that repository allows you to force SDL applications into window mode via a LD_PRELOAD hack in case they don't have a switch for that themselves.

    The windowtool.py on the other side lets you manipulate a window and force it into a non-keyboard grabbing fullscreen window by removing window decorations, set the window to keep-above and position the window. Common use would look something like:

    sleep 1 && windowtool.py -a 1 -d 0  -m 0,0 ACTIVE
    

    You however still have to manually use xrandr to change the resolution. So this isn't exactly an easy to use or easy to automate solution. But it does give you the results you want, at least for SDL apps.

    PS: Documentation in that repository is quite out of date, sorry for that.

  • Related Question