Skip to content

Commit

Permalink
New keyboard shortcut for toggling repeat
Browse files Browse the repository at this point in the history
  • Loading branch information
Linfindel committed Jan 17, 2024
1 parent 70c486e commit d11ab6e
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions player.js
Original file line number Diff line number Diff line change
Expand Up @@ -656,8 +656,16 @@ else {

// Keyboard shortcuts
document.addEventListener("keyup", (e) => {
if(e.key == " " && document.activeElement != document.getElementById("title")){
e.preventDefault();
e.preventDefault();
e.key = e.key.toLowerCase();

const notEditingTitle = document.activeElement != document.getElementById("title");

if(e.key == " " && notEditingTitle){
play();
}

else if (e.key == "r" && notEditingTitle) {
repeat();
}
});

0 comments on commit d11ab6e

Please sign in to comment.