Skip to content
Open
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
32 changes: 16 additions & 16 deletions assets/js/learning.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,22 @@ document.addEventListener("keyup", (event) => {
});

// Task: Build a simple typing-test screen.
// document.addEventListener("keyup", (event) => {
// switch (event.key) {
// case "ArrowUp":
// alert("You have pressed ArrowUp Key");
// break;
// case "ArrowDown":
// alert("You have pressed ArrowDown Key");
// break;
// case "ArrowLeft":
// alert("You have pressed ArrowLeft Key");
// break;
document.addEventListener("keyup", (event) => {
switch (event.key) {
case "ArrowUp":
alert("You have pressed ArrowUp Key");
break;
case "ArrowDown":
alert("You have pressed ArrowDown Key");
break;
case "ArrowLeft"
alert("You have pressed ArrowLeft Key");
break;
// case "ArrowRight":
// alert("You have pressed ArrowRight Key");
// break;
// default:
// alert("Unknown key detected");
// break;
// }
// });
default:
alert("Unknown key detected");
break;
}
});