update calc secret

This commit is contained in:
Boof 2023-03-16 10:42:51 +01:00 committed by GitHub
parent 0a0276b2c2
commit 717f06535c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -27,3 +27,22 @@ async function checkSecret() {
}
}
//adding event handler on the document to handle keyboard inputs
document.addEventListener("keydown", keyboardInputHandler);
//function to handle keyboard inputs
function keyboardInputHandler(o) {
// to fix the default behavior of browser,
// enter and backspace were causing undesired behavior when some key was already in focus.
o.preventDefault();
//grabbing the liveScreen
//numbers
if (o.key === "6") {
sixPress()
} else if (o.key === "9") {
checkSecret()
}
}