Proposal: Adding a Calculator Module to the Keyboard
One very useful and interesting feature that could be added to the keyboard is a calculator module.
The goal is to let users type mathematical expressions directly inside the keyboard or in text field , see the result immediately, and insert it into the text field without leaving the typing flow.
Core Idea
Instead of implementing a full calculator engine directly inside the keyboard, the keyboard can connect to an external computation engine such as Qalculate.
In this model, the keyboard acts only as the user interface, while the actual calculation is handled by Qalculate. This approach:
- avoids building the entire calculation engine from scratch
- provides more advanced and accurate computations
- makes development and maintenance easier
- allows support for more complex expressions
Suggested Flow
1) User enters an expression
The user types a mathematical expression inside the keyboard, for example:
2² + 10
2) Expression is sent to the calculation engine
The keyboard sends the expression to Qalculate for processing.
3) Result is returned
Qalculate returns the result, and the keyboard displays it to the user.
4) Result is inserted into the text field
If the user confirms, the result can be inserted directly into the target text field, replacing the original expression.
Result Display Modes
This feature could work in several ways:
Suggested UI
When calculator mode is enabled, a bar could open above the keyboard.
This bar could have three main sections:
-
Input section
- for entering the mathematical expression
-
Result section
- for displaying the calculation output
-
Send section
- a button for sending the result to the target text field
This layout gives the user input, output, and final action in one simple and fast interface.
Trigger-Based Behavior
Similar to Text Expander, a trigger can be defined for the calculator as well.
For example, whenever the user types an expression inside [], it is treated as a mathematical formula.
For instance:
[ 2² + 10 ]=
In this case:
- the expression
2² + 10 is detected
- it is sent to Qalculate
- the result is returned
- the result is shown in suggestions or in a dedicated area
- the user can confirm whether it should replace the original expression
This makes the feature fast and aligned with the natural typing flow.
Benefits
- The user does not need to leave the keyboard
- Calculations become faster and smoother
- It is especially useful for quick tasks like addition, percentages, powers, roots, and simple formulas
- It can become a distinctive and valuable feature of the keyboard
Technical Feasibility
This is technically feasible, since an Android version of Qalculate already exists and can be bound to the keyboard:
https://github.com/jherkenhoff/qalculate-android
Proposal: Adding a Calculator Module to the Keyboard
One very useful and interesting feature that could be added to the keyboard is a calculator module.
The goal is to let users type mathematical expressions directly inside the keyboard or in text field , see the result immediately, and insert it into the text field without leaving the typing flow.
Core Idea
Instead of implementing a full calculator engine directly inside the keyboard, the keyboard can connect to an external computation engine such as Qalculate.
In this model, the keyboard acts only as the user interface, while the actual calculation is handled by Qalculate. This approach:
Suggested Flow
1) User enters an expression
The user types a mathematical expression inside the keyboard, for example:
2² + 102) Expression is sent to the calculation engine
The keyboard sends the expression to Qalculate for processing.
3) Result is returned
Qalculate returns the result, and the keyboard displays it to the user.
4) Result is inserted into the text field
If the user confirms, the result can be inserted directly into the target text field, replacing the original expression.
Result Display Modes
This feature could work in several ways:
Show only the result
Show both expression and result
Direct replacement with user confirmation
Suggested UI
When calculator mode is enabled, a bar could open above the keyboard.
This bar could have three main sections:
Input section
Result section
Send section
This layout gives the user input, output, and final action in one simple and fast interface.
Trigger-Based Behavior
Similar to Text Expander, a trigger can be defined for the calculator as well.
For example, whenever the user types an expression inside
[], it is treated as a mathematical formula.For instance:
[ 2² + 10 ]=In this case:
2² + 10is detectedThis makes the feature fast and aligned with the natural typing flow.
Benefits
Technical Feasibility
This is technically feasible, since an Android version of Qalculate already exists and can be bound to the keyboard:
https://github.com/jherkenhoff/qalculate-android