Handling "Enter" and "Escape" in the calculator.