Is there an “easy” way to map a keystroke to another key when on a page?
Background:
We are using a custom javascript grid for handling keyboard entry in a web application. Normally, the [enter] key allows the user to move to the next line, and the [tab] key allows the users to move to the right. The grid handles the keystrokes, and has some rather complicated logic when one is pressed.
Our users are requesting that we map the Plus Key [+] on the numeric keypad to [tab] so that they don’t need to use two hands while keying. This seems logical (the are keying thousands of numbers in a row while holding papers with their other hand), but I can’t figure out to do it.
Well you could do something like this:
To trigger the tab functionality, i’d use
focus()called on elements which havetabindex="0"set so they fall into the natural taborder of the page and are focusable – if it is formelements they are already focusable and there is no need for the tabindex attribute.