Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

detect keypress

document.addEventListener("keypress", function onEvent(event) {
    if (event.key === "ArrowLeft") {
        // Move Left
    }
    else if (event.key === "Enter") {
        // Open Menu...
    }
});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #detect #keypress
ADD COMMENT
Topic
Name
9+4 =