DEV Community

Cover image for What key did I press?

What key did I press?

patrik_masiar profile image Patrik Mäsiar ・1 min read

I was just listening podcast about keyboard event listeners and I got an idea.

I was thinking about a mini web application that tells developers, what key did they press. I do not mean character on the keyboard. I mean, what that key did. What is hidden in the keys?

If you need some information about the key values or key codes, you need to listen to them. You need to listen to the keyboard. There are keyboard listeners in Javascript you can use.

This application is listening to keyboard events and I am handling event values and setting to state. I am using Container from react-keyboard-key package. There is also an option to use hooks. In the Container, there are maintained values and they are presenting to the user.



If you liked my article, application, or project, you can support me by sharing it into the world 🌎. Thank you ♥️

Discussion (0)

Editor guide