diff options
author | Ariel Don <arieldn@protonmail.com> | 2021-07-12 19:08:58 -0500 |
---|---|---|
committer | Gunnar Beutner <gunnar@beutner.name> | 2021-07-13 07:11:47 +0200 |
commit | 5140994c69bbf8779d2896d6ebd5542f37a59903 (patch) | |
tree | b03cccf9931e7806e15c9b5a63af0852763ae459 /Userland | |
parent | 9cdea2d5212b1ea343b40fc59bf80ca6668d0f0b (diff) | |
download | serenity-5140994c69bbf8779d2896d6ebd5542f37a59903.zip |
LibGUI: Select radio buttons with keyboard
Diffstat (limited to 'Userland')
-rw-r--r-- | Userland/Libraries/LibGUI/AbstractButton.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Userland/Libraries/LibGUI/AbstractButton.cpp b/Userland/Libraries/LibGUI/AbstractButton.cpp index 9c49dfc593..cf67ad6788 100644 --- a/Userland/Libraries/LibGUI/AbstractButton.cpp +++ b/Userland/Libraries/LibGUI/AbstractButton.cpp @@ -161,7 +161,9 @@ void AbstractButton::keydown_event(KeyEvent& event) void AbstractButton::keyup_event(KeyEvent& event) { - if (m_being_pressed && (event.key() == KeyCode::Key_Return || event.key() == KeyCode::Key_Space)) { + bool was_being_pressed = m_being_pressed; + m_being_pressed = false; + if (was_being_pressed && (event.key() == KeyCode::Key_Return || event.key() == KeyCode::Key_Space)) { click(event.modifiers()); event.accept(); return; |