mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-03 04:52:06 +02:00
SoundPlayer: Add spacebar keyboard shortcut for play/pause
This commit is contained in:
committed by
Andreas Kling
parent
8f2521ce52
commit
8d36893ddf
Notes:
sideshowbarker
2024-07-18 04:48:29 +09:00
Author: https://github.com/fluxth Commit: https://github.com/SerenityOS/serenity/commit/8d36893ddfb Pull-request: https://github.com/SerenityOS/serenity/pull/9748
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (c) 2021, Cesar Torres <shortanemoia@protonmail.com>
|
||||
* Copyright (c) 2021, the SerenityOS developers.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
@@ -236,6 +237,14 @@ void SoundPlayerWidgetAdvancedView::drop_event(GUI::DropEvent& event)
|
||||
}
|
||||
}
|
||||
|
||||
void SoundPlayerWidgetAdvancedView::keydown_event(GUI::KeyEvent& event)
|
||||
{
|
||||
if (event.key() == Key_Space)
|
||||
m_play_button->click();
|
||||
|
||||
GUI::Widget::keydown_event(event);
|
||||
}
|
||||
|
||||
SoundPlayerWidgetAdvancedView::~SoundPlayerWidgetAdvancedView()
|
||||
{
|
||||
manager().on_load_sample_buffer = nullptr;
|
||||
|
||||
Reference in New Issue
Block a user