1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-20 18:15:07 +00:00

SoundPlayer: Add keyboard shortcuts for stop and volume

These shortcuts allow us to stop the player (key S) and adjust
the volume level (key Up and key Down).
This commit is contained in:
Elyse 2021-10-30 21:56:21 -05:00 committed by Andreas Kling
parent ccced92ac2
commit f19cb6bb22

View file

@ -142,6 +142,15 @@ void SoundPlayerWidgetAdvancedView::keydown_event(GUI::KeyEvent& event)
if (event.key() == Key_Space)
m_play_button->click();
if (event.key() == Key_S)
m_stop_button->click();
if (event.key() == Key_Up)
m_volume_slider->set_value(m_volume_slider->value() + m_volume_slider->page_step());
if (event.key() == Key_Down)
m_volume_slider->set_value(m_volume_slider->value() - m_volume_slider->page_step());
GUI::Widget::keydown_event(event);
}