diff options
-rw-r--r-- | Applications/Calculator/CalculatorWidget.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/Applications/Calculator/CalculatorWidget.cpp b/Applications/Calculator/CalculatorWidget.cpp index 4cf348d7d7..d986ee0eab 100644 --- a/Applications/Calculator/CalculatorWidget.cpp +++ b/Applications/Calculator/CalculatorWidget.cpp @@ -236,6 +236,16 @@ void CalculatorWidget::keydown_event(GUI::KeyEvent& event) } else if (event.key() >= KeyCode::Key_0 && event.key() <= KeyCode::Key_9) { m_keypad.type_digit(atoi(event.text().characters())); + } else if (event.key() == KeyCode::Key_Period) { + m_keypad.type_decimal_point(); + + } else if (event.key() == KeyCode::Key_Escape) { + m_keypad.set_value(0.0); + m_calculator.clear_operation(); + + } else if (event.key() == KeyCode::Key_Backspace) { + m_keypad.type_backspace(); + } else { Calculator::Operation operation; @@ -263,4 +273,4 @@ void CalculatorWidget::keydown_event(GUI::KeyEvent& event) } update_display(); -}
\ No newline at end of file +} |