Joakim Tufvegren 2b097d670a
Fix overflows in WPM calculations (#13128)
* Fix overflow in WPM calculations.

First, the "fresh" WPM calculation could end up being up to 12000 (with
default `WPM_ESTIMATED_WORD_SIZE`) if keys were pressed more or less
simultaneously. This value has now been clamped down to 255, in effect
clamping WPM to its max value of 255.

Second, with `WPM_ALLOW_COUNT_REGRESSION` enabled, it was possible to
regress the WPM below 0 (i.e. to 255) by just repeatedly pressing
backspace.

* Fix WPM being limited to 235 due to float/int logic.
2021-08-04 07:40:08 +10:00
..
2021-04-03 08:27:46 -07:00
2019-08-30 15:01:52 -07:00
2019-08-30 15:01:52 -07:00
2020-08-29 14:30:02 -07:00
2019-08-30 15:01:52 -07:00
2020-03-06 22:29:01 -08:00
2019-08-30 15:01:52 -07:00
2019-08-30 15:01:52 -07:00
2019-08-30 15:01:52 -07:00