實現Tab鍵的空格功能
阿新 • • 發佈:2017-05-24
down code use 而是 racket pause one 頁面 ear
4 keycode 13 = Enter
5 keycode 16 = Shift_L
6 keycode 17 = Control_L
7 keycode 18 = Alt_L
8 keycode 19 = Pause
9 keycode 20 = Caps_Lock
10 keycode 27 = Escape Escape
11 keycode 32 = space space
12 keycode 33 = Prior
13 keycode 34 = Next
14 keycode 35 = End
15 keycode 36 = Home
16 keycode 37 = Left
17 keycode 38 = Up
18 keycode 39 = Right
19 keycode 40 = Down
20 keycode 41 = Select
21 keycode 42 = Print
22 keycode 43 = Execute
23 keycode 45 = Insert
24 keycode 46 = Delete
25 keycode 47 = Help
26 keycode 48 = 0 equal braceright
27 keycode 49 = 1 exclam onesuperior
28 keycode 50 = 2 quotedbl twosuperior
29 keycode 51 = 3 section threesuperior
30 keycode 52 = 4 dollar
31 keycode 53 = 5 percent
32 keycode 54 = 6 ampersand
33 keycode 55 = 7 slash braceleft
34 keycode 56 = 8 parenleft bracketleft
35 keycode 57 = 9 parenright bracketright
36 keycode 65 = a A
37 keycode 66 = b B
38 keycode 67 = c C
39 keycode 68 = d D
40 keycode 69 = e E EuroSign
41 keycode 70 = f F
有時使用編輯框需要用到按Tab鍵空兩格,可能這時Tab鍵的功能不是空格而是頁面切換等,這時需要設置:
$(document).bind(‘keydown‘, function (event) {
if (event.keyCode == 9) {
return false;
}
});
event.keycode值大全 :
1 keycode 8 = BackSpace BackSpace
2 keycode 9 = Tab Tab
3 keycode 12 = Clear
4 keycode 13 = Enter
5 keycode 16 = Shift_L
6 keycode 17 = Control_L
7 keycode 18 = Alt_L
8 keycode 19 = Pause
9 keycode 20 = Caps_Lock
10 keycode 27 = Escape Escape
11 keycode 32 = space space
12 keycode 33 = Prior
13 keycode 34 = Next
14 keycode 35 = End
15 keycode 36 = Home
16 keycode 37 = Left
17 keycode 38 = Up
18 keycode 39 = Right
19 keycode 40 = Down
20 keycode 41 = Select
21 keycode 42 = Print
22 keycode 43 = Execute
23 keycode 45 = Insert
24 keycode 46 = Delete
25 keycode 47 = Help
26 keycode 48 = 0 equal braceright
27 keycode 49 = 1 exclam onesuperior
28 keycode 50 = 2 quotedbl twosuperior
29 keycode 51 = 3 section threesuperior
30 keycode 52 = 4 dollar
31 keycode 53 = 5 percent
32 keycode 54 = 6 ampersand
33 keycode 55 = 7 slash braceleft
34 keycode 56 = 8 parenleft bracketleft
35 keycode 57 = 9 parenright bracketright
36 keycode 65 = a A
37 keycode 66 = b B
38 keycode 67 = c C
39 keycode 68 = d D
40 keycode 69 = e E EuroSign
41 keycode 70 = f F
......
實現Tab鍵的空格功能