summaryrefslogtreecommitdiff
path: root/Userland/Applications/Calculator
diff options
context:
space:
mode:
authorScott R. Parish <sparish@protonmail.com>2021-08-20 21:40:50 -0700
committerAndreas Kling <kling@serenityos.org>2021-08-26 17:35:15 +0200
commiteb368a5000512200bae2a51ef97c6ed1beda7c47 (patch)
treee0b6219eb864f59be13bddffba285adad6ed20a5 /Userland/Applications/Calculator
parentf119c5580a1d39f7c976090c73c5f8cb4cc0c2e4 (diff)
downloadserenity-eb368a5000512200bae2a51ef97c6ed1beda7c47.zip
Calculator: The equal key will now also finish the operation
Prior to this if you typed "1+2=" you would not get the answer, instead you'd be left with "2" on the screen; Calculator wanted you to hit the enter key to get the answer. Now you can either use the enter or the equal key to finish the operation and get the answer.
Diffstat (limited to 'Userland/Applications/Calculator')
-rw-r--r--Userland/Applications/Calculator/CalculatorWidget.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Applications/Calculator/CalculatorWidget.cpp b/Userland/Applications/Calculator/CalculatorWidget.cpp
index 0343c20886..a66099379d 100644
--- a/Userland/Applications/Calculator/CalculatorWidget.cpp
+++ b/Userland/Applications/Calculator/CalculatorWidget.cpp
@@ -152,7 +152,7 @@ void CalculatorWidget::keydown_event(GUI::KeyEvent& event)
m_equals_button->set_focus(true);
m_equals_button->set_focus(false);
- if (event.key() == KeyCode::Key_Return) {
+ if (event.key() == KeyCode::Key_Return || event.key() == KeyCode::Key_Equal) {
m_keypad.set_value(m_calculator.finish_operation(m_keypad.value()));
} else if (event.code_point() >= '0' && event.code_point() <= '9') {
m_keypad.type_digit(event.code_point() - '0');