Skip to content

Commit

Permalink
don't allow duplicate of the same note down
Browse files Browse the repository at this point in the history
  • Loading branch information
44100hertz committed Jul 22, 2024
1 parent 946fc68 commit e50eb8d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/lib/piano/Piano.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,10 @@
const note = keyBinds[ev.code];
if (note !== undefined) {
ev.preventDefault();
if (ev.repeat) return;
if (down) {
if (notesDown[note]) {
return;
}
pressNote(note, "keyboard");
} else {
releaseNote(note, "keyboard");
Expand Down

0 comments on commit e50eb8d

Please sign in to comment.