I am trying to create a dialer widget, catch the "keydown" event and highlight the corresponding dialer number.
So, for example, by pressing "A" on the keyboard, highlight "2" in the user interface:

I managed to display the first 5 digits (2-6). Since they contain 3 letters each, I was able to map keyCode like this:
Math.floor (((KeyCode - 65) / 3) + 2).
Q: Is there a way to do this on the same line, so will PQRS and WXYZ match the solution?
javascript math web widget keydown
Shlomi schwartz
source share