Bug#563200: libsdl1.2debian: media keys don't control the volume during full-screen games

Kalle Olavi Niemitalo kon at iki.fi
Thu Dec 31 20:09:45 UTC 2009


Package: libsdl1.2debian
Version: 1.2.13-5
Severity: wishlist

My laptop has separate keys for changing the sound volume up or down.
As shown by xev:

KeyPress event, serial 31, synthetic NO, window 0x2000001,
    root 0x66, subw 0x0, time 22030999, (172,175), root:(177,225),
    state 0x10, keycode 122 (keysym 0x1008ff11, XF86AudioLowerVolume), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 31, synthetic NO, window 0x2000001,
    root 0x66, subw 0x0, time 22031006, (172,175), root:(177,225),
    state 0x10, keycode 122 (keysym 0x1008ff11, XF86AudioLowerVolume), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyPress event, serial 31, synthetic NO, window 0x2000001,
    root 0x66, subw 0x0, time 22031966, (172,175), root:(177,225),
    state 0x10, keycode 123 (keysym 0x1008ff13, XF86AudioRaiseVolume), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 31, synthetic NO, window 0x2000001,
    root 0x66, subw 0x0, time 22031973, (172,175), root:(177,225),
    state 0x10, keycode 123 (keysym 0x1008ff13, XF86AudioRaiseVolume), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

Normally, gnome-settings-daemon 2.28.1-1 grabs these keys (see
plugins/media-keys/gsd-media-keys-manager.c), and when it gets
the events, it changes the sound volume and pops up a window
telling about it.  However, when I'm playing an SDL-based game in
full-screen mode, these keys have no effect, apparently because
SDL grabs the whole keyboard.  This happens with these games at
least:

ii  barrage   1.0.2-4                      Rather violent action game
ii  boswars   2.5-2                        futuristic real-time strategy
ii  gunroar   0.15.dfsg1-3                 360-degree gunboat shooter
ii  kq        0.99.cvs20070319-1.1.kon.1   adventure game in the spirit

(That is a custom build of kq; the patches are in bug 224610.)

In Bos Wars, I can easily pause the game, hit Ctrl+F to switch it
to windowed mode, and then press the keys; but the other games
don't seem to offer such a possibility.  KQ in particular has
the windowed/full-screen toggle and the volume control in a
configuration menu that can't even be accessed during a fight,
and the piece of music it plays during fights is the one most
likely to make other people in the room ask you to turn it down.

Anyway, because the same problem occurs in multiple games, it
seems best to fix it just once in SDL rather than separately in
each one.  If some game wants to use the media keys for its own
purposes, then let it do that; but the default should be to
control the sound volume.  SDL could either adjust the mixer on
its own or somehow forward the events to gnome-settings-daemon.
I don't know whether the latter is currently possible: g-s-d
probably ignores synthetic KeyPress events, and although a
MediaPlayerKeyPressed signal has been defined for use over D-Bus,
it looks like g-s-d can only send that one and not receive it.

-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (900, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.32-trunk-amd64 (SMP w/2 CPU cores)
Locale: LANG=fi_FI.UTF-8, LC_CTYPE=fi_FI.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages libsdl1.2debian depends on:
ii  libsdl1.2debian-alsa          1.2.13-5   Simple DirectMedia Layer (with X11

libsdl1.2debian recommends no packages.

libsdl1.2debian suggests no packages.

-- no debconf information
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 188 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-sdl-maintainers/attachments/20091231/de7fe0fd/attachment.pgp>


More information about the Pkg-sdl-maintainers mailing list