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
4 changes: 2 additions & 2 deletions src/components/charts/KeyboardHeatmap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ export class KeyboardHeatmap {
">
<div>
<h4 style="font-size: 13px; color: var(--text-secondary); margin-bottom: 8px;">
🔴 Verbesserungsbedarf
Verbesserungsbedarf
</h4>
${worstKeys
.map(
Expand Down Expand Up @@ -263,7 +263,7 @@ export class KeyboardHeatmap {
</div>
<div>
<h4 style="font-size: 13px; color: var(--text-secondary); margin-bottom: 8px;">
🟢 Starke Tasten
Starke Tasten
</h4>
${bestKeys
.map(
Expand Down
34 changes: 34 additions & 0 deletions src/components/typing-area/TypingArea.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,40 @@ export class TypingArea {
}
}

/**
* Handle backspace - allow correction of mistakes
* Returns true if backspace was processed, false if at start
*/
handleBackspace(): boolean {
if (this.currentPosition === 0) {
return false;
}

// Move position back
this.currentPosition--;

// Reset the character at the current position
const charEl = this.charElements[this.currentPosition];
if (charEl) {
charEl.classList.remove('correct', 'incorrect', 'upcoming');
charEl.classList.add('current');
}

// Reset the next character to upcoming (if exists)
if (this.currentPosition + 1 < this.charElements.length) {
const nextCharEl = this.charElements[this.currentPosition + 1];
if (nextCharEl) {
nextCharEl.classList.remove('current');
nextCharEl.classList.add('upcoming');
}
}

// Emit backspace event
EventBus.emit('typing:backspace', { position: this.currentPosition });

return true;
}

/**
* Process a keystroke
*/
Expand Down
Loading
Loading