Thanks a lot, that worked well.
I have decided to make the volume keys change volume when the game is active, or change track when the game is paused:
switch (button) {
...
case BUTTON_VOL_UP:
if (!pause) {
limit = rb->sound_max(SOUND_VOLUME);
if (++rb->global_settings->volume > limit)
rb->global_settings->volume = limit;
rb->sound_set(SOUND_VOLUME, rb->global_settings->volume);
} else {
rb->audio_next();
}
break;
case BUTTON_VOL_UP|BUTTON_REPEAT:
if (!pause) {
limit = rb->sound_max(SOUND_VOLUME);
if (++rb->global_settings->volume > limit)
rb->global_settings->volume = limit;
rb->sound_set(SOUND_VOLUME, rb->global_settings->volume);
}
break;
case BUTTON_VOL_DOWN:
if (!pause) {
limit = rb->sound_min(SOUND_VOLUME);
if (--rb->global_settings->volume < limit)
rb->global_settings->volume = limit;
rb->sound_set(SOUND_VOLUME, rb->global_settings->volume);
} else {
rb->audio_prev();
}
break;
case BUTTON_VOL_DOWN|BUTTON_REPEAT:
if (!pause) {
limit = rb->sound_min(SOUND_VOLUME);
if (--rb->global_settings->volume < limit)
rb->global_settings->volume = limit;
rb->sound_set(SOUND_VOLUME, rb->global_settings->volume);
}
break;