mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-02-05 21:33:40 +08:00
added autofocus
This commit is contained in:
parent
8f6ff0ae79
commit
2c1e8c3754
1 changed files with 14 additions and 1 deletions
|
@ -4837,7 +4837,20 @@ $(document).keydown((event) => {
|
|||
|
||||
//keypresses for the test, using different method to be more responsive
|
||||
$(document).keydown(function (event) {
|
||||
if (!$("#wordsInput").is(":focus")) return;
|
||||
let pageTestActive = !$(".pageTest").hasClass("hidden");
|
||||
let commandLineVisible = !$("#commandLineWrapper").hasClass("hidden");
|
||||
let wordsFocused = $("#wordsInput").is(":focus");
|
||||
|
||||
if (pageTestActive && !commandLineVisible) {
|
||||
if (!wordsFocused) {
|
||||
focusWords();
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
||||
// if (!$("#wordsInput").is(":focus")) return;
|
||||
if (
|
||||
[
|
||||
"Tab",
|
||||
|
|
Loading…
Reference in a new issue