LibGUI: Select radio buttons with keyboard

This commit is contained in:
Ariel Don 2021-07-12 19:08:58 -05:00 committed by Gunnar Beutner
parent 9cdea2d521
commit 5140994c69
Notes: sideshowbarker 2024-07-18 09:08:48 +09:00

View file

@ -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;