I'm doing a function so that when a keyboard key is pressed, it performs another function. Use the letter keys, numbers and until Enter works. However, the ESC key does not work. Has anyone ever had to do something similar?
The following code:
document.addEventListener('keypress', function(event){
console.log(event.keyCode)
if(event.keyCode == 27) {
vm.fecha_modal();
}
})