keycode按键对照表
功能场景,鼠标在某区域内,比如多个条件的搜索框内,按下enter键让其具有,点击 【确定/搜索】按钮的功能。
在编辑的区域内,点击enter键,让其有 【保存】按钮的功能。
则可这样:
$("#searchIdDiv").keypress(function(event){
event = event || window.event;
if(event.keyCode == 13)
{
//操作。。。。。
}
});
keycode对应表。
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
42
43 keycode 71 = g G
44 keycode 72 = h H
45 keycode 73 = i I
46 keycode 74 = j J
47 keycode 75 = k K
48 keycode 76 = l L
49 keycode 77 = m M mu
50 keycode 78 = n N
51 keycode 79 = o O
52 keycode 80 = p P
53 keycode 81 = q Q at
54 keycode 82 = r R
55 keycode 83 = s S
56 keycode 84 = t T
57 keycode 85 = u U
58 keycode 86 = v V
59 keycode 87 = w W
60 keycode 88 = x X
61 keycode 89 = y Y
62 keycode 90 = z Z
63 keycode 96 = KP_0 KP_0
64 keycode 97 = KP_1 KP_1
65 keycode 98 = KP_2 KP_2
66 keycode 99 = KP_3 KP_3
67 keycode 100 = KP_4 KP_4
68 keycode 101 = KP_5 KP_5
69 keycode 102 = KP_6 KP_6
70 keycode 103 = KP_7 KP_7
71 keycode 104 = KP_8 KP_8
72 keycode 105 = KP_9 KP_9
73 keycode 106 = KP_Multiply KP_Multiply
74 keycode 107 = KP_Add KP_Add
75
76 keycode 108 = KP_Separator KP_Separator
77 keycode 109 = KP_Subtract KP_Subtract
78 keycode 110 = KP_Decimal KP_Decimal
79 keycode 111 = KP_Divide KP_Divide
80 keycode 112 = F1
81 keycode 113 = F2
82 keycode 114 = F3
83 keycode 115 = F4
84
85
86 keycode 116 = F5
87 keycode 117 = F6
88 keycode 118 = F7
89 keycode 119 = F8
90 keycode 120 = F9
91 keycode 121 = F10
92 keycode 122 = F11
93 keycode 123 = F12
94 keycode 124 = F13
95 keycode 125 = F14
96 keycode 126 = F15
97 keycode 127 = F16
98 keycode 128 = F17
99 keycode 129 = F18
100 keycode 130 = F19
101 keycode 131 = F20
102 keycode 132 = F21
103 keycode 133 = F22
104 keycode 134 = F23
105 keycode 135 = F24
106 keycode 136 = Num_Lock
107 keycode 137 = Scroll_Lock
108 keycode 187 = acute grave
109 keycode 188 = comma semicolon
110 keycode 189 = minus underscore
111 keycode 190 = period colon
112 keycode 192 = numbersign apostrophe
113 keycode 210 = plusminus hyphen macron
114 keycode 211 =
115 keycode 212 = copyright registered
116 keycode 213 = guillemotleft guillemotright
117 keycode 214 = masculine ordfeminine
118 keycode 215 = ae AE
119 keycode 216 = cent yen
120 keycode 217 = questiondown exclamdown
121 keycode 218 = onequarter onehalf threequarters
122 keycode 220 = less greater bar
123 keycode 221 = plus asterisk asciitilde
124 keycode 227 = multiply division
125
126 keycode 228 = acircumflex Acircumflex
127 keycode 229 = ecircumflex Ecircumflex
128 keycode 230 = icircumflex Icircumflex
129 keycode 231 = ocircumflex Ocircumflex
130 keycode 232 = ucircumflex Ucircumflex
131 keycode 233 = ntilde Ntilde
132 keycode 234 = yacute Yacute
133 keycode 235 = oslash Ooblique
134 keycode 236 = aring Aring
135 keycode 237 = ccedilla Ccedilla
136 keycode 238 = thorn THORN
137 keycode 239 = eth ETH
138 keycode 240 = diaeresis cedilla currency
139 keycode 241 = agrave Agrave atilde Atilde
140 keycode 242 = egrave Egrave
141 keycode 243 = igrave Igrave
142 keycode 244 = ograve Ograve otilde Otilde
143 keycode 245 = ugrave Ugrave
144 keycode 246 = adiaeresis Adiaeresis
145 keycode 247 = ediaeresis Ediaeresis
146 keycode 248 = idiaeresis Idiaeresis
147 keycode 249 = odiaeresis Odiaeresis
148 keycode 250 = udiaeresis Udiaeresis
149 keycode 251 = ssharp question backslash
150 keycode 252 = asciicircum degree
151 keycode 253 = 3 sterling
152 keycode 254 = Mode_switch
153
154 使用event对象的keyCode属性判断输入的键值
155 eg:if(event.keyCode==13)alert(“enter!”);
156 键值对应表
157 A 0X65 U 0X85
158 B 0X66 V 0X86
159 C 0X67 W 0X87
160 D 0X68 X 0X88
161 E 0X69 Y 0X89
162 F 0X70 Z 0X90
163 G 0X71 0 0X48
164 H 0X72 1 0X49
165 I 0X73 2 0X50
166 J 0X74 3 0X51
167 K 0X75 4 0X52
168 L 0X76 5 0X53
169 M 0X77 6 0X54
170 N 0X78 7 0X55
171 O 0X79 8 0X56
172 P 0X80 9 0X57
173 Q 0X81 ESC 0X1B
174 R 0X82 CTRL 0X11
175 S 0X83 SHIFT 0X10
176 T 0X84 ENTER 0XD
177
178
如果要使用组合键,则可以利用event.ctrlKey,event.shiftKey,event .altKey判断是否按下了ctrl键、shift键以及alt键
keycode按键对照表的更多相关文章
- 键盘按钮keyCode大全,keyCode列表对照表
目录 [显示] 1js获取键盘按键对应的keyCode 2字母和数字键的键码值 3数字键盘上的键的键码值和功能键键码值 4控制键键码值 js获取键盘按键对应的keyCode <!doctype ...
- keycode值对照表
转载自:https://segmentfault.com/a/1190000005828048 字母和数字键的键码值(keyCode) 按键 键码 按键 键码 按键 键码 按键 键码 A 65 J 7 ...
- jQuery键盘控制方法,以及键值(keycode)对照表
键盘控制应用范围非常广泛,比如快捷键控制页面的滚动:在填写表单时候,限制输入内容:或者是屏蔽复制.粘贴.退后等功能.这里说说用jQuery怎么来实现.个人觉得jQuery比原生态的JS好用,代码简单清 ...
- android Keycode 完全对照表
input keyevent 82 menuinput keyevent 3 homeinput keyevent 19 upinput keyevent 20 downinput keyevent ...
- 【转】keyCode对照表及JS监听组合按键
原文: http://blog.csdn.net/qq_21386275/article/details/67640576 有一些需求,html 页面上的input 框只允许输入数字, 只允许输入小 ...
- js中event.keyCode用法及keyCode对照表
HTML 用户名:<input type="text" id="UserAccount" onKeyPress="JumpByEnter(Use ...
- Keycode对照表
字母和数字键的键码值(keyCode) 按键 键码 按键 键码 按键 键码 按键 键码 A 65 J 74 S 83 1 49 B 66 K 75 T 84 2 50 C 67 L 76 U 85 3 ...
- KeCode对照表(键盘按键的获取)
KeyCode键盘对照表: http://www.cnblogs.com/furenjian/articles/2957770.html
- 键盘按键keyCode大全,js页面快捷键
字母和数字键的键码值(keyCode) 按键 键码 按键 键码 按键 键码 按键 键码 A 65 J 74 S 83 1 49 B 66 K 75 T 84 2 50 C 67 L 76 U 85 3 ...
随机推荐
- UVA 11865 Stream My Contest 组网 (朱刘算法,有向生成树,树形图)
题意: 给n个点编号为0~n-1,0号点为根,给m条边(含自环,重边),每条边有个代价,也有带宽.给定c,问代价不超过c,树形图的最小带宽的最大值能达到多少? 思路: 点数才60,而带宽范围也不大,可 ...
- Java之路
Java程序员 高级特性 反射.泛型.注释符.自动装箱和拆箱.枚举类.可变参数.可变返回类型.增强循环.静态导入 核心编程 IO.多线程.实体类.集合类.正则表达式.XML和属性文件 图形编程 AWT ...
- mysqldump备份数据库时排除某些库
说明:使用mysqldump –all-databases会导出所有库.但如果做主从,从主库dump出数据时,我们是不需要也不想要information_schema 和 mysql 库的.数据库少的 ...
- cocos2dc-x解决中文乱码
中文乱码: 方法一: 选中有中文的那个cpp,点文件另存为,在保存这里竟然有个小箭头 点之,再点编码保存 再选这个编码 这个cpp就UTF-8化了,然后中文就正常了. 但是发现:但字符串字符数为奇数时 ...
- Android fragment源码全解析
Fragment 相信基本上每个android developer都用过,但是知晓其原理 用的好的还是不多,今天就从源码的角度上来带着大家分析一下Fragment的源码,对fragment有了更深层次 ...
- 预热buffer pool
mysqldump -u root db_name table_name> /dev/null select * from ...
- [转]linux之date命令
转自:http://www.cnblogs.com/peida/archive/2012/12/13/2815687.html 在linux环境中,不管是编程还是其他维护,时间是必不可少的,也经常会用 ...
- javascript --- 面向对象 --- 封装
javascript中有原型对象和实例对象 如有疑问请参考:http://www.ruanyifeng.com/blog/2010/05/object-oriented_javascript_enca ...
- ansible定时任务模块和用户组模块使用
接上篇,还是一些基础模块的使用,这里主要介绍的是系统模块的使用. 下面例子都进行过相关的实践,从而可以直接进行使用相关的命令. 3.用户模块的使用 用户模块主要用来管理用户账号和用户的属性(对远程主机 ...
- 开扒php内核函数,第二篇 hex2bin
从上一篇我们得知怎样把ascii变成16进制显示,这篇我们是怎样把16进制变成ascii显示 我们还是从分析开始吧 先看这个函数的介绍吧 string hex2bin ( string $data ) ...