mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-03-01 01:05:06 +08:00
impr(typing): add reminder that opposite shift mode is on if incorrect shift was used too many times
Closes #4626
This commit is contained in:
parent
6d7c3fe3b5
commit
5dfa95e6e1
1 changed files with 15 additions and 1 deletions
|
@ -38,6 +38,7 @@ let dontInsertSpace = false;
|
|||
let correctShiftUsed = true;
|
||||
let isKoCompiling = false;
|
||||
let isBackspace: boolean;
|
||||
let incorrectShiftsInARow = 0;
|
||||
|
||||
const wordsInput = document.getElementById("wordsInput") as HTMLInputElement;
|
||||
const koInputVisual = document.getElementById("koInputVisual") as HTMLElement;
|
||||
|
@ -561,7 +562,20 @@ function handleChar(
|
|||
KeymapEvent.flash(char, thisCharCorrect);
|
||||
}
|
||||
|
||||
if (!correctShiftUsed && Config.difficulty !== "master") return;
|
||||
if (Config.difficulty !== "master") {
|
||||
if (!correctShiftUsed) {
|
||||
incorrectShiftsInARow++;
|
||||
if (incorrectShiftsInARow >= 5) {
|
||||
Notifications.add("Reminder: Opposite shift mode is on.", 0, {
|
||||
important: true,
|
||||
});
|
||||
}
|
||||
return;
|
||||
} else {
|
||||
incorrectShiftsInARow = 0;
|
||||
console.log("correct shift used");
|
||||
}
|
||||
}
|
||||
|
||||
//update current corrected version. if its empty then add the current char. if its not then replace the last character with the currently pressed one / add it
|
||||
if (TestInput.corrected.current === "") {
|
||||
|
|
Loading…
Reference in a new issue