diff options
Diffstat (limited to 'src/gui/widgets/radiobutton.cpp')
-rw-r--r-- | src/gui/widgets/radiobutton.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/gui/widgets/radiobutton.cpp b/src/gui/widgets/radiobutton.cpp index 94152a716..4a9a912b1 100644 --- a/src/gui/widgets/radiobutton.cpp +++ b/src/gui/widgets/radiobutton.cpp @@ -158,3 +158,16 @@ void RadioButton::mouseExited(gcn::MouseEvent& event A_UNUSED) { mHasMouse = false; } + +void RadioButton::keyPressed(gcn::KeyEvent& keyEvent) +{ + gcn::Key key = keyEvent.getKey(); + + if (key.getValue() == gcn::Key::ENTER || + key.getValue() == gcn::Key::SPACE) + { + setSelected(true); + distributeActionEvent(); + keyEvent.consume(); + } +} |