mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
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.
This commit is contained in:
parent
f119c5580a
commit
eb368a5000
Notes:
sideshowbarker
2024-07-19 17:17:55 +09:00
Author: https://github.com/srp 🔰 Commit: https://github.com/SerenityOS/serenity/commit/eb368a50005 Pull-request: https://github.com/SerenityOS/serenity/pull/9542
1 changed files with 1 additions and 1 deletions
|
@ -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');
|
||||
|
|
Loading…
Reference in a new issue