Run: Trigger on escape key only once

When you press the escape key in the Browse dialog, the key down event
closes the dialog while the key up event then closes the Run window.

Prevent this by only listening to key down events.
This commit is contained in:
Jelle Raaijmakers 2022-08-02 13:07:19 +02:00 committed by Linus Groh
parent c72482da54
commit 379c7c2f64
Notes: sideshowbarker 2024-07-17 08:28:15 +09:00

View File

@ -71,7 +71,7 @@ RunWindow::RunWindow()
void RunWindow::event(Core::Event& event)
{
if (event.type() == GUI::Event::KeyUp || event.type() == GUI::Event::KeyDown) {
if (event.type() == GUI::Event::KeyDown) {
auto& key_event = static_cast<GUI::KeyEvent&>(event);
if (key_event.key() == Key_Escape) {
// Escape key pressed, close dialog