Page 1 of 1

Allow pressing E to confirm number input fields, by dropping support for scientific notation

Posted: Sun Oct 27, 2024 3:32 pm
by Wiwiweb
What?
As of 2.0, if you try to confirm a number input field (such as logistic requests count) by pressing e, it will type an e in the field instead. This is because Factorio now supports scientific notation (e.g. 4e3 = 4000)

I would like to drop this support to return to the original behavior.

Why?
In my future Factorio playtime, I'm going to confirm textfields ten of thousands of times, and I'm going to use numbers above 1000 only hundreds of times.

The convenience of quickly confirming appears much more valuable than the convenience of saving keypresses for numbers above 1000.

It appears so unintuitive to people that it has been reported as a bug multiple times:
viewtopic.php?f=47&t=116616
viewtopic.php?f=47&t=117523
viewtopic.php?f=47&t=117057
viewtopic.php?f=23&t=116339

One last thing to note is that "E to confirm" is so engrained in Factorio UI, that hovering over the confirm button of number fields still says "Press E to confirm".
Screenshot from 2024-10-22 15-02-21~2.png
Screenshot from 2024-10-22 15-02-21~2.png (12.71 KiB) Viewed 497 times

Re: Allow pressing E to confirm number input fields, by dropping support for scientific notation

Posted: Sun Oct 27, 2024 3:52 pm
by Makka77
1 million hours muscle memory broken, and it means having to look at the keyboard to left hand enter. Breaks the flow for little to no gain.
+1

Re: Allow pressing E to confirm number input fields, by dropping support for scientific notation

Posted: Thu Oct 31, 2024 4:24 am
by vadcx
In Office spreadsheets there's the =A1*42 syntax to enable formula interpretation. That's a good compromise imo. I don't think many folks enter formulas / suffixes on the regular.

Re: Allow pressing E to confirm number input fields, by dropping support for scientific notation

Posted: Thu Oct 31, 2024 5:39 am
by kiwidrew
At the very least, it would be nice if "E" as the first keypress would close the window, because a valid number in scientific notation will never begin with an "e".

Re: Allow pressing E to confirm number input fields, by dropping support for scientific notation

Posted: Thu Oct 31, 2024 8:55 am
by Genhis
It's not only about scientific notation, the field also supports functions. We had similar internal discussion when this option was implemented. This behavior makes things consistent because if you are able to type text to such fields because of k/M/G prefixes and such, confirm key shouldn't take priority if it's a valid input.

Rseding added a hidden setting "use-formulas-in-number-input-fields" in 2.0.12 which reverts to 1.1 behavior if you really don't want to try to get used to this.

Re: Allow pressing E to confirm number input fields, by dropping support for scientific notation

Posted: Thu Oct 31, 2024 9:05 am
by computeraddict
Genhis wrote:
Thu Oct 31, 2024 8:55 am
It's not only about scientific notation, the field also supports functions. We had similar internal discussion when this option was implemented. This behavior makes things consistent because if you are able to type text to such fields because of k/M/G prefixes and such, confirm key shouldn't take priority if it's a valid input.

Rseding added a hidden setting "use-formulas-in-number-input-fields" in 2.0.12 which reverts to 1.1 behavior if you really don't want to try to get used to this.
Even if you let there be a confirm combination like ctrl+e or tab to unfocus the text field then press e so good old mouse hand doesn't have to get involved and left hand doesn't have to go find an enter key, it'd be nice.

Re: Allow pressing E to confirm number input fields, by dropping support for scientific notation

Posted: Fri Nov 01, 2024 4:05 am
by Wiwiweb
Genhis wrote:
Thu Oct 31, 2024 8:55 am
It's not only about scientific notation, the field also supports functions.
https://lua-api.factorio.com/latest/con ... ssion.html
abs, log2, sign, max, min.
By chance, no function uses the letter E!
There's also "The property where the expression is used may provide variables.", but I don't think that applies in-game as a player, it seems to be only when defining prototypes as a modder. Let me know if wrong.
Genhis wrote:
Thu Oct 31, 2024 8:55 am
Rseding added a hidden setting "use-formulas-in-number-input-fields" in 2.0.12 which reverts to 1.1 behavior if you really don't want to try to get used to this.
Appreciated! :D

Re: Allow pressing E to confirm number input fields, by dropping support for scientific notation

Posted: Fri Nov 01, 2024 4:14 am
by vadcx
Wiwiweb wrote:
Fri Nov 01, 2024 4:05 am
By chance, no function uses the letter E!
Wiwiweb wrote:
Sun Oct 27, 2024 3:32 pm
... by pressing e, it will type an e in the field instead. This is because Factorio now supports scientific notation (e.g. 4e3 = 4000)
--------
I will just repeat what I said above: use the equal sign = to begin entering a formula: =3.14159*1337%

EDIT: I just tested. They turned it into a text field, therefore any letters are valid inputs now. No real-time checks like a red outline if the current input is not a valid formula. All that happens when you press the button (mouse-click, CTRL+E, or out of input focus "E")