mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-03 00:42:54 +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:
parent
ccced92ac2
commit
f19cb6bb22
Notes:
sideshowbarker
2024-07-18 01:13:00 +09:00
Author: https://github.com/elyse0
Commit: f19cb6bb22
Pull-request: https://github.com/SerenityOS/serenity/pull/10715
Reviewed-by: https://github.com/kleinesfilmroellchen ✅
1 changed files with 9 additions and 0 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue