Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions frontend/src/ts/test/test-input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ function updateOverlap(now: number): void {
}
}

function carryoverFirstKeypress(): void {
export function carryoverFirstKeypress(): void {
// Because keydown triggers before input, we need to grab the first keypress data here and carry it over

// Take the key with the largest index
Expand Down Expand Up @@ -487,7 +487,7 @@ function carryoverFirstKeypress(): void {
}
}

export function resetKeypressTimings(carryover: boolean): void {
function resetKeypressTimings(): void {
keypressTimings = {
spacing: {
first: -1,
Expand All @@ -505,8 +505,6 @@ export function resetKeypressTimings(carryover: boolean): void {
keyDownData = {};
noCodeIndex = 0;

if (carryover) carryoverFirstKeypress();

console.debug("Keypress timings reset");
}

Expand Down Expand Up @@ -555,5 +553,5 @@ export function restart(): void {
incorrect: 0,
};

resetKeypressTimings(false);
resetKeypressTimings();
}
2 changes: 1 addition & 1 deletion frontend/src/ts/test/test-logic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ export function startTest(now: number): boolean {
TestState.setActive(true);
Replay.startReplayRecording();
Replay.replayGetWordsList(TestWords.words.list);
TestInput.resetKeypressTimings(true);
TestInput.carryoverFirstKeypress();
Time.set(0);
TestTimer.clear();

Expand Down
Loading