Opened 13 years ago

Closed 10 years ago

Last modified 10 years ago

#965 closed defect (fixed)

Allow media keys for changing volume in game

Reported by: alexhultman Owned by:
Priority: Must Have Milestone: Alpha 17
Component: Core engine Keywords:
Cc: Patch:

Description

There is currently no way to change volume in game. You have to guess what volume to use, enter the game and test, leave the game and adjust, enter again and play. Media keys should be enabled to allow easy volume adjustment and control e.g. rhytmbox.

Change History (11)

comment:1 by alexhultman, 13 years ago

This might be an upstream bug. Doesn't work in World of Goo either.

comment:2 by Erik Johansson, 13 years ago

Eventually there should be a way to change the volume (and probably the volume of the music and sound effects separately) which should avoid the problem of having to alt-tab back and forth. The media keys not working does indeed sound like a problem outside of 0 A.D. For me the increase/lower volume keys on my keyboard works when 0 A.D. is running so it sounds like a problem with you OS/keyboard/keyboard driver. (Personally I don't use them very often as I have a (real world) volume button for my speakers so I just keep the computer volume setting and change that instead. But if that option is not available/the way you want to do it you should of course, so I'll leave this ticket open in case it turns out there's something we can do about it :) )

comment:3 by alexhultman, 13 years ago

I'm on Linux (Fedora 15) and the game runs very well as of alpha 7 (just finished a whole game against JuBot with no problems). You cannot alt-tab or windows-key out of 0ad under Linux. My media keys work perfectly with other applications, in fact, all of my drivers and devices work absolutely perfect. Totem and VLC in fullscreen can use the media keys, and my work-in-progress OpenGL games can use them. Is it a SDL bug? World of Goo uses SDL and so do you, right? Anyways - currently there is no way to change volume in-game. And since you cannot save the game and exit and then change volume you have to guess. I have my real-world volume fixed allowing me to control the volume digitally using a remote and my media keys. You should look into this. I might be wrong but it should be something that can be fixed. Linux is a maturing gaming platform you know :)

comment:4 by alexhultman, 13 years ago

Let this ticket be open. I'm going to test this on Fedora 16 in a couple of weeks. They are doing major work on improving desktop experiences.

comment:5 by Philip Taylor, 12 years ago

Volume keys work for me in KDE (4.6 on Gentoo) only in windowed mode, not fullscreen. In fullscreen we get keydown events with scancode 122/123 for volume-down/up, instead of the window manager handling them normally.

SDL doesn't seem to provide any way to pass those events back to the window manager, so I don't think we can do that. It seems to behave the same even with SDL_WM_GrabInput(SDL_GRAB_OFF). I suppose we could tie those keys into an in-game volume control, which wouldn't be ideal but might be better than nothing if there's no alternative.

(Incidentally, you can always press alt+enter to switch from fullscreen to windowed and then use the volume controls or alt-tab etc.)

comment:6 by Mitchell K, 12 years ago

Volume keys work fine on Mac OS X, aside from the fact that you can't hear anything in game :).

comment:7 by Timothy Hamlett, 10 years ago

Owner: set to Timothy Hamlett

comment:8 by Timothy Hamlett, 10 years ago

Owner: Timothy Hamlett removed

comment:9 by historic_bruno, 10 years ago

I'd be curious to see if SDL 2 (#2041) affects this.

comment:10 by historic_bruno, 10 years ago

Milestone: BacklogAlpha 17
Resolution: fixed
Status: newclosed

On my Ubuntu 14.04 VM w/ SDL 2.0.2, the volume and mute keys work as expected, they trigger the OS volume controls, both in windowed and fullscreen mode. What the developer has to say (SDL bugzilla #1456):

We don't currently plan any further 1.2 releases. This bug should not occur in SDL 2.0.

So I'm closing as fixed by SDL2.

comment:11 by Timothy Hamlett, 10 years ago

Sounds good!

Note: See TracTickets for help on using tickets.