- 浏览: 179855 次
- 性别:
- 来自: 广州
文章分类
最新评论
<script language='javascript'>
document.onkeydown = function(){
//alert("按键" + event.keyCode +"---"+ event.altKey);
if(event.altKey && event.keyCode == 83){
alert("Alt+S");
} else if(event.ctrlKey && event.keyCode == 83) {
alert("Ctrl+S");
} else {
//alert(event.keyCode);
}
}
</script>
js 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 73 = i I
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 122 = F11
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 239 = eth ETH
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
document.onkeydown = function(){
//alert("按键" + event.keyCode +"---"+ event.altKey);
if(event.altKey && event.keyCode == 83){
alert("Alt+S");
} else if(event.ctrlKey && event.keyCode == 83) {
alert("Ctrl+S");
} else {
//alert(event.keyCode);
}
}
</script>
js 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 73 = i I
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 122 = F11
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 239 = eth ETH
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
发表评论
-
转:js获取各种高度
2013-07-09 19:10 1058<script type="text/jav ... -
转:json的stringify方法作用
2013-07-04 00:14 1627可使用JSON.parse(str)将其转化为json对象 ... -
Sublime Text 2快捷键~
2013-06-30 23:19 986Ctrl+L 选择整行(按住-继续选择下行) Ctrl+ ... -
jquery表单验证-自定义及常用验证(转)
2013-04-04 23:14 1370<script type="text/java ... -
EL表达式和JSTL标签(转)
2013-03-31 15:37 1407在JSP页面中,使用标签库代替传统的Java语言来实 ... -
EL表达式和JSTL标签(转)
2013-03-31 15:34 0在JSP页面中,使用标签 ... -
JS中URL编码参数(转) --- 乱码经过编码两次得以解决
2013-03-17 14:01 4336网上有很多文字作品写 ... -
jquery autocomplete示例
2013-03-15 18:30 9741使用jquery的autocomplete插件~~,目前网上有 ... -
GreyBox官网~~
2013-03-01 17:36 1029http://orangoo.com/labs/GreyBox ... -
js验证手机号码
2012-10-23 16:50 0var regex = /(^1[3-9]\d{9}$)|(^ ... -
js创建文件夹、js正则表达式验证手机号、js处理日期
2012-10-23 16:51 2183<html> <head><ti ... -
js对http传递数据进行编码、js产生唯一标识
2012-10-23 16:51 5457<html> <head> < ... -
js使用setInterval调用有参数的方法
2012-10-23 16:53 1042var intervalId; var toIvrGUID ... -
js字符串去空白、取子串以及js打开窗口
2012-10-19 11:07 3150<html> <head> < ... -
js提交表单,jquery提交注意事项
2012-10-19 11:01 1035红色字体部分:$('#dealForm')[0].reset( ... -
js自动完成
2012-10-19 10:35 1229<html><body><sty ...
相关推荐
android 后台监听按键事件方法及demoandroid 后台监听按键事件方法及demo
(1)当C#监听页面窗口,不在第一页面或者页面窗口不在最前方时,能监听到键盘的任何一个键的信息; (2)当C#监听窗口隐藏时,也可以监听到键盘信息,还可以设置快捷键: (3)C#代码写作过程中,可做键盘交互,...
所以,我们可以为页面上的某个元素(如一个输入框)添加`keyup`事件监听器,并检查每次按键事件的键码是否为13。 ```javascript $('input').keyup(function(event) { if (event.keyCode === 13) { // 回车键被按...
本篇将深入探讨如何在Android应用中实现对Back按键的监听及相应处理。 首先,Android提供了两种主要的方法来监听和处理Back按键的事件:`onKeyDown()` 和 `onBackPressed()`。 1. **onKeyDown() 方法**: - `...
总结来说,通过本文,我们可以学习到如何在JavaScript中设置事件监听器,如何处理鼠标的点击事件和键盘的按键事件,以及如何利用这些事件实现页面跳转。此外,我们还了解到了一个实用的在线资源,可以用来查询和学习...
我们在android手机上面有时候会遇到监听手机软键盘按键的时候,例如:我们在浏览器输入url完毕后可以点击软键盘右下角的“GO”按键加载url页面;在点击搜索框的时候,点击右下角的search符号键可以进行搜索;或者在...
下面我们将深入探讨如何使用`globalShortcut`来监听键盘事件并实现快捷键功能。 首先,引入`electron`模块。在Electron应用中,通常在主进程(main process)中处理快捷键的注册和监听,因为这样可以确保即使在应用...
在监听键盘事件时,通常需要阻止浏览器的默认行为,以避免在一些特定的按键组合下发生浏览器默认动作(比如按下F5刷新页面)。这可以通过调用事件对象的`preventDefault`方法实现。在非标准的浏览器中,则需要设置`e...
本压缩包"jQuery键盘按键监听提示代码.zip"包含了一个使用jQuery和jquery.hotkeys插件实现的键盘监听功能,特别适用于需要对用户键盘输入进行实时反馈或控制的应用场景。 首先,我们来了解一下jQuery的核心概念。...
JavaScript事件监听机制是前端开发中极其重要的一环,它允许开发者对用户行为(如点击、按键、鼠标移动等)作出响应。事件监听涉及的几个核心概念包括事件传播的两种方式:事件捕获和事件冒泡,以及兼容性问题和事件...
《jQuery.hotkeys插件:深入理解键盘按键监听事件代码》 在Web开发中,与用户交互是必不可少的一环,而键盘事件的监听则是提升用户体验的关键因素之一。jQuery.hotkeys插件正是为此目的而设计,它扩展了jQuery库,...
除了基本的点击事件,jQuery还支持许多其他类型的事件,比如`mouseover`(鼠标悬停)、`mouseout`(鼠标离开)、`keydown`(键盘按键按下)、`keyup`(键盘按键释放)等。对于监听DIV的变化,我们可以关注以下几种...
在React Native开发中,经常需要处理Android平台特有的操作逻辑,其中一个常见的场景就是监听Android的回退按键事件。在Android系统中,用户按下回退键时,默认的行为是返回上一个页面,如果应用处于后台,则不会...
"按键监听"是游戏控制的关键部分,它允许玩家通过键盘输入来控制游戏人物的移动和动作。 首先,我们要理解DOM(Document Object Model)在游戏开发中的角色。DOM是HTML和XML文档的结构化表示,它将网页内容转化为树...
微信开发的时候,在公众号菜单中打开一个H5页面(如:个人中心),在这个页面上的一些操作,经过多次跳转后,点击左上角的返回按钮,发现会原封不动的返回至上一级页面。 即 公众号菜单->A->B->C,点击返回后,返回了B...
在我们的项目经常需要监听一些键盘事件来触发程序的执行,而Vue中允许在监听的时候添加关键修饰符: <input v-on:keyup.13=submit> 对于一些常用键,还提供了按键别名: <input @keyup.enter=submit> ...
例如,要监听页面上所有元素的键盘按键事件,可以这样写: ```javascript $(document).on('keydown', function(event) { console.log('Keycode:', event.keyCode); }); ``` 在这个例子中,`event.keyCode`返回的...