You can use e.shiftKey
to check whether the shift key was held when the event was triggered.
If you add an if
statement to your event handler, checking whether the shift key was held, you can perform different actions:
if(keyCode == 9) {
if(e.shiftKey) {
//Focus previous input
}
else {
//Focus next input
}
}