e.KeyCode详解
常见WEB安全漏洞及整改建议
2. jQuery 跨站脚本漏洞2.1 问题描述jQuery是继prototype之后又一个优秀的Javascrīpt框架。
jQuery 1.6.3之前版本中存在跨站脚本漏洞。
当使用location.hash选择元素时,通过特制的标签,远程攻击者利用该漏洞注入任意web脚本或HTML。
2.2 整改方法目前厂商已经发布了升级补丁以修复此安全问题,补丁获取:.ubuntu./usn/USN-1722-1/2.3 整改案例升级jQuery版本。
3. 跨站脚本编制3.1 问题描述:跨站脚本攻击是通过在网页中加入恶意代码,当访问者浏览网页时恶意代码会被执行或者通过给管理员发信息的方式诱使管理员浏览,从而获得管理员权限,控制整个。
攻击者利用跨站请求伪造能够轻松地强迫用户的浏览器发出非故意的HTTP请求,如诈骗性的电汇请求、修改口令和下载非法的容等请求。
风险等级:高风险围:任何存在输入/输出方法(包括GET与POST)的页面皆可能存在恶意符号输入缺陷,主要影响应用包括留言板、在线通讯信息、文章发布页面等。
3.2 整改建议:对用户输入的参数执行严格检测:1、对产生漏洞模块的传入参数进行有效性检测。
int类型的只允许0-9的整型数字;string等字符类型的只允许(1-9,a-z,A-Z)的英文字母;2、当客户端输入限定值意外的字符后,立即转向自定义的错误页,而不能使用服务器默认的错误输出方式;3、对穿入参数进行危险字符过滤,禁止('、"、+、%、&、<>、()、;、,.等)特殊字符的传入。
3.3 案例:加固例(一):/*将login.jsp中[String u =request.getParameter("u");]替换为如下容:*/String u = request.getParameter("u");u = u.replace ('<','_');u = u.replace ('>','_');u = u.replace('"','_');u = u.replace('\'','_');u = u.replace ('%','_');u = u.replace(';','_');u = u.replace('(','_');u = u.replace(')','_');u = u.replace('&','_');u = u.replace('+','_');加固例(二):/*更积极的方式是利用正则表达式只允许输入指定的字符:*//*在[String u = request.getParameter("u");]后代入以下isValidInput函数作辨别*/public boolean isValidInput(Stringstr){if(str.matches("[a-z0-9]+"))return true;else return false;}4. URL重定向钓鱼4.1 3.1问题描述:通过构建URL,攻击者可以使用户重定向到任意URL,利用这个漏洞可以诱使用户访问某个页面,挂马、密码记录、下载任意文件等,常被用来钓鱼。
JavaScript中按键事件的e.keyCode e.which e.charCode
JavaScript中按键事件的e.keyCodee.whiche.charCode1、浏览器的按键事件浏览器有3种按键事件——keydown,keypress和keyup,分别对应onkeydown、onkeypress和onkeyup3个事件句柄。
一个典型的按键会产生所有这三种事件,依次是keydown-->keypress-->keyup。
[html]view plaincopyprint?1.<input type="text"id="text">2.<script>3.document.getElementById("text").onkeypress = function() {4.console.log("keypress");5.};6.document.getElementById("text").onkeyup = function() {7.console.log("keyup");8.};9.document.getElementById("text").onkeydown = function() {10.console.log("keydown");11.};12.</script>控制台输出:keydownkeypresskeyup2、浏览器的兼容性(1)FireFox、Opera、Chrome事件对应的函数有一个隐藏的变量e,表示发生事件。
e有一个属性e.which指示哪个键被按下,给出该键的索引值(按键码)。
静态函数String.fromCharCode()可以把索引值(按键码)转化成该键对应的的字符。
eg:[html]view plaincopyprint?1.<input type="text"id="text">2.<script>3.document.getElementById("text").onkeypress = function(e) {4.alert("按键码: " + e.which + " 字符: " + String.fromCharCode(e.which));5.};6.</script>FireFox、Opera、Chrome中输入:a输出:按键码:97 字符:a(2)IEIE不需要e变量,window.event表示发生事件。
KEYCode 与ASCII charCode对照表
Keycode对照表ASCII(A merican S tandard C ode for I nformation I nterchange ,美国信息互换标准代码)是基于罗马字母表的一套电脑编码系统。
它主要用于显示现代英语和其他西欧语言。
它是现今最通用的单字节编码系统,并等同于国际标准ISO 646 。
Binary Decimal Hex 缩写名称/意义0000 0000 0 00 NUL 空字符(Null)0000 0001 1 01 SOH 标题开始0000 0010 2 02 STX 正文开始0000 0011 3 03 ETX 正文结束0000 0100 4 04 EOT 传输结束0000 0101 5 05 ENQ 请求0000 0110 6 06 ACK 收到通知0000 0111 7 07 BEL 响铃0000 1000 8 08 BS 退格0000 1001 9 09 HT 水平制表符0000 1010 10 0A LF 换行键0000 1011 11 0B VT 垂直制表符0000 1100 12 0C FF 换页键0000 1101 13 0D CR 回车键0000 1110 14 0E SO 不用切换(Shift键)0000 1111 15 0F SI 启用切换(Shift键)0001 0000 16 10 DLE 数据通讯换码0001 0001 17 11 DC1 XON Device Control 1 0001 0010 18 12 DC2 Device Control 20001 0011 19 13 DC3 XOFF Device Control 3 0001 0100 20 14 DC4 Device Control 40001 0101 21 15 NAK 拒绝接收0001 0110 22 16 SYN 同步空闲0001 0111 23 17 ETB End of Trans. Block0001 1000 24 18 CAN 取消0001 1001 25 19 EM 介质中断0001 1010 26 1A SUB Substitute0001 1011 27 1B ESC 溢出0001 1100 28 1C FS 文件分割符0001 1101 29 1D GS 分组符0001 1110 30 1E RS 记录分离符0001 1111 31 1F US 单元分隔符ASC II编码表ASCII码介绍目前计算机中用得最广泛的字符集及其编码,是由美国国家标准局(ANSI)制定的ASCII码(American Standard Code for Information Interchange,美国标准信息交换码),它已被国际标准化组织(ISO)定为国际标准,称为ISO 646标准。
JS禁用右键、禁用Ctrl+u、禁用Ctrl+s、禁用F12的实现代码
JS禁⽤右键、禁⽤Ctrl+u、禁⽤Ctrl+s、禁⽤F12的实现代码先来两个简单粗暴的第⼀个常⽤的函数代码function keycodes(){// 禁⽌右键document.oncontextmenu=function(){return false};document.onkeydown = function(e) {e = window.event || e;var k = e.keyCode;//屏蔽ctrl+u,F12键if ((e.ctrlKey == true && k == 85) || k == 123) {e.keyCode = 0;e.returnValue = false;e.cancelBubble = true;return false;}}}第⼆种⽅法:var arr = [123, 17, 18];document.oncontextmenu = new Function("event.returnValue=false;"),//禁⽤右键document.onselectstart = new Function("event.returnValue=false;"),//禁⽤选中window.onkeydown = function (e) {var code = e.keyCode;if (arr.indexOf(code) > -1) {console.log("中招了", code);e.preventDefault();}}, window.oncontextmenu = function (e) {e.preventDefault();}第三种⽅法:var arr = [123, 17, 18];document.oncontextmenu = new Function("event.returnValue=false;"),//禁⽤右键window.onkeydown = function (e) {var keyCode = e.keyCode || e.which || e.charCode;var ctrlKey = e.ctrlKey || e.metaKey;console.log(keyCode + "--" + keyCode);if (ctrlKey && keyCode == 85) {console.log("ctrl+u");e.preventDefault();}if (arr.indexOf(keyCode) > -1) {console.log("其他");e.preventDefault();}//e.preventDefault();//return false;}⼀些常⽤的代码1、实现禁⽌选中⽂字。
ebay code 解析
ebay code 解析一、背景介绍eBay是全球知名的电子商务公司,为用户提供了便捷的在线购物平台。
而eBaycode则是在这一平台上常见的一种编码方式。
本文将对eBaycode进行详细解析,帮助读者理解并正确使用这一编码。
二、eBaycode是什么?eBaycode是eBay平台上用于描述商品属性、条件和特性的一种编码系统。
它通过一系列的代码来表示商品的各个方面,如品牌、尺寸、颜色、材料等。
这种编码系统使得买家能够方便地搜索和筛选商品,并为卖家提供了一个标准化的描述方式。
2. 编码结构eBaycode由一段数字和字母组成,具有固定的格式和含义。
其中,不同的字符代表了不同的属性,通过组合这些字符可以描述出商品的各个方面。
例如,"BRD"表示品牌,"SZE"表示尺寸,"CLR"表示颜色等。
通过按照特定规则进行组合,可以准确地描述商品的各种属性。
三、如何使用eBaycode?1. 查找商品eBaycode可用于在eBay平台上快速查找所需商品。
用户只需在搜索框中输入相应的eBaycode,并进行搜索,即可筛选出与该编码相关的商品。
这使得用户能够更准确地找到符合自己需求的商品,提高了搜索效率。
2. 创建商品列表卖家可以在发布商品时使用eBaycode来描述商品的属性。
通过选择相应的编码进行填写,可以使商品的描述更加准确、简洁。
这将有助于吸引更多买家,并提高商品的曝光度和销售率。
3. 解读商品信息买家在查看商品详情时,经常会遇到一些由eBaycode编写的描述。
通过了解这些编码的含义,买家能够更准确地理解商品的属性和特征。
这有助于买家做出正确的购买决策,避免误解或遗漏关键信息。
四、常见问题与解决方法1. 编码不识别有时候,用户输入的eBaycode可能无法识别或出现错误。
这可能是由于输入错误、编码已过时或平台升级引起的。
此时,用户可以尝试检查输入的准确性,或者与eBay平台的客服人员联系,获取进一步的帮助与解决方案。
Android按键KeyCode对应表
Android按键KeyCode对应表近期碰到按键KeyCode相关的一些问题,找到一张KeyCode的对应表,做下记录,具体如下:keycode 0 =keycode 1 =keycode 2 =keycode 3 =keycode 4 =keycode 5 =keycode 6 =keycode 7 =keycode 8 = BackSpace BackSpacekeycode 9 = Tab Tabkeycode 10 =keycode 11 =keycode 12 = Clearkeycode 13 = Enterkeycode 14 =keycode 15 =keycode 16 = Shift_Lkeycode 17 = Control_Lkeycode 18 = Alt_Lkeycode 19 = Pausekeycode 20 = Caps_Lockkeycode 21 =keycode 22 =keycode 23 =keycode 24 =keycode 25 =keycode 26 =keycode 27 = Escape Escapekeycode 28 =keycode 29 =keycode 30 =keycode 31 =keycode 32 = space spacekeycode 33 = Priorkeycode 34 = Nextkeycode 35 = Endkeycode 36 = Homekeycode 37 = Leftkeycode 38 = Upkeycode 40 = Downkeycode 41 = Selectkeycode 42 = Printkeycode 43 = Executekeycode 44 =keycode 45 = Insertkeycode 46 = Deletekeycode 47 = Helpkeycode 48 = 0 equal braceright keycode 49 = 1 exclam onesuperior keycode 50 = 2 quotedbl twosuperior keycode 51 = 3 section threesuperior keycode 52 = 4 dollarkeycode 53 = 5 percentkeycode 54 = 6 ampersandkeycode 55 = 7 slash braceleft keycode 56 = 8 parenleft bracketleft keycode 57 = 9 parenright bracketright keycode 58 =keycode 59 =keycode 60 =keycode 61 =keycode 62 =keycode 63 =keycode 64 =keycode 65 = a Akeycode 66 = b Bkeycode 67 = c Ckeycode 68 = d Dkeycode 69 = e E EuroSignkeycode 70 = f Fkeycode 71 = g Gkeycode 72 = h Hkeycode 73 = i Ikeycode 74 = j Jkeycode 75 = k Kkeycode 76 = l Lkeycode 77 = m M mukeycode 78 = n Nkeycode 79 = o Okeycode 80 = p Pkeycode 81 = q Q atkeycode 82 = r Rkeycode 84 = t Tkeycode 85 = u Ukeycode 86 = v Vkeycode 87 = w Wkeycode 88 = x Xkeycode 89 = y Ykeycode 90 = z Zkeycode 91 =keycode 92 =keycode 93 =keycode 94 =keycode 95 =keycode 96 = KP_0 KP_0keycode 97 = KP_1 KP_1keycode 98 = KP_2 KP_2keycode 99 = KP_3 KP_3keycode 100 = KP_4 KP_4keycode 101 = KP_5 KP_5keycode 102 = KP_6 KP_6keycode 103 = KP_7 KP_7keycode 104 = KP_8 KP_8keycode 105 = KP_9 KP_9keycode 106 = KP_Multiply KP_Multiply keycode 107 = KP_Add KP_Addkeycode 108 = KP_Separator KP_Separator keycode 109 = KP_Subtract KP_Subtract keycode 110 = KP_Decimal KP_Decimal keycode 111 = KP_Divide KP_Divide keycode 112 = F1keycode 113 = F2keycode 114 = F3keycode 115 = F4keycode 116 = F5keycode 117 = F6keycode 118 = F7keycode 119 = F8keycode 120 = F9keycode 121 = F10keycode 122 = F11keycode 123 = F12keycode 124 = F13keycode 125 = F14keycode 126 = F15keycode 128 = F17 keycode 129 = F18 keycode 130 = F19 keycode 131 = F20 keycode 132 = F21 keycode 133 = F22 keycode 134 = F23 keycode 135 = F24 keycode 136 = Num_Lock keycode 137 = Scroll_Lock keycode 138 =keycode 139 =keycode 140 =keycode 141 =keycode 142 =keycode 143 =keycode 144 =keycode 145 =keycode 146 =keycode 147 =keycode 148 =keycode 149 =keycode 150 =keycode 151 =keycode 152 =keycode 153 =keycode 154 =keycode 155 =keycode 156 =keycode 157 =keycode 158 =keycode 159 =keycode 160 =keycode 161 =keycode 162 =keycode 163 =keycode 164 =keycode 165 =keycode 166 =keycode 167 =keycode 168 =keycode 169 =keycode 170 =keycode 171 =keycode 172 =keycode 173 =keycode 174 =keycode 175 =keycode 176 =keycode 177 =keycode 178 =keycode 179 =keycode 180 =keycode 181 =keycode 182 =keycode 183 =keycode 184 =keycode 185 =keycode 186 =keycode 187 = acute gravekeycode 188 = comma semicolonkeycode 189 = minus underscorekeycode 190 = period colonkeycode 191 =keycode 192 = numbersign apostrophe keycode 193 =keycode 194 =keycode 195 =keycode 196 =keycode 197 =keycode 198 =keycode 199 =keycode 200 =keycode 201 =keycode 202 =keycode 203 =keycode 204 =keycode 205 =keycode 206 =keycode 207 =keycode 208 =keycode 209 =keycode 210 = plusminus hyphen macron keycode 211 =keycode 212 = copyright registered keycode 213 = guillemotleft guillemotright keycode 214 = masculine ordfemininekeycode 215 = ae AEkeycode 216 = cent yenkeycode 217 = questiondown exclamdownkeycode 218 = onequarter onehalf threequarters keycode 219 =keycode 220 = less greater barkeycode 221 = plus asterisk asciitilde keycode 222 =keycode 223 =keycode 224 =keycode 225 =keycode 226 =keycode 227 = multiply divisionkeycode 228 = acircumflex Acircumflexkeycode 229 = ecircumflex Ecircumflexkeycode 230 = icircumflex Icircumflexkeycode 231 = ocircumflex Ocircumflexkeycode 232 = ucircumflex Ucircumflexkeycode 233 = ntilde Ntildekeycode 234 = yacute Yacutekeycode 235 = oslash Oobliquekeycode 236 = aring Aringkeycode 237 = ccedilla Ccedillakeycode 238 = thorn THORNkeycode 239 = eth ETHkeycode 240 = diaeresis cedilla currency keycode 241 = agrave Agrave atilde Atilde keycode 242 = egrave Egravekeycode 243 = igrave Igravekeycode 244 = ograve Ograve otilde Otilde keycode 245 = ugrave Ugravekeycode 246 = adiaeresis Adiaeresiskeycode 247 = ediaeresis Ediaeresiskeycode 248 = idiaeresis Idiaeresiskeycode 249 = odiaeresis Odiaeresiskeycode 250 = udiaeresis Udiaeresiskeycode 251 = ssharp question backslash keycode 252 = asciicircum degreekeycode 253 = 3 sterlingkeycode 254 = Mode_switch。
计算机应用基础VB程序设计第3讲键盘和鼠标操作及菜单设计
可以捕捉击键动作 例2:编写模拟打字机的过程。
Private Sub Form2_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Label1.Text = "" End Sub Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress Label1.Text = Label1.Text & e.KeyChar End Sub
KeyPress、KeyDown、KeyUp 事件
3
键盘操作_续1
KeyPress事件
当用户按下并释放一个某个字符键时触发KeyPress事件 KeyPress事件过程的格式:
Private Sub <对象名>_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyPress … End Sub
10
鼠标操作_续2_举例
例4利用鼠标随手绘图。要求当按鼠标左键拖动时随手画线, 当按右键拖动并释放画圆。程序运行的界面如图所示。
程序
Dim centerx%, centery%, d% „所绘圆的圆心坐标和半径 Dim startx%, starty% „绘制直线时每一个小线段的起始点坐标 Dim mpaint As Graphics „创建Graphics对象 Dim mp As New Pen(Color.Blue, 2) Private Sub Form7_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Me.Font = New Font("", 14, FontStyle.Bold) mpaint = Me.CreateGraphics „初始化Graphics对象mpaint为窗体 End Sub
(整理)键盘对应数字-keycode值大全
键盘对应数字-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 keyevent.keycode值大全1 keycode 8 = BackSpace BackSpace2 keycode 9 = Tab Tab3 keycode 12 = Clear4 keycode 13 = Enter5 keycode 16 = Shift_L6 keycode 17 = Control_L7 keycode 18 = Alt_L8 keycode 19 = Pause9 keycode 20 = Caps_Lock10 keycode 27 = Escape Escape11 keycode 32 = space space12 keycode 33 = Prior13 keycode 34 = Next14 keycode 35 = End15 keycode 36 = Home17 keycode 38 = Up18 keycode 39 = Right19 keycode 40 = Down20 keycode 41 = Select21 keycode 42 = Print22 keycode 43 = Execute23 keycode 45 = Insert24 keycode 46 = Delete25 keycode 47 = Help26 keycode 48 = 0 equal braceright27 keycode 49 = 1 exclam onesuperior28 keycode 50 = 2 quotedbl twosuperior29 keycode 51 = 3 section threesuperior30 keycode 52 = 4 dollar31 keycode 53 = 5 percent32 keycode 54 = 6 ampersand33 keycode 55 = 7 slash braceleft34 keycode 56 = 8 parenleft bracketleft35 keycode 57 = 9 parenright bracketright36 keycode 65 = a A37 keycode 66 = b B39 keycode 68 = d D40 keycode 69 = e E EuroSign41 keycode 70 = f F4243 keycode 71 = g G44 keycode 72 = h H45 keycode 73 = i I46 keycode 74 = j J47 keycode 75 = k K48 keycode 76 = l L49 keycode 77 = m M mu50 keycode 78 = n N51 keycode 79 = o O52 keycode 80 = p P53 keycode 81 = q Q at54 keycode 82 = r R55 keycode 83 = s S56 keycode 84 = t T57 keycode 85 = u U58 keycode 86 = v V59 keycode 87 = w W61 keycode 89 = y Y62 keycode 90 = z Z63 keycode 96 = KP_0 KP_064 keycode 97 = KP_1 KP_165 keycode 98 = KP_2 KP_266 keycode 99 = KP_3 KP_367 keycode 100 = KP_4 KP_468 keycode 101 = KP_5 KP_569 keycode 102 = KP_6 KP_670 keycode 103 = KP_7 KP_771 keycode 104 = KP_8 KP_872 keycode 105 = KP_9 KP_973 keycode 106 = KP_Multiply KP_Multiply74 keycode 107 = KP_Add KP_Add7576 keycode 108 = KP_Separator KP_Separator77 keycode 109 = KP_Subtract KP_Subtract78 keycode 110 = KP_Decimal KP_Decimal79 keycode 111 = KP_Divide KP_Divide80 keycode 112 = F181 keycode 113 = F283 keycode 115 = F4848586 keycode 116 = F587 keycode 117 = F688 keycode 118 = F789 keycode 119 = F890 keycode 120 = F991 keycode 121 = F1092 keycode 122 = F1193 keycode 123 = F1294 keycode 124 = F1395 keycode 125 = F1496 keycode 126 = F1597 keycode 127 = F1698 keycode 128 = F1799 keycode 129 = F18 100 keycode 130 = F19 101 keycode 131 = F20 102 keycode 132 = F21 103 keycode 133 = F22104 keycode 134 = F23105 keycode 135 = F24106 keycode 136 = Num_Lock107 keycode 137 = Scroll_Lock108 keycode 187 = acute grave109 keycode 188 = comma semicolon110 keycode 189 = minus underscore111 keycode 190 = period colon112 keycode 192 = numbersign apostrophe113 keycode 210 = plusminus hyphen macron114 keycode 211 =115 keycode 212 = copyright registered116 keycode 213 = guillemotleft guillemotright117 keycode 214 = masculine ordfeminine118 keycode 215 = ae AE119 keycode 216 = cent yen120 keycode 217 = questiondown exclamdown121 keycode 218 = onequarter onehalf threequarters 122 keycode 220 = less greater bar123 keycode 221 = plus asterisk asciitilde124 keycode 227 = multiply division125126 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 Ntilde132 keycode 234 = yacute Yacute133 keycode 235 = oslash Ooblique134 keycode 236 = aring Aring135 keycode 237 = ccedilla Ccedilla136 keycode 238 = thorn THORN137 keycode 239 = eth ETH138 keycode 240 = diaeresis cedilla currency 139 keycode 241 = agrave Agrave atilde Atilde 140 keycode 242 = egrave Egrave141 keycode 243 = igrave Igrave142 keycode 244 = ograve Ograve otilde Otilde 143 keycode 245 = ugrave Ugrave144 keycode 246 = adiaeresis Adiaeresis145 keycode 247 = ediaeresis Ediaeresis146 keycode 248 = idiaeresis Idiaeresis147 keycode 249 = odiaeresis Odiaeresis148 keycode 250 = udiaeresis Udiaeresis149 keycode 251 = ssharp question backslash150 keycode 252 = asciicircum degree151 keycode 253 = 3 sterling152 keycode 254 = Mode_switch153154 使用event对象的keyCode属性判断输入的键值155 eg:if(event.keyCode==13)alert(“enter!”); 156 键值对应表157 A0X65 U 0X85158 B0X66V0X86159 C0X67W0X87160 D0X68X 0X88161 E0X69Y0X89162 F0X70Z0X90163 G0X7100X48164 H0X7210X49165 I 0X7320X50166 J 0X74 3 0X51167 K0X75 4 0X52168 L0X76 5 0X53169 M0X7760X54170 N0X78 7 0X55171 O0X79 8 0X56172 P0X80 9 0X57173 Q0X81ESC0X1B174 R0X82CTRL 0X11175 S0X83SHIFT0X10176 T0X84ENTER0XD177178如果要使用组合键,则可以利用event.ctrlKey,event.shiftKey,event .altKey判断是否按下了ctrl键、shift 键以及alt键转自:经典文章网() - 详文链接:/zonghe/biancheng/65.html用VB编写键盘任意组合键(包括2、3、4键组合)在一些程序中,有一些快捷方式(如:Shift键最小化、ESC键退出、Ctrl+S存盘、Alt+x退出等等)。
ueditor百度编辑器的赋值方法
ueditor百度编辑器的赋值⽅法⽰例: /website/onlinedemo.html引⽤代码: window.UMEDITOR_HOME_URL = $CONFIG['domain'] + "/res/local/js/ueditor/"; //注意就是这⾥!window.UEDITOR_CONFIG.imageUrl = $CONFIG['domain'] + '/goodspic?type=2';window.UEDITOR_CONFIG.savePath= ['upload'];window.UEDITOR_CONFIG.imagePath = $CONFIG['domain'] + '/res/local/uploads/';UE.getEditor('addArea')UE.getEditor('areaBottom')⽰例代码var domUtils = UE.dom.domUtils;var ServerUrl = '/server/ueditor/';var options = {//图⽚上传配置区serverUrl:ServerUrl+"controller.php",imageUrl:ServerUrl+"imageUp.php" //图⽚上传提交地址,imagePath:ServerUrl //图⽚修正地址,引⽤了fixedImagePath,如有特殊需求,可⾃⾏配置//涂鸦图⽚配置区,scrawlUrl:ServerUrl+"scrawlUp.php" //涂鸦上传地址,scrawlPath:ServerUrl+"" //图⽚修正地址,同imagePath//附件上传配置区,fileUrl:ServerUrl+"fileUp.php" //附件上传提交地址,filePath:ServerUrl //附件修正地址,同imagePath,catchRemoteImageEnable: false// ,catcherUrl:ServerUrl +"getRemoteImage.php" //处理远程图⽚抓取的地址// ,catcherPath:ServerUrl //图⽚修正地址,同imagePath,imageManagerUrl:ServerUrl + "imageManager.php" //图⽚在线管理的处理地址,imageManagerPath:ServerUrl //图⽚修正地址,同imagePath,snapscreenHost: location.hostname //屏幕截图的server端⽂件所在的⽹站地址或者ip,请不要加http://,snapscreenServerUrl: ServerUrl +"imageUp.php" //屏幕截图的server端保存程序,UEditor的范例代码为“ServerUrl +"server/upload/snapImgUp.php"” ,snapscreenPath: ServerUrl,snapscreenServerPort: location.port //屏幕截图的server端端⼝,wordImageUrl:ServerUrl + "imageUp.php" //word转存提交地址,wordImagePath:ServerUrl //,getMovieUrl:ServerUrl+"getMovie.php" //视频数据获取地址,videoUrl:ServerUrl+"fileUp.php" //附件上传提交地址,videoPath:ServerUrl, //附件修正地址,同imagePathlang:/^zh/.test(nguage || navigator.browserLanguage || erLanguage) ? 'zh-cn' : 'en',langPath:UEDITOR_HOME_URL + "lang/",disabledTableInTable: false,webAppKey:"9HrmGf2ul4mlyK8ktO2Ziayd",initialFrameWidth:860,initialFrameHeight:400,focus:true,shortcutMenu:["fontfamily", "fontsize", "bold", "italic", "underline", "forecolor", "backcolor", "insertorderedlist", "insertunorderedlist"]};function setLanguage(obj) {var value = obj.value,opt = {lang:value};UE.utils.extend(opt, options, true);UE.delEditor("editor");//清空语⾔if (!UE._bak_I18N) {UE._bak_I18N = UE.I18N;}UE.I18N = {};UE.I18N[ng] = UE._bak_I18N[ ng ];UE.getEditor('editor', opt);}function isFocus(e){alert(UE.getEditor('editor').isFocus());UE.dom.domUtils.preventDefault(e)}function setblur(e){UE.getEditor('editor').blur();UE.dom.domUtils.preventDefault(e)}function insertHtml() {var value = prompt('插⼊html代码', '');UE.getEditor('editor').execCommand('insertHtml', value)}function createEditor() {enableBtn();UE.getEditor('editor', {initialFrameWidth:"100%"})}function getAllHtml() {alert(UE.getEditor('editor').getAllHtml())}function getContent() {var arr = [];arr.push("使⽤editor.getContent()⽅法可以获得编辑器的内容");arr.push("内容为:");arr.push(UE.getEditor('editor').getContent());alert(arr.join("\n"));}function getPlainTxt() {var arr = [];arr.push("使⽤editor.getPlainTxt()⽅法可以获得编辑器的带格式的纯⽂本内容");arr.push("内容为:");arr.push(UE.getEditor('editor').getPlainTxt());alert(arr.join('\n'))}function setContent(isAppendTo) {var arr = [];arr.push("使⽤editor.setContent('欢迎使⽤ueditor')⽅法可以设置编辑器的内容");UE.getEditor('editor').setContent('欢迎使⽤ueditor', isAppendTo);alert(arr.join("\n"));}function setDisabled() {UE.getEditor('editor').setDisabled('fullscreen');disableBtn("enable");}function setEnabled() {UE.getEditor('editor').setEnabled();enableBtn();}function getText() {//当你点击按钮时编辑区域已经失去了焦点,如果直接⽤getText将不会得到内容,所以要在选回来,然后取得内容 var range = UE.getEditor('editor').selection.getRange();range.select();var txt = UE.getEditor('editor').selection.getText();alert(txt)}function getContentTxt() {var arr = [];arr.push("使⽤editor.getContentTxt()⽅法可以获得编辑器的纯⽂本内容");arr.push("编辑器的纯⽂本内容为:");arr.push(UE.getEditor('editor').getContentTxt());alert(arr.join("\n"));}function hasContent() {var arr = [];arr.push("使⽤editor.hasContents()⽅法判断编辑器⾥是否有内容");arr.push("判断结果为:");arr.push(UE.getEditor('editor').hasContents());alert(arr.join("\n"));}function setFocus() {UE.getEditor('editor').focus();}function deleteEditor() {disableBtn();UE.getEditor('editor').destroy();}function disableBtn(str) {var div = document.getElementById('btns');var btns = domUtils.getElementsByTagName(div, "button");for (var i = 0, btn; btn = btns[i++];) {if (btn.id == str) {domUtils.removeAttributes(btn, ["disabled"]);} else {btn.setAttribute("disabled", "true");}}}function enableBtn() {var div = document.getElementById('btns');var btns = domUtils.getElementsByTagName(div, "button"); for (var i = 0, btn; btn = btns[i++];) {domUtils.removeAttributes(btn, ["disabled"]);}}function getLocalData () {alert(UE.getEditor('editor').execCommand( "getlocaldata" )); }function clearLocalData () {UE.getEditor('editor').execCommand( "clearlocaldata" );alert("已清空草稿箱")}window.onkeydown = function (e){if (!ue.isFocus()) {var keyCode = e.keyCode || e.which;if (keyCode == 8) {e.preventDefault();}}};。
adbshell命令模拟按键输入input使用keycode列表详解
adbshell命令模拟按键输⼊input使⽤keycode列表详解在adb shell⾥有⼀个⾮常使⽤的命令,模拟按键输⼊,这⾥⾸先不要理解为是键盘的模拟按键,下⾯命令的使⽤和键值做⼀个详解。
input命令格式adb shell input keyevent <keycode><keycode>对应的数值在android源码中定义如下/** Key code constant: Unknown key code. */public static final int KEYCODE_UNKNOWN = 0;/** Key code constant: Soft Left key.* Usually situated below the display on phones and used as a multi-function* feature key for selecting a software defined function shown on the bottom left* of the display. */public static final int KEYCODE_SOFT_LEFT = 1;/** Key code constant: Soft Right key.* Usually situated below the display on phones and used as a multi-function* feature key for selecting a software defined function shown on the bottom right* of the display. */public static final int KEYCODE_SOFT_RIGHT = 2;/** Key code constant: Home key.* This key is handled by the framework and is never delivered to applications. */public static final int KEYCODE_HOME = 3;/** Key code constant: Back key. */public static final int KEYCODE_BACK = 4;/** Key code constant: Call key. */public static final int KEYCODE_CALL = 5;/** Key code constant: End Call key. */public static final int KEYCODE_ENDCALL = 6;/** Key code constant: '0' key. */public static final int KEYCODE_0 = 7;/** Key code constant: '1' key. */public static final int KEYCODE_1 = 8;/** Key code constant: '2' key. */public static final int KEYCODE_2 = 9;/** Key code constant: '3' key. */public static final int KEYCODE_3 = 10;/** Key code constant: '4' key. */public static final int KEYCODE_4 = 11;/** Key code constant: '5' key. */public static final int KEYCODE_5 = 12;/** Key code constant: '6' key. */public static final int KEYCODE_6 = 13;/** Key code constant: '7' key. */public static final int KEYCODE_7 = 14;/** Key code constant: '8' key. */public static final int KEYCODE_8 = 15;/** Key code constant: '9' key. */public static final int KEYCODE_9 = 16;/** Key code constant: '*' key. */public static final int KEYCODE_STAR = 17;/** Key code constant: '#' key. */public static final int KEYCODE_POUND = 18;/** Key code constant: Directional Pad Up key.* May also be synthesized from trackball motions. */public static final int KEYCODE_DPAD_UP = 19;/** Key code constant: Directional Pad Down key.* May also be synthesized from trackball motions. */public static final int KEYCODE_DPAD_DOWN = 20;/** Key code constant: Directional Pad Left key.* May also be synthesized from trackball motions. */public static final int KEYCODE_DPAD_LEFT = 21;/** Key code constant: Directional Pad Right key.* May also be synthesized from trackball motions. */public static final int KEYCODE_DPAD_RIGHT = 22;/** Key code constant: Directional Pad Center key.* May also be synthesized from trackball motions. */public static final int KEYCODE_DPAD_CENTER = 23;/** Key code constant: Volume Up key.* Adjusts the speaker volume up. */public static final int KEYCODE_VOLUME_UP = 24;/** Key code constant: Volume Down key.* Adjusts the speaker volume down. */public static final int KEYCODE_VOLUME_DOWN = 25;/** Key code constant: Power key. *//** Key code constant: Clear key. */public static final int KEYCODE_CLEAR = 28; /** Key code constant: 'A' key. */public static final int KEYCODE_A = 29;/** Key code constant: 'B' key. */public static final int KEYCODE_B = 30;/** Key code constant: 'C' key. */public static final int KEYCODE_C = 31;/** Key code constant: 'D' key. */public static final int KEYCODE_D = 32;/** Key code constant: 'E' key. */public static final int KEYCODE_E = 33;/** Key code constant: 'F' key. */public static final int KEYCODE_F = 34;/** Key code constant: 'G' key. */public static final int KEYCODE_G = 35;/** Key code constant: 'H' key. */public static final int KEYCODE_H = 36;/** Key code constant: 'I' key. */public static final int KEYCODE_I = 37;/** Key code constant: 'J' key. */public static final int KEYCODE_J = 38;/** Key code constant: 'K' key. */public static final int KEYCODE_K = 39;/** Key code constant: 'L' key. */public static final int KEYCODE_L = 40;/** Key code constant: 'M' key. */public static final int KEYCODE_M = 41;/** Key code constant: 'N' key. */public static final int KEYCODE_N = 42;/** Key code constant: 'O' key. */public static final int KEYCODE_O = 43;/** Key code constant: 'P' key. */public static final int KEYCODE_P = 44;/** Key code constant: 'Q' key. */public static final int KEYCODE_Q = 45;/** Key code constant: 'R' key. */public static final int KEYCODE_R = 46;/** Key code constant: 'S' key. */public static final int KEYCODE_S = 47;/** Key code constant: 'T' key. */public static final int KEYCODE_T = 48;/** Key code constant: 'U' key. */public static final int KEYCODE_U = 49;/** Key code constant: 'V' key. */public static final int KEYCODE_V = 50;/** Key code constant: 'W' key. */public static final int KEYCODE_W = 51;/** Key code constant: 'X' key. */public static final int KEYCODE_X = 52;/** Key code constant: 'Y' key. */public static final int KEYCODE_Y = 53;/** Key code constant: 'Z' key. */public static final int KEYCODE_Z = 54;/** Key code constant: ',' key. */public static final int KEYCODE_COMMA = 55; /** Key code constant: '.' key. */public static final int KEYCODE_PERIOD = 56; /** Key code constant: Left Alt modifier key. */public static final int KEYCODE_ALT_LEFT = 57; /** Key code constant: Right Alt modifier key. */public static final int KEYCODE_ALT_RIGHT = 58; /** Key code constant: Left Shift modifier key. */ public static final int KEYCODE_SHIFT_LEFT = 59; /** Key code constant: Right Shift modifier key. */ public static final int KEYCODE_SHIFT_RIGHT = 60; /** Key code constant: Tab key. */public static final int KEYCODE_TAB = 61;/** Key code constant: Space key. */public static final int KEYCODE_SPACE = 62; /** Key code constant: Symbol modifier key.* Used to enter alternate symbols. */public static final int KEYCODE_SYM = 63;/** Key code constant: Explorer special function key.* Used to launch a browser application. */public static final int KEYCODE_EXPLORER = 64; /** Key code constant: Envelope special function key. * Used to launch a mail application. */public static final int KEYCODE_ENVELOPE = 65; /** Key code constant: Enter key. *//** Key code constant: '`' (backtick) key. */public static final int KEYCODE_GRAVE = 68;/** Key code constant: '-'. */public static final int KEYCODE_MINUS = 69;/** Key code constant: '=' key. */public static final int KEYCODE_EQUALS = 70;/** Key code constant: '[' key. */public static final int KEYCODE_LEFT_BRACKET = 71;/** Key code constant: ']' key. */public static final int KEYCODE_RIGHT_BRACKET = 72;/** Key code constant: '\' key. */public static final int KEYCODE_BACKSLASH = 73;/** Key code constant: ';' key. */public static final int KEYCODE_SEMICOLON = 74;/** Key code constant: ''' (apostrophe) key. */public static final int KEYCODE_APOSTROPHE = 75;/** Key code constant: '/' key. */public static final int KEYCODE_SLASH = 76;/** Key code constant: '@' key. */public static final int KEYCODE_AT = 77;/** Key code constant: Number modifier key.* Used to enter numeric symbols.* This key is not Num Lock; it is more like {@link #KEYCODE_ALT_LEFT} and is* interpreted as an ALT key by {@link android.text.method.MetaKeyKeyListener}. */public static final int KEYCODE_NUM = 78;/** Key code constant: Headset Hook key.* Used to hang up calls and stop media. */public static final int KEYCODE_HEADSETHOOK = 79;/** Key code constant: Camera Focus key.* Used to focus the camera. */public static final int KEYCODE_FOCUS = 80; // *Camera* focus/** Key code constant: '+' key. */public static final int KEYCODE_PLUS = 81;/** Key code constant: Menu key. */public static final int KEYCODE_MENU = 82;/** Key code constant: Notification key. */public static final int KEYCODE_NOTIFICATION = 83;/** Key code constant: Search key. */public static final int KEYCODE_SEARCH = 84;/** Key code constant: Play/Pause media key. */public static final int KEYCODE_MEDIA_PLAY_PAUSE= 85;/** Key code constant: Stop media key. */public static final int KEYCODE_MEDIA_STOP = 86;/** Key code constant: Play Next media key. */public static final int KEYCODE_MEDIA_NEXT = 87;/** Key code constant: Play Previous media key. */public static final int KEYCODE_MEDIA_PREVIOUS = 88;/** Key code constant: Rewind media key. */public static final int KEYCODE_MEDIA_REWIND = 89;/** Key code constant: Fast Forward media key. */public static final int KEYCODE_MEDIA_FAST_FORWARD = 90;/** Key code constant: Mute key.* Mutes the microphone, unlike {@link #KEYCODE_VOLUME_MUTE}. */public static final int KEYCODE_MUTE = 91;/** Key code constant: Page Up key. */public static final int KEYCODE_PAGE_UP = 92;/** Key code constant: Page Down key. */public static final int KEYCODE_PAGE_DOWN = 93;/** Key code constant: Picture Symbols modifier key.* Used to switch symbol sets (Emoji, Kao-moji). */public static final int KEYCODE_PICTSYMBOLS = 94; // switch symbol-sets (Emoji,Kao-moji) /** Key code constant: Switch Charset modifier key.* Used to switch character sets (Kanji, Katakana). */public static final int KEYCODE_SWITCH_CHARSET = 95; // switch char-sets (Kanji,Katakana) /** Key code constant: A Button key.* On a game controller, the A button should be either the button labeled A* or the first button on the bottom row of controller buttons. */public static final int KEYCODE_BUTTON_A = 96;/** Key code constant: B Button key.* On a game controller, the B button should be either the button labeled B* or the second button on the bottom row of controller buttons. */public static final int KEYCODE_BUTTON_B = 97;/** Key code constant: C Button key.* On a game controller, the C button should be either the button labeled C* or the third button on the bottom row of controller buttons. */public static final int KEYCODE_BUTTON_C = 98;/** Key code constant: X Button key.* On a game controller, the X button should be either the button labeled X* or the first button on the upper row of controller buttons. *//** Key code constant: Z Button key.* On a game controller, the Z button should be either the button labeled Z* or the third button on the upper row of controller buttons. */public static final int KEYCODE_BUTTON_Z = 101;/** Key code constant: L1 Button key.* On a game controller, the L1 button should be either the button labeled L1 (or L)* or the top left trigger button. */public static final int KEYCODE_BUTTON_L1 = 102;/** Key code constant: R1 Button key.* On a game controller, the R1 button should be either the button labeled R1 (or R)* or the top right trigger button. */public static final int KEYCODE_BUTTON_R1 = 103;/** Key code constant: L2 Button key.* On a game controller, the L2 button should be either the button labeled L2* or the bottom left trigger button. */public static final int KEYCODE_BUTTON_L2 = 104;/** Key code constant: R2 Button key.* On a game controller, the R2 button should be either the button labeled R2* or the bottom right trigger button. */public static final int KEYCODE_BUTTON_R2 = 105;/** Key code constant: Left Thumb Button key.* On a game controller, the left thumb button indicates that the left (or only)* joystick is pressed. */public static final int KEYCODE_BUTTON_THUMBL = 106;/** Key code constant: Right Thumb Button key.* On a game controller, the right thumb button indicates that the right* joystick is pressed. */public static final int KEYCODE_BUTTON_THUMBR = 107;/** Key code constant: Start Button key.* On a game controller, the button labeled Start. */public static final int KEYCODE_BUTTON_START = 108;/** Key code constant: Select Button key.* On a game controller, the button labeled Select. */public static final int KEYCODE_BUTTON_SELECT = 109;/** Key code constant: Mode Button key.* On a game controller, the button labeled Mode. */public static final int KEYCODE_BUTTON_MODE = 110;/** Key code constant: Escape key. */public static final int KEYCODE_ESCAPE = 111;/** Key code constant: Forward Delete key.* Deletes characters ahead of the insertion point, unlike {@link #KEYCODE_DEL}. */ public static final int KEYCODE_FORWARD_DEL = 112;/** Key code constant: Left Control modifier key. */public static final int KEYCODE_CTRL_LEFT = 113;/** Key code constant: Right Control modifier key. */public static final int KEYCODE_CTRL_RIGHT = 114;/** Key code constant: Caps Lock key. */public static final int KEYCODE_CAPS_LOCK = 115;/** Key code constant: Scroll Lock key. */public static final int KEYCODE_SCROLL_LOCK = 116;/** Key code constant: Left Meta modifier key. */public static final int KEYCODE_META_LEFT = 117;/** Key code constant: Right Meta modifier key. */public static final int KEYCODE_META_RIGHT = 118;/** Key code constant: Function modifier key. */public static final int KEYCODE_FUNCTION = 119;/** Key code constant: System Request / Print Screen key. */public static final int KEYCODE_SYSRQ = 120;/** Key code constant: Break / Pause key. */public static final int KEYCODE_BREAK = 121;/** Key code constant: Home Movement key.* Used for scrolling or moving the cursor around to the start of a line* or to the top of a list. */public static final int KEYCODE_MOVE_HOME = 122;/** Key code constant: End Movement key.* Used for scrolling or moving the cursor around to the end of a line* or to the bottom of a list. */public static final int KEYCODE_MOVE_END = 123;/** Key code constant: Insert key.* Toggles insert / overwrite edit mode. */public static final int KEYCODE_INSERT = 124;/** Key code constant: Forward key.* Navigates forward in the history stack. Complement of {@link #KEYCODE_BACK}. */ public static final int KEYCODE_FORWARD = 125;/** Key code constant: Play media key. */public static final int KEYCODE_MEDIA_PLAY = 126;/** Key code constant: Pause media key. */public static final int KEYCODE_MEDIA_PAUSE = 127;/** Key code constant: Close media key./** Key code constant: Record media key. */public static final int KEYCODE_MEDIA_RECORD = 130;/** Key code constant: F1 key. */public static final int KEYCODE_F1 = 131;/** Key code constant: F2 key. */public static final int KEYCODE_F2 = 132;/** Key code constant: F3 key. */public static final int KEYCODE_F3 = 133;/** Key code constant: F4 key. */public static final int KEYCODE_F4 = 134;/** Key code constant: F5 key. */public static final int KEYCODE_F5 = 135;/** Key code constant: F6 key. */public static final int KEYCODE_F6 = 136;/** Key code constant: F7 key. */public static final int KEYCODE_F7 = 137;/** Key code constant: F8 key. */public static final int KEYCODE_F8 = 138;/** Key code constant: F9 key. */public static final int KEYCODE_F9 = 139;/** Key code constant: F10 key. */public static final int KEYCODE_F10 = 140;/** Key code constant: F11 key. */public static final int KEYCODE_F11 = 141;/** Key code constant: F12 key. */public static final int KEYCODE_F12 = 142;/** Key code constant: Num Lock key.* This is the Num Lock key; it is different from {@link #KEYCODE_NUM}.* This key alters the behavior of other keys on the numeric keypad. */public static final int KEYCODE_NUM_LOCK = 143;/** Key code constant: Numeric keypad '0' key. */public static final int KEYCODE_NUMPAD_0 = 144;/** Key code constant: Numeric keypad '1' key. */public static final int KEYCODE_NUMPAD_1 = 145;/** Key code constant: Numeric keypad '2' key. */public static final int KEYCODE_NUMPAD_2 = 146;/** Key code constant: Numeric keypad '3' key. */public static final int KEYCODE_NUMPAD_3 = 147;/** Key code constant: Numeric keypad '4' key. */public static final int KEYCODE_NUMPAD_4 = 148;/** Key code constant: Numeric keypad '5' key. */public static final int KEYCODE_NUMPAD_5 = 149;/** Key code constant: Numeric keypad '6' key. */public static final int KEYCODE_NUMPAD_6 = 150;/** Key code constant: Numeric keypad '7' key. */public static final int KEYCODE_NUMPAD_7 = 151;/** Key code constant: Numeric keypad '8' key. */public static final int KEYCODE_NUMPAD_8 = 152;/** Key code constant: Numeric keypad '9' key. */public static final int KEYCODE_NUMPAD_9 = 153;/** Key code constant: Numeric keypad '/' key (for division). */public static final int KEYCODE_NUMPAD_DIVIDE = 154;/** Key code constant: Numeric keypad '*' key (for multiplication). */public static final int KEYCODE_NUMPAD_MULTIPLY = 155;/** Key code constant: Numeric keypad '-' key (for subtraction). */public static final int KEYCODE_NUMPAD_SUBTRACT = 156;/** Key code constant: Numeric keypad '+' key (for addition). */public static final int KEYCODE_NUMPAD_ADD = 157;/** Key code constant: Numeric keypad '.' key (for decimals or digit grouping). */ public static final int KEYCODE_NUMPAD_DOT = 158;/** Key code constant: Numeric keypad ',' key (for decimals or digit grouping). */ public static final int KEYCODE_NUMPAD_COMMA = 159;/** Key code constant: Numeric keypad Enter key. */public static final int KEYCODE_NUMPAD_ENTER = 160;/** Key code constant: Numeric keypad '=' key. */public static final int KEYCODE_NUMPAD_EQUALS = 161;/** Key code constant: Numeric keypad '(' key. */public static final int KEYCODE_NUMPAD_LEFT_PAREN = 162;/** Key code constant: Numeric keypad ')' key. */public static final int KEYCODE_NUMPAD_RIGHT_PAREN = 163;/** Key code constant: Volume Mute key.* Mutes the speaker, unlike {@link #KEYCODE_MUTE}.* This key should normally be implemented as a toggle such that the first press * mutes the speaker and the second press restores the original volume. */ public static final int KEYCODE_VOLUME_MUTE = 164;/** Key code constant: Info key.* Common on TV remotes to show additional information related to what is* currently being viewed. */public static final int KEYCODE_INFO = 165;/** Key code constant: Zoom in key. */public static final int KEYCODE_ZOOM_IN = 168;/** Key code constant: Zoom out key. */public static final int KEYCODE_ZOOM_OUT = 169;/** Key code constant: TV key.* On TV remotes, switches to viewing live TV. */public static final int KEYCODE_TV = 170;/** Key code constant: Window key.* On TV remotes, toggles picture-in-picture mode or other windowing functions. */ public static final int KEYCODE_WINDOW = 171;/** Key code constant: Guide key.* On TV remotes, shows a programming guide. */public static final int KEYCODE_GUIDE = 172;/** Key code constant: DVR key.* On some TV remotes, switches to a DVR mode for recorded shows. */public static final int KEYCODE_DVR = 173;/** Key code constant: Bookmark key.* On some TV remotes, bookmarks content or web pages. */public static final int KEYCODE_BOOKMARK = 174;/** Key code constant: Toggle captions key.* Switches the mode for closed-captioning text, for example during television shows. */ public static final int KEYCODE_CAPTIONS = 175;/** Key code constant: Settings key.* Starts the system settings activity. */public static final int KEYCODE_SETTINGS = 176;/** Key code constant: TV power key.* On TV remotes, toggles the power on a television screen. */public static final int KEYCODE_TV_POWER = 177;/** Key code constant: TV input key.* On TV remotes, switches the input on a television screen. */public static final int KEYCODE_TV_INPUT = 178;/** Key code constant: Set-top-box power key.* On TV remotes, toggles the power on an external Set-top-box. */public static final int KEYCODE_STB_POWER = 179;/** Key code constant: Set-top-box input key.* On TV remotes, switches the input mode on an external Set-top-box. */public static final int KEYCODE_STB_INPUT = 180;/** Key code constant: A/V Receiver power key.* On TV remotes, toggles the power on an external A/V Receiver. */public static final int KEYCODE_AVR_POWER = 181;/** Key code constant: A/V Receiver input key.* On TV remotes, switches the input mode on an external A/V Receiver. */public static final int KEYCODE_AVR_INPUT = 182;/** Key code constant: Red "programmable" key.* On TV remotes, acts as a contextual/programmable key. */public static final int KEYCODE_PROG_RED = 183;/** Key code constant: Green "programmable" key.* On TV remotes, actsas a contextual/programmable key. */public static final int KEYCODE_PROG_GREEN = 184;/** Key code constant: Yellow "programmable" key.* On TV remotes, acts as a contextual/programmable key. */public static final int KEYCODE_PROG_YELLOW = 185;/** Key code constant: Blue "programmable" key.* On TV remotes, acts as a contextual/programmable key. */public static final int KEYCODE_PROG_BLUE = 186;/** Key code constant: App switch key.* Should bring up the application switcher dialog. */public static final int KEYCODE_APP_SWITCH = 187;/** Key code constant: Generic Game Pad Button #1.*/public static final int KEYCODE_BUTTON_1 = 188;/** Key code constant: Generic Game Pad Button #2.*/public static final int KEYCODE_BUTTON_2 = 189;/** Key code constant: Generic Game Pad Button #3.*/public static final int KEYCODE_BUTTON_3 = 190;/** Key code constant: Generic Game Pad Button #4.*/public static final int KEYCODE_BUTTON_4 = 191;/** Key code constant: Generic Game Pad Button #5.*/public static final int KEYCODE_BUTTON_5 = 192;/** Key code constant: Generic Game Pad Button #6.*/public static final int KEYCODE_BUTTON_6 = 193;/** Key code constant: Generic Game Pad Button #7.*/public static final int KEYCODE_BUTTON_7 = 194;/** Key code constant: Generic Game Pad Button #8.*/public static final int KEYCODE_BUTTON_8 = 195;/** Key code constant: Generic Game Pad Button #9.*/public static final int KEYCODE_BUTTON_9 = 196;/** Key code constant: Generic Game Pad Button #10.*/public static final int KEYCODE_BUTTON_10 = 197;/** Key code constant: Generic Game Pad Button #14.*/public static final int KEYCODE_BUTTON_14 = 201;/** Key code constant: Generic Game Pad Button #15.*/public static final int KEYCODE_BUTTON_15 = 202;/** Key code constant: Generic Game Pad Button #16.*/public static final int KEYCODE_BUTTON_16 = 203;/** Key code constant: Language Switch key.* Toggles the current input language such as switching between English and Japanese on * a QWERTY keyboard. On some devices, the same function may be performed by* pressing Shift+Spacebar. */public static final int KEYCODE_LANGUAGE_SWITCH = 204;/** Key code constant: Manner Mode key.* Toggles silent or vibrate mode on and off to make the device behave more politely* in certain settings such as on a crowded train. On some devices, the key may only* operate when long-pressed. */public static final int KEYCODE_MANNER_MODE = 205;/** Key code constant: 3D Mode key.* Toggles the display between 2D and 3D mode. */public static final int KEYCODE_3D_MODE = 206;/** Key code constant: Contacts special function key.* Used to launch an address book application. */public static final int KEYCODE_CONTACTS = 207;/** Key code constant: Calendar special function key.* Used to launch a calendar application. */public static final int KEYCODE_CALENDAR = 208;/** Key code constant: Music special function key.* Used to launch a music player application. */public static final int KEYCODE_MUSIC = 209;/** Key code constant: Calculator special function key.* Used to launch a calculator application. */public static final int KEYCODE_CALCULATOR = 210;/** Key code constant: Japanese full-width / half-width key. */public static final int KEYCODE_ZENKAKU_HANKAKU = 211;/** Key code constant: Japanese alphanumeric key. */public static final int KEYCODE_EISU = 212;/** Key code constant: Japanese non-conversion key. */public static final int KEYCODE_MUHENKAN = 213;/** Key code constant: Japanese conversion key. */public static final int KEYCODE_HENKAN = 214;/** Key code constant: Japanese katakana / hiragana key. */public static final int KEYCODE_KATAKANA_HIRAGANA = 215;/** Key code constant: Japanese Yen key. */public static final int KEYCODE_YEN = 216;/** Key code constant: Japanese Ro key. */public static final int KEYCODE_RO = 217;/** Key code constant: Japanese kana key. */public static final int KEYCODE_KANA = 218;/** Key code constant: Assist key.* Launches the global assist activity. Not delivered to applications. */public static final int KEYCODE_ASSIST = 219;/** Key code constant: Brightness Down key.* Adjusts the screen brightness down. */public static final int KEYCODE_BRIGHTNESS_DOWN = 220;/** Key code constant: Brightness Up key.* Adjusts the screen brightness up. */public static final int KEYCODE_BRIGHTNESS_UP = 221;/** Key code constant: Audio Track key.* Switches the audio tracks. */public static final int KEYCODE_MEDIA_AUDIO_TRACK = 222;/** Key code constant: Sleep key.* Puts the device to sleep. Behaves somewhat like {@link #KEYCODE_POWER} but it * has no effect if the device is already asleep. */public static final int KEYCODE_SLEEP = 223;/** Key code constant: Wakeup key.* Wakes up the device. Behaves somewhat like {@link #KEYCODE_POWER} but it* has no effect if the device is already awake. */public static final int KEYCODE_WAKEUP = 224;/** Key code constant: Pairing key.* Initiates peripheral pairing mode. Useful for pairing remote control* devices or game controllers, especially if no other input mode is* available. */public static final int KEYCODE_PAIRING = 225;/** Key code constant: Media Top Menu key.* Goes to the top of media menu. */public static final int KEYCODE_MEDIA_TOP_MENU = 226;/** Key code constant: '11' key. */public static final int KEYCODE_11 = 227;/** Key code constant: '12' key. */* Displays data services like weather, sports. */public static final int KEYCODE_TV_DATA_SERVICE = 230;/** Key code constant: Voice Assist key.* Launches the global voice assist activity. Not delivered to applications. */public static final int KEYCODE_VOICE_ASSIST = 231;/** Key code constant: Radio key.* Toggles TV service / Radio service. */public static final int KEYCODE_TV_RADIO_SERVICE = 232;/** Key code constant: Teletext key.* Displays Teletext service. */public static final int KEYCODE_TV_TELETEXT = 233;/** Key code constant: Number entry key.* Initiates to enter multi-digit channel nubmber when each digit key is assigned* for selecting separate channel. Corresponds to Number Entry Mode (0x1D) of CEC * User Control Code. */public static final int KEYCODE_TV_NUMBER_ENTRY = 234;/** Key code constant: Analog Terrestrial key.* Switches to analog terrestrial broadcast service. */public static final int KEYCODE_TV_TERRESTRIAL_ANALOG = 235;/** Key code constant: Digital Terrestrial key.* Switches to digital terrestrial broadcast service. */public static final int KEYCODE_TV_TERRESTRIAL_DIGITAL = 236;/** Key code constant: Satellite key.* Switches to digital satellite broadcast service. */public static final int KEYCODE_TV_SATELLITE = 237;/** Key code constant: BS key.* Switches to BS digital satellite broadcasting service available in Japan. */public static final int KEYCODE_TV_SATELLITE_BS = 238;/** Key code constant: CS key.* Switches to CS digital satellite broadcasting service available in Japan. */public static final int KEYCODE_TV_SATELLITE_CS = 239;/** Key code constant: BS/CS key.* Toggles between BS and CS digital satellite services. */public static final int KEYCODE_TV_SATELLITE_SERVICE = 240;/** Key code constant: Toggle Network key.* Toggles selecting broacast services. */public static final int KEYCODE_TV_NETWORK = 241;/** Key code constant: Antenna/Cable key.* Toggles broadcast input source between antenna and cable. */public static final int KEYCODE_TV_ANTENNA_CABLE = 242;/** Key code constant: HDMI #1 key.* Switches to HDMI input #1. */public static final int KEYCODE_TV_INPUT_HDMI_1 = 243;/** Key code constant: HDMI #2 key.* Switches to HDMI input #2. */public static final int KEYCODE_TV_INPUT_HDMI_2 = 244;/** Key code constant: HDMI #3 key.* Switches to HDMI input #3. */public static final int KEYCODE_TV_INPUT_HDMI_3 = 245;/** Key code constant: HDMI #4 key.* Switches to HDMI input #4. */public static final int KEYCODE_TV_INPUT_HDMI_4 = 246;/** Key code constant: Composite #1 key.* Switches to composite video input #1. */public static final int KEYCODE_TV_INPUT_COMPOSITE_1 = 247;/** Key code constant: Composite #2 key.* Switches to composite video input #2. */public static final int KEYCODE_TV_INPUT_COMPOSITE_2 = 248;/** Key code constant: Component #1 key.* Switches to component video input #1. */public static final int KEYCODE_TV_INPUT_COMPONENT_1 = 249;/** Key code constant: Component #2 key.* Switches to component video input #2. */public static final int KEYCODE_TV_INPUT_COMPONENT_2 = 250;/** Key code constant: VGA #1 key.* Switches to VGA (analog RGB) input #1. */public static final int KEYCODE_TV_INPUT_VGA_1 = 251;/** Key code constant: Audio description key.* Toggles audio description off / on. */public static final int KEYCODE_TV_AUDIO_DESCRIPTION = 252;/** Key code constant: Audio description mixing volume up key.* Louden audio description volume as compared with normal audio volume. */ public static final int KEYCODE_TV_AUDIO_DESCRIPTION_MIX_UP = 253;/** Key code constant: Audio description mixing volume down key.* Lessen audio description volume as compared with normal audio volume. */ public static final int KEYCODE_TV_AUDIO_DESCRIPTION_MIX_DOWN = 254;/** Key code constant: Zoom mode key.* Changes Zoom mode (Normal, Full, Zoom, Wide-zoom, etc.) */public static final int KEYCODE_TV_ZOOM_MODE = 255;。
tinymce的callback函数用法
tinymce的callback函数用法Tinymce是一款功能强大的富文本编辑器,广泛应用于网页编辑、内容创建等领域。
在Tinymce中,回调函数是一种常用的功能,用于处理用户操作、事件触发等场景。
本文将详细介绍tinymce的callback函数用法,帮助您更好地使用Tinymce编辑器。
一、回调函数简介回调函数是一种常见的设计模式,将一个函数作为参数传递给另一个函数,并在适当的时候被调用。
在Tinymce中,回调函数通常用于以下场景:1.用户操作响应:当用户在编辑器中执行某个操作时,回调函数可以用来处理事件,如保存编辑内容、生成预览等。
2.插件集成:通过回调函数,可以将其他插件与Tinymce集成,实现功能扩展和增强。
3.自定义功能:用户可以根据自己的需求,通过回调函数实现自定义功能,如添加自定义菜单、扩展编辑器功能等。
1.注册回调函数在Tinymce中,可以通过插件或配置文件来注册回调函数。
通常在插件的初始化函数中,使用tinymce.PluginManager.add方法来注册回调函数。
例如:```javascripttinymce.PluginManager.add('myplugin',function(editor){//实现自定义功能});```2.回调函数的参数回调函数的参数包括editor对象和可选的其他参数。
editor对象代表当前的Tinymce编辑器实例,可用于获取编辑器的状态和操作信息。
其他参数根据具体需求而定,可以包括其他自定义数据。
3.实现自定义功能在回调函数中,可以根据需求实现自定义功能。
例如,可以通过调用editor 对象的特定方法来保存编辑内容、生成预览等。
此外,还可以通过访问编辑器的DOM结构,实现扩展编辑器功能、添加自定义菜单等操作。
4.事件触发在Tinymce中,可以通过绑定事件的方式来触发回调函数。
常用的事件包括:*'init':插件初始化时触发,可用于注册回调函数。
event.keyCode表
event.keyCode键值表分类:JavaScript 2009-05-12 21:18 8772人阅读评论(3) 收藏举报有时候需要获取页面的键盘值过滤,需要用到keycode如下keycode 0 =keycode 1 =keycode 2 =keycode 3 =keycode 4 =keycode 5 =keycode 6 =keycode 7 =keycode 8 = BackSpace BackSpacekeycode 9 = Tab Tabkeycode 10 =keycode 11 =keycode 12 = Clearkeycode 13 = Enterkeycode 14 =keycode 15 =keycode 16 = Shift_Lkeycode 17 = Control_Lkeycode 18 = Alt_Lkeycode 19 = Pausekeycode 20 = Caps_Lockkeycode 21 =keycode 22 =keycode 23 =keycode 24 =keycode 25 =keycode 26 =keycode 27 = Escape Escapekeycode 28 =keycode 29 =keycode 30 =keycode 31 =keycode 32 = space spacekeycode 33 = Priorkeycode 34 = Nextkeycode 35 = Endkeycode 36 = Homekeycode 37 = Leftkeycode 38 = Upkeycode 39 = Rightkeycode 40 = Downkeycode 41 = Selectkeycode 42 = Printkeycode 43 = Executekeycode 44 =keycode 45 = Insertkeycode 46 = Deletekeycode 47 = Helpkeycode 48 = 0 equal braceright keycode 49 = 1 exclam onesuperior keycode 50 = 2 quotedbl twosuperior keycode 51 = 3 section threesuperior keycode 52 = 4 dollarkeycode 53 = 5 percentkeycode 54 = 6 ampersandkeycode 55 = 7 slash braceleft keycode 56 = 8 parenleft bracketleft keycode 57 = 9 parenright bracketright keycode 58 =keycode 59 =keycode 60 =keycode 61 =keycode 62 =keycode 63 =keycode 64 =keycode 65 = a Akeycode 66 = b B keycode 67 = c C keycode 68 = d D keycode 69 = e E EuroSign keycode 70 = f Fkeycode 71 = g G keycode 72 = h H keycode 73 = i Ikeycode 74 = j Jkeycode 75 = k K keycode 76 = l Lkeycode 77 = m M mu keycode 78 = n N keycode 79 = o O keycode 80 = p P keycode 81 = q Q at keycode 82 = r Rkeycode 83 = s S keycode 84 = t Tkeycode 85 = u U keycode 86 = v V keycode 87 = w W keycode 88 = x X keycode 89 = y Y keycode 90 = z Z keycode 91 =keycode 92 =keycode 93 =keycode 94 =keycode 95 =keycode 96 = KP_0 KP_0 keycode 97 = KP_1 KP_1 keycode 98 = KP_2 KP_2 keycode 99 = KP_3 KP_3 keycode 100 = KP_4 KP_4keycode 102 = KP_6 KP_6keycode 103 = KP_7 KP_7keycode 104 = KP_8 KP_8keycode 105 = KP_9 KP_9keycode 106 = KP_Multiply KP_Multiply keycode 107 = KP_Add KP_Addkeycode 108 = KP_Separator KP_Separator keycode 109 = KP_Subtract KP_Subtract keycode 110 = KP_Decimal KP_Decimal keycode 111 = KP_Divide KP_Divide keycode 112 = F1keycode 113 = F2keycode 114 = F3keycode 115 = F4keycode 116 = F5keycode 117 = F6keycode 118 = F7keycode 119 = F8keycode 120 = F9keycode 121 = F10keycode 122 = F11keycode 123 = F12keycode 124 = F13keycode 125 = F14keycode 126 = F15keycode 127 = F16keycode 128 = F17keycode 129 = F18keycode 130 = F19keycode 131 = F20keycode 132 = F21keycode 133 = F22keycode 134 = F23keycode 135 = F24keycode 137 = Scroll_Lock keycode 138 =keycode 139 =keycode 140 =keycode 141 =keycode 142 =keycode 143 =keycode 144 =keycode 145 =keycode 146 =keycode 147 =keycode 148 =keycode 149 =keycode 150 =keycode 151 =keycode 152 =keycode 153 =keycode 154 =keycode 155 =keycode 156 =keycode 157 =keycode 158 =keycode 159 =keycode 160 =keycode 161 =keycode 162 =keycode 163 =keycode 164 =keycode 165 =keycode 166 =keycode 167 =keycode 168 =keycode 169 =keycode 170 =keycode 172 =keycode 173 =keycode 174 =keycode 175 =keycode 176 =keycode 177 =keycode 178 =keycode 179 =keycode 180 =keycode 181 =keycode 182 =keycode 183 =keycode 184 =keycode 185 =keycode 186 =keycode 187 = acute gravekeycode 188 = comma semicolon keycode 189 = minus underscore keycode 190 = period colonkeycode 191 =keycode 192 = numbersign apostrophe keycode 193 =keycode 194 =keycode 195 =keycode 196 =keycode 197 =keycode 198 =keycode 199 =keycode 200 =keycode 201 =keycode 202 =keycode 203 =keycode 204 =keycode 205 =keycode 207 =keycode 208 =keycode 209 =keycode 210 = plusminus hyphen macron keycode 211 =keycode 212 = copyright registeredkeycode 213 = guillemotleft guillemotright keycode 214 = masculine ordfemininekeycode 215 = ae AEkeycode 216 = cent yenkeycode 217 = questiondown exclamdown keycode 218 = onequarter onehalf threequarters keycode 219 =keycode 220 = less greater barkeycode 221 = plus asterisk asciitildekeycode 222 =keycode 223 =keycode 224 =keycode 225 =keycode 226 =keycode 227 = multiply divisionkeycode 228 = acircumflex Acircumflex keycode 229 = ecircumflex Ecircumflex keycode 230 = icircumflex Icircumflexkeycode 231 = ocircumflex Ocircumflex keycode 232 = ucircumflex Ucircumflex keycode 233 = ntilde Ntildekeycode 234 = yacute Yacutekeycode 235 = oslash Oobliquekeycode 236 = aring Aringkeycode 237 = ccedilla Ccedillakeycode 238 = thorn THORNkeycode 239 = eth ETHkeycode 240 = diaeresis cedilla currencykeycode 241 = agrave Agrave atilde Atilde keycode 242 = egrave Egravekeycode 243 = igrave Igravekeycode 244 = ograve Ograve otilde Otilde keycode 245 = ugrave Ugravekeycode 246 = adiaeresis Adiaeresis keycode 247 = ediaeresis Ediaeresis keycode 248 = idiaeresis Idiaeresis keycode 249 = odiaeresis Odiaeresis keycode 250 = udiaeresis Udiaeresis keycode 251 = ssharp question backslash keycode 252 = asciicircum degree keycode 253 = 3 sterlingkeycode 254 = Mode_switch。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
e.keycode详解
keycode 8 = BackSpace BackSpace keycode 9 = Tab Tab
keycode 12 = Clear
keycode 13 = Enter
keycode 16 = Shift_L
keycode 17 = Control_L
keycode 18 = Alt_L
keycode 19 = Pause
keycode 20 = Caps_Lock
keycode 27 = Escape Escape
keycode 32 = space space
keycode 33 = Prior
keycode 34 = Next
keycode 35 = End
keycode 36 = Home
keycode 37 = Left
keycode 38 = Up
keycode 39 = Right
keycode 40 = Down
keycode 41 = Select
keycode 42 = Print
keycode 43 = Execute
keycode 45 = Insert
keycode 46 = Delete
keycode 47 = Help
keycode 48 = 0 equal braceright keycode 49 = 1 exclam onesuperior keycode 50 = 2 quotedbl twosuperior keycode 51 = 3 section threesuperior keycode 52 = 4 dollar
keycode 53 = 5 percent
keycode 54 = 6 ampersand
keycode 55 = 7 slash braceleft keycode 56 = 8 parenleft bracketleft keycode 57 = 9 parenright bracketright keycode 65 = a A
keycode 66 = b B
keycode 67 = c C
keycode 68 = d D
keycode 69 = e E EuroSign
keycode 70 = f F
keycode 71 = g G
keycode 72 = h H
keycode 74 = j J
keycode 75 = k K
keycode 76 = l L
keycode 77 = m M mu
keycode 78 = n N
keycode 79 = o O
keycode 80 = p P
keycode 81 = q Q at
keycode 82 = r R
keycode 83 = s S
keycode 84 = t T
keycode 85 = u U
keycode 86 = v V
keycode 87 = w W
keycode 88 = x X
keycode 89 = y Y
keycode 90 = z Z
keycode 96 = KP_0 KP_0
keycode 97 = KP_1 KP_1
keycode 98 = KP_2 KP_2
keycode 99 = KP_3 KP_3
keycode 100 = KP_4 KP_4
keycode 101 = KP_5 KP_5
keycode 102 = KP_6 KP_6
keycode 103 = KP_7 KP_7
keycode 104 = KP_8 KP_8
keycode 105 = KP_9 KP_9
keycode 106 = KP_Multiply KP_Multiply keycode 107 = KP_Add KP_Add
keycode 108 = KP_Separator KP_Separator keycode 109 = KP_Subtract KP_Subtract keycode 110 = KP_Decimal KP_Decimal keycode 111 = KP_Divide KP_Divide keycode 112 = F1
keycode 113 = F2
keycode 114 = F3
keycode 115 = F4
keycode 116 = F5
keycode 117 = F6
keycode 118 = F7
keycode 119 = F8
keycode 120 = F9
keycode 121 = F10
keycode 123 = F12
keycode 124 = F13
keycode 125 = F14
keycode 126 = F15
keycode 127 = F16
keycode 128 = F17
keycode 129 = F18
keycode 130 = F19
keycode 131 = F20
keycode 132 = F21
keycode 133 = F22
keycode 134 = F23
keycode 135 = F24
keycode 136 = Num_Lock
keycode 137 = Scroll_Lock
keycode 187 = acute grave
keycode 188 = comma semicolon
keycode 189 = minus underscore
keycode 190 = period colon
keycode 192 = numbersign apostrophe keycode 210 = plusminus hyphen macron keycode 211 =
keycode 212 = copyright registered
keycode 213 = guillemotleft guillemotright keycode 214 = masculine ordfeminine
keycode 215 = ae AE
keycode 216 = cent yen
keycode 217 = questiondown exclamdown keycode 218 = onequarter onehalf threequarters keycode 220 = less greater bar
keycode 221 = plus asterisk asciitilde
keycode 227 = multiply division
keycode 228 = acircumflex Acircumflex keycode 229 = ecircumflex Ecircumflex keycode 230 = icircumflex Icircumflex
keycode 231 = ocircumflex Ocircumflex keycode 232 = ucircumflex Ucircumflex keycode 233 = ntilde Ntilde
keycode 234 = yacute Yacute
keycode 235 = oslash Ooblique
keycode 236 = aring Aring
keycode 237 = ccedilla Ccedilla
keycode 238 = thorn THORN
keycode 240 = diaeresis cedilla currency keycode 241 = agrave Agrave atilde Atilde keycode 242 = egrave Egrave
keycode 243 = igrave Igrave
keycode 244 = ograve Ograve otilde Otilde keycode 245 = ugrave Ugrave
keycode 246 = adiaeresis Adiaeresis keycode 247 = ediaeresis Ediaeresis keycode 248 = idiaeresis Idiaeresis keycode 249 = odiaeresis Odiaeresis keycode 250 = udiaeresis Udiaeresis keycode 251 = ssharp question backslash keycode 252 = asciicircum degree keycode 253 = 3 sterling
keycode 254 = Mode_switch
使用
<script language="javascript">
function keyevent(){
if(event.keyCode==13)
alert("#$%#%#^^%");
}
document.onkeydown = keyevent;
</script>。