diff --git a/src/ui/button.cpp b/src/ui/button.cpp index be9763c93..1cc243806 100644 --- a/src/ui/button.cpp +++ b/src/ui/button.cpp @@ -96,15 +96,12 @@ bool ButtonBase::onProcessMessage(Message* msg) } } - // Check if the user pressed mnemonic. - if (mnemonicPressed) { - setSelected(true); - return true; - } - // Magnetic widget catches ENTERs - else if (isFocusMagnet() && - ((scancode == kKeyEnter) || - (scancode == kKeyEnterPad))) { + if (// Check if the user pressed mnemonic + mnemonicPressed || + // Magnetic widget catches ENTERs + (isFocusMagnet() && + ((scancode == kKeyEnter) || + (scancode == kKeyEnterPad)))) { manager()->setFocus(this); // Dispatch focus movement messages (because the buttons @@ -117,8 +114,8 @@ bool ButtonBase::onProcessMessage(Message* msg) } // For kCheckWidget or kRadioWidget else { - /* if the widget has the focus and the user press space or - if the user press Alt+the underscored letter of the button */ + // If the widget has the focus and the user press space or + // if the user press Alt+the underscored letter of the button if ((hasFocus() && (scancode == kKeySpace)) || mnemonicPressed) { if (m_behaviorType == kCheckWidget) { // Swap the select status