From 06b5d292d754b172567fa561668a3bfbbe120a2c Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Mon, 26 Oct 2020 20:46:30 +0100 Subject: [PATCH] LibGUI: Allow activating a focused button by pressing the space key :^) This applies to normal push buttons, checkboxes, and radio buttons. It feels very natural. Even moreso than activating with return.. --- Libraries/LibGUI/AbstractButton.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Libraries/LibGUI/AbstractButton.cpp b/Libraries/LibGUI/AbstractButton.cpp index 8b883a25e3..3829394b28 100644 --- a/Libraries/LibGUI/AbstractButton.cpp +++ b/Libraries/LibGUI/AbstractButton.cpp @@ -155,7 +155,7 @@ void AbstractButton::leave_event(Core::Event&) void AbstractButton::keydown_event(KeyEvent& event) { - if (event.key() == KeyCode::Key_Return) { + if (event.key() == KeyCode::Key_Return || event.key() == KeyCode::Key_Space) { click(event.modifiers()); event.accept(); return;