B
B
beduin012018-12-24 13:40:20
JavaScript
beduin01, 2018-12-24 13:40:20

How to catch the F key in FireFox?

With the last of my strength, I'm trying to make cross-platform sites that work not only in Chrome. Faced with the fact that I can not find a way to catch the F key press event in FireFox. Please tell me how to do this:
The following code does not catch pressing the F-buttons.

document.addEventListener('keypress', (event) => 
{
   var key=event.key;
   console.log("key: ", key)
})

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
SOTVM, 2018-12-24
@sotvm

which code is not working?
esc is 27
keycode.info

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question