calculator icon indicating copy to clipboard operation
calculator copied to clipboard

Add inking support to calculator for basic calculations/conversions or other math needs

Open arcadiogarcia opened this issue 6 years ago • 20 comments

Problem Statement

The calculator app currently supports different input mechanisms (keyboard, mouse, touch, pen), and while the app interface has been tailored in some way for for the rest of them, pen input has received less attention: the pen is treated like a regular mouse pointer with no special consideration. This is less than ideal when trying to input long numbers in a device where pen is one of the primaty input methods (e.g. Surface Studio in canvas mode, Surface Go with no keyboard attached), where many users would find easier to just write down the numbers.

Evidence or User Insights

Many Windows surfaces have benefited lately from tighter ink integration, from the new inline text input canvas to the integration of ink in apps like the Mail client, the Office suite and Microsoft To-Do. Users of pen enabled devices have come to expect more intuitive ways to interact with their computer, with the pen allowing rich ink input rather than just behaving like a simple pointer. The community response to this suggestion has been very positive suggesting that at least high-confidence users would find it a welcome addition (no pun intended).

Proposal

The proposal is to allow user to enter calculations in handwriten form, which will be recognized, parsed and calculated as any other user input.

Goals

  • Allow active pen (e.g. Surface Pen) users to enter handwritten calculations, recognize them and display the result
  • Understand mathematical expressions that can be expressed in one line using the same limited expression format the calculator already recognizes for pasted strings. E.g.:
    • VALID: 1+ 2 * 3
    • NOT VALID: sin(1)

Non-goals

  • Provide handwriten input for touch users
    • Accuracy wouldn't be satisfactory and it would conflict with the current touch usage patterns
  • Provide feature parity with the Math Input Panel
    • It would be a nice follow-up but it would require additional work on the recognition logic
  • Replace the current numeric pad. It should remain available so the user is free to use the pen as a pointer if they prefer it.

Low-Fidelity Concept:

I was playing around with the code and I added support for entering expressions using ink:

calculatorink

It works by overlaying a InkCanvas on top of the calculation result, and leveraging the existing OnPaste method to process the recognized string.

Is this a feature you would be interested in adding? If you do I can polish it and send a PR 😊

Note: A team member edited this comment for clarity based on conversation below.

arcadiogarcia avatar Feb 16 '19 04:02 arcadiogarcia

Arcadio, this is great! We are still in the process of transitioning into the open, so I don't think anyone was expecting contributions so soon. Adding ink support into Calculator is definitely on our feature backlog. I think the next step here is to bring our PM into the conversation so we can refine our vision for how this feature should appear in the app.

danbelcher-MSFT avatar Feb 18 '19 20:02 danbelcher-MSFT

Indeed, thanks so much, Arcadio! This looks very cool (and useful). I know we did some investigation into pen-based input a couple times in the past, along with (I think) some user research. We're going to find the work that was previously done in this area to help inform us of how to best move forward with you on this.

HowardWolosky avatar Feb 18 '19 23:02 HowardWolosky

This is your friendly Microsoft Issue Bot. I've seen this issue come in and have gone to tell a human about it.

MicrosoftIssueBot avatar Feb 21 '19 18:02 MicrosoftIssueBot

This is so cool, I would love this feature.

yaira2 avatar Mar 07 '19 00:03 yaira2

Love this feature.

pengzh0928 avatar Mar 07 '19 01:03 pengzh0928

This would be great!

newtykip avatar Mar 07 '19 06:03 newtykip

I really hope that it can support some complex operation rules.

If only some simple operations are supported, because the accuracy of keyboard input is far greater than that of recognition, users will choose keyboard input. Handwritten recognition is required only when the user is not easy to input the keyboard content. However, recognition of complex rules is still not good enough.

lizhimins avatar Mar 10 '19 12:03 lizhimins

@lizhimins My proposal here would be to leverage the preexisting logic for pasting operations. If by complex rules you are thinking about things like fractions and roots that would require additional work to make the ink to text parser understand them since that is not provided by the UWP APIs. My intent here wasn't to make keyboard users switch to pen input, just provide a good alternative for keyboardless devices or people that prefer using the pen.

arcadiogarcia avatar Mar 15 '19 18:03 arcadiogarcia

@arcadiogarcia When you get the chance, can you update your idea with more details following the feature pitch template from our New Feedback Process?

grochocki avatar Apr 02 '19 00:04 grochocki

Sure! This would be the feature pitch:

Problem Statement

The calculator app currently supports different input mechanisms (keyboard, mouse, touch, pen), and while the app interface has been tailored in some way for for the rest of them, pen input has received less attention: the pen is treated like a regular mouse pointer with no special consideration. This is less than ideal when trying to input long numbers in a device where pen is one of the primaty input methods (e.g. Surface Studio in canvas mode, Surface Go with no keyboard attached), where many users would find easier to just write down the numbers.

Evidence or User Insights

Many Windows surfaces have benefited lately from tighter ink integration, from the new inline text input canvas to the integration of ink in apps like the Mail client, the Office suite and Microsoft To-Do. Users of pen enabled devices have come to expect more intuitive ways to interact with their computer, with the pen allowing rich ink input rather than just behaving like a simple pointer. The community response to this suggestion has been very positive suggesting that at least high-confidence users would find it a welcome addition (no pun intended).

Proposal

The proposal is to allow user to enter calculations in handwriten form, which will be recognized, parsed and calculated as any other user input.

Goals

  • Allow active pen (e.g. Surface Pen) users to enter handwritten calculations, recognize them and display the result
  • Understand mathematical expressions that can be expressed in one line using the same limited expression format the calculator already recognizes for pasted strings. E.g.:
    • VALID: 1+ 2 * 3
    • NOT VALID: sin(1)

Non-goals

  • Provide handwriten input for touch users
    • Accuracy wouldn't be satisfactory and it would conflict with the current touch usage patterns
  • Provide feature parity with the Math Input Panel
    • It would be a nice follow-up but it would require additional work on the recognition logic
  • Replace the current numeric pad. It should remain available so the user is free to use the pen as a pointer if they prefer it.

Low-Fidelity Concept:

See the .gif above 😊

arcadiogarcia avatar Apr 02 '19 03:04 arcadiogarcia

This is great, thanks! I am going to update your original comment with these new details.

grochocki avatar Apr 02 '19 03:04 grochocki

We reviewed the pitch and would love to explore this idea further! The pitch is a great start, but there are still some open questions. Moving this into planning to iron out some of those details. A human will follow up with some feedback on your pitch shortly. Keep in mind that not all ideas that make it into the planning phase are guaranteed to make it to release. For more information on next steps, check out our spec workflow.

ghost avatar Jun 05 '19 20:06 ghost

@arcadiogarcia We love the idea of adding inking support to Calculator, and I think your sample is a great proof-of-concept! We have prototyped some inking integrations in the past, but we ran into a couple roadblocks mostly around error detection/correction. I'll try to dig up some more details on what we have tried.

Before submitting a PR, we'll want to work through some of those open issues as well as figure out the right UX approach (e.g., should any calculator input support ink? should it be a separate mode? etc.). Also, while inking can be a really cool way to interact with an app, we would like to think through some of the user scenarios where a user chooses ink over other input methods, so we can ensure we are optimizing for those scenarios.

I created calculator-specs/ink to track progress.

grochocki avatar Jun 05 '19 20:06 grochocki

Great! What is the best place to discuss those open issues, this thread or opening a PR with a draft of the spec and iterating there?

arcadiogarcia avatar Jun 05 '19 23:06 arcadiogarcia

Would this not be covered by using the Handwriting TextBox control? image

https://docs.microsoft.com/en-us/windows/uwp/design/controls-and-patterns/text-handwriting-view

mdtauk avatar Jun 05 '19 23:06 mdtauk

Currently the Calculator app doesn't launch the Handwriting TextBox control when tapped with a pen. An alternative approach would indeed be to just pop up the handwriting control, but it is optimized for text input and it doesn't support adding our own recognition logic. With the raw InkCanvas approach we can easily filter the candidates that aren't valid arithmetic expressions to improve accuracy, while I believe the Handwriting view doesn't give us a list of the candidates, only the closest match.

arcadiogarcia avatar Jun 06 '19 03:06 arcadiogarcia

Great! What is the best place to discuss those open issues, this thread or opening a PR with a draft of the spec and iterating there?

Ultimately, everything should be documented in the spec, so it would be good to have a draft spec drafted to start from. If the open questions are blocking that from being created, then we should have those conversations here first.

grochocki avatar Jun 10 '19 14:06 grochocki

Here are a couple of the larger open questions we had when we prototyped inking support in Calculator in the past:

Is inking a separate mode or is inking pervasive and enabled when you touch you pen to calculator?

We explored a couple options, including (a) having an independent "inking" calculator mode, (b) having the input field respond to pen input (as you have in your prototype), or (c) a hybrid that detects when you are interacting with Calculator with a pen and puts you in a more immersive math ink work space. They each have pros and cons, but IMO, but (b) or (c) would feel much more natural for pen users. Here is one early sketch more along the lines of (a)/(c):

image

How do you handle error detection/correction for invalid input?

This question mostly speaks for itself, but when entering a complex equation, it would be unfortunate to just drop the input and have the user enter it all again. We would need to be able to detect and allow for error correction for invalid input. Also, how accurately could we detect some functionality? For example, if someone wants to input cubic root of 27, will we recognize that properly? Or would we detect it as 3 * square root of 27? Here is one design exploration: image

We may be limited to operations from Standard mode. How do we convey what you can/can’t to the user?

It is unclear which math expressions we could support. For example, I believe Standard mode operations should work, but it is not as clear to whether all of the functionality of Scientific or Programmer modes could be supported. If some functionality is limited, how do we convey that to the user? If we went with approach (b) from above, how do we handle the user of parenthesis in Standard calculator where parenthesis are not supported?

grochocki avatar Jun 18 '19 22:06 grochocki

Maybe you would be interested in this: https://www.myscript.com/interactive-ink/ (it would be nice if we could integrate interactive-ink SDK in the calculator)

jingkecn avatar Jan 13 '20 09:01 jingkecn

This is a really helpful feature for users like me who primarily work with their pen. What is the status on this issue?

Ashesh3 avatar Sep 15 '23 08:09 Ashesh3