From 9e1061df609681e2033bb58b2bc177453355d294 Mon Sep 17 00:00:00 2001 From: SeerLite Date: Thu, 14 Jan 2021 17:15:42 -0300 Subject: [PATCH 1/2] Don't try to focus on result screen `!resultVisible` --- src/js/script.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/js/script.js b/src/js/script.js index 927dfae67..d19f72811 100644 --- a/src/js/script.js +++ b/src/js/script.js @@ -4686,11 +4686,16 @@ $(document).keydown(function (event) { let modePopupVisible = !$("#customTextPopupWrapper").hasClass("hidden") || !$("#customMode2PopupWrapper").hasClass("hidden"); - if (pageTestActive && !commandLineVisible && !modePopupVisible) { - if (!wordsFocused && event.key !== "Enter") { - focusWords(); - if (config.showOutOfFocusWarning) return; - } + if ( + pageTestActive && + !commandLineVisible && + !modePopupVisible && + !resultVisible && + !wordsFocused && + event.key !== "Enter" + ) { + focusWords(); + if (config.showOutOfFocusWarning) return; } //tab From 63af71652e2229a0e7f3aa8ce976cc16f41d13f8 Mon Sep 17 00:00:00 2001 From: SeerLite Date: Thu, 14 Jan 2021 15:34:57 -0300 Subject: [PATCH 2/2] Update live accuracy on keypress --- src/js/script.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/js/script.js b/src/js/script.js index 927dfae67..9577078d8 100644 --- a/src/js/script.js +++ b/src/js/script.js @@ -2767,8 +2767,6 @@ function startTest() { 100 ); - updateLiveAcc(acc); - if (activeFunBox === "layoutfluid" && config.mode === "time") { const layouts = ["qwerty", "dvorak", "colemak"]; let index = 0; @@ -4746,6 +4744,13 @@ $(document).keydown(function (event) { if (wordsFocused) { handleAlpha(event); } + + let acc = Misc.roundTo2( + (accuracyStats.correct / + (accuracyStats.correct + accuracyStats.incorrect)) * + 100 + ); + updateLiveAcc(acc); }); function handleTab(event) {