summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Userland/Applications/SoundPlayer/SoundPlayerWidgetAdvancedView.cpp9
-rw-r--r--Userland/Applications/SoundPlayer/SoundPlayerWidgetAdvancedView.h4
2 files changed, 13 insertions, 0 deletions
diff --git a/Userland/Applications/SoundPlayer/SoundPlayerWidgetAdvancedView.cpp b/Userland/Applications/SoundPlayer/SoundPlayerWidgetAdvancedView.cpp
index e6eba8c455..47ec452630 100644
--- a/Userland/Applications/SoundPlayer/SoundPlayerWidgetAdvancedView.cpp
+++ b/Userland/Applications/SoundPlayer/SoundPlayerWidgetAdvancedView.cpp
@@ -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;
diff --git a/Userland/Applications/SoundPlayer/SoundPlayerWidgetAdvancedView.h b/Userland/Applications/SoundPlayer/SoundPlayerWidgetAdvancedView.h
index feec4bbfdb..5f2b91d2d8 100644
--- a/Userland/Applications/SoundPlayer/SoundPlayerWidgetAdvancedView.h
+++ b/Userland/Applications/SoundPlayer/SoundPlayerWidgetAdvancedView.h
@@ -1,5 +1,6 @@
/*
* Copyright (c) 2021, Cesar Torres <shortanemoia@protonmail.com>
+ * Copyright (c) 2021, the SerenityOS developers.
*
* SPDX-License-Identifier: BSD-2-Clause
*/
@@ -40,6 +41,9 @@ public:
m_visualization = new_visualization;
}
+protected:
+ void keydown_event(GUI::KeyEvent&) override;
+
private:
void drop_event(GUI::DropEvent& event) override;
GUI::Window& m_window;