PowerToys: [PowerToys Run] Inline calculations fail when including parentheses -- utilising operator precedence

Description of the new feature / enhancement

I expect operator precedence (use of parentheses) for inline calculations should at the least be supported by PowerToys Run.

Currently when attempting to perform non-complex calculations involving parentheses, the input stops being treated as a calculation.

For comparison, macOS equivalent Spotlight supports parentheses without issue.

Scenario when this would be used?

Useful when trying to perform only slightly more complex calculations using PowerToys Run.

Supporting information

Simple inputs such as:

  • (25+20)
  • (1+2)/3
  • etc.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 24 (8 by maintainers)

Most upvoted comments

I think we should change the default key. One issue we do face is period for math as well. I think ( is too math centric so we should tweak that.

Maybe a warning box for “this action command will impact math calculations” for period and (

this targeted that since keyword so yes. I do think we should rethink what is on by default.

While valid, That should be done outside this targeted issue and the PR. That is a much larger discussion and thinking point due to two years of muscle memory for everyone and have very few complaints of the scenario.

Eek. Let edit that

What does “Eek” mean? Don’t know this phrase.

The same as “oops”. It’s also the name of a silly cartoon. image

Oh thats pretty simple: ( is the default activation command for Time and Date plugin. You have to disable the plugin or change the activation command.

image

@jaimecbernardo @crutkas is this something we want to change? xref https://github.com/microsoft/PowerToys/issues/14495

Default activation commands are documented here: https://docs.microsoft.com/en-us/windows/powertoys/run#direct-activation-commands and can be customized in the plugin manager. In the Calculator plugin docs parentheses are not mentioned: https://docs.microsoft.com/en-us/windows/powertoys/run#calculator-plugin

Let’s keep this opened: I will look at source code and clarify this behavior.

Hi @jcphua I can repro this. Calculation with parentheses are supported only if the Calculator plugin is called with the action keyword (default is=). Not sure if a bug or if by design.

image