Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I am working on key mapping. The problem is that when I press the TAB button down it navigates to the next input field.

TAB has key of 9 and
DOWN has key of 40

But, what is the JavaScript key code to go to the previous input field (SHIFT + TAB)?

What I want is to go to next link; what is keycode or code for the previous link?

Please help. Thanks.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
340 views
Welcome To Ask or Share your Answers For Others

1 Answer

There's no "keycode", it's a separate property on the event object, like this:

if(event.shiftKey && event.keyCode == 9) { 
  //shift was down when tab was pressed
}

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...