- 浏览: 1230968 次
- 性别:
- 来自: 深圳
文章分类
- 全部博客 (718)
- HTML (13)
- JS基础 (23)
- JS应用 (40)
- AJAX (6)
- JSP相关 (12)
- JAVA基础 (52)
- JAVA应用 (74)
- APPLET (11)
- SWING\RCP (2)
- JAVA反射 (6)
- 设计模式 (26)
- 数据库设计 (20)
- Struts (35)
- Struts2 (12)
- Spring (22)
- Hibernate (45)
- Ibatis (18)
- mybatis (3)
- SSH (8)
- UML (5)
- WebService (3)
- XML (16)
- Log4j (7)
- WEB容器 (26)
- 数据结构 (36)
- Linux (34)
- Ruby on Rails (1)
- 其它技术 (27)
- IDE配置 (15)
- 项目实战 (2)
- Oracle (69)
- JAVA报表 (7)
- Android学习 (2)
- 博客链接 (1)
- 网络基础 (1)
- WEB集群 (1)
- .Net开发 (11)
- PB (4)
- 系统构建 (15)
最新评论
-
jnjeC:
牛逼啊哥们,讲得太好了
Maven仓库理解、如何引入本地包、Maven多种方式打可执行jar包 -
九尾狐的yi巴:
很好 感谢!
Itext中文处理(更新版) -
luweifeng1983:
有用的,重启一下嘛。
设置eclipse外部修改文件后自动刷新 -
Master-Gao:
设置了也不管用,怎么破呢?
设置eclipse外部修改文件后自动刷新 -
aigo_h:
锋子还有时间写博客,还是很闲哈!
Add directory entries问题
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
使用
<script language="javascript">
function keyevent(){
if(event.keyCode==13)
alert("#$%#%#^^%");
}
document.onkeydown = keyevent;
</script>
event.keyCode值為37﹐38﹐39﹐40對應按下的方向鍵分別是 左﹐上﹐右﹐下
"javascript:if (event.keyCode < 45 || event.keyCode > 57) event.returnValue = false;");
if(event.keycode==13)就代表按下的是回车键盘
"javascript:if (event.keyCode > 45 && event.keyCode < 57) event.returnValue = false;");
<html>
<!--//this code by hongseheike-->
<head>
<script language="javascript">
ns4 = (document.layers) ? true : false;
ie4 = (document.all) ? true : false;
function keyDown(e){
if(ns4){
var nkey=e.which;
var iekey='现在是ns浏览器';
var realkey=String.fromCharCode(e.which);
}
if(ie4){
var iekey=event.keyCode;
var nkey='现在是ie浏览器';
var realkey=String.fromCharCode(event.keyCode);
if(event.keyCode==32){realkey='\' 空格\''}
if(event.keyCode==13){realkey='\' 回车\''}
if(event.keyCode==27){realkey='\' Esc\''}
if(event.keyCode==16){realkey='\' Shift\''}
if(event.keyCode==17){realkey='\' Ctrl\''}
if(event.keyCode==18){realkey='\' Alt\''}
}
alert('ns浏览器中键值:'+nkey+'\n'+'ie浏览器中键值:'+iekey+'\n'+'实际键为'+realkey);
}
document.onkeydown = keyDown;
if(ns4){
document.captureEvents(Event.KEYDOWN);}
</script>
</head>
<body>
//Javascript Document
<hr>
<center>
<h3>请按任意一个键。。。。</h3>
</center>
</body>
</html>
**********************************************************************
使用javascript在WEB页面中截获键盘输入
使用event对象的keyCode属性判断输入的键值
eg:if(event.keyCode==13)alert(“enter!”);
键值对应表
A 0X65 U 0X85
B 0X66 V 0X86
C 0X67 W 0X87
D 0X68 X 0X88
E 0X69 Y 0X89
F 0X70 Z 0X90
G 0X71 0 0X48
H 0X72 1 0X49
I 0X73 2 0X50
J 0X74 3 0X51
K 0X75 4 0X52
L 0X76 5 0X53
M 0X77 6 0X54
N 0X78 7 0X55
O 0X79 8 0X56
P 0X80 9 0X57
Q 0X81 ESC 0X1B
R 0X82 CTRL 0X11
S 0X83 SHIFT 0X10
T 0X84 ENTER 0XD
如果要使用组合键,则可以利用event.ctrlKey,event.shiftKey,event .altKey判断是否按下了ctrl键、shift键以及alt键
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
使用
<script language="javascript">
function keyevent(){
if(event.keyCode==13)
alert("#$%#%#^^%");
}
document.onkeydown = keyevent;
</script>
event.keyCode值為37﹐38﹐39﹐40對應按下的方向鍵分別是 左﹐上﹐右﹐下
"javascript:if (event.keyCode < 45 || event.keyCode > 57) event.returnValue = false;");
if(event.keycode==13)就代表按下的是回车键盘
"javascript:if (event.keyCode > 45 && event.keyCode < 57) event.returnValue = false;");
<html>
<!--//this code by hongseheike-->
<head>
<script language="javascript">
ns4 = (document.layers) ? true : false;
ie4 = (document.all) ? true : false;
function keyDown(e){
if(ns4){
var nkey=e.which;
var iekey='现在是ns浏览器';
var realkey=String.fromCharCode(e.which);
}
if(ie4){
var iekey=event.keyCode;
var nkey='现在是ie浏览器';
var realkey=String.fromCharCode(event.keyCode);
if(event.keyCode==32){realkey='\' 空格\''}
if(event.keyCode==13){realkey='\' 回车\''}
if(event.keyCode==27){realkey='\' Esc\''}
if(event.keyCode==16){realkey='\' Shift\''}
if(event.keyCode==17){realkey='\' Ctrl\''}
if(event.keyCode==18){realkey='\' Alt\''}
}
alert('ns浏览器中键值:'+nkey+'\n'+'ie浏览器中键值:'+iekey+'\n'+'实际键为'+realkey);
}
document.onkeydown = keyDown;
if(ns4){
document.captureEvents(Event.KEYDOWN);}
</script>
</head>
<body>
//Javascript Document
<hr>
<center>
<h3>请按任意一个键。。。。</h3>
</center>
</body>
</html>
**********************************************************************
使用javascript在WEB页面中截获键盘输入
使用event对象的keyCode属性判断输入的键值
eg:if(event.keyCode==13)alert(“enter!”);
键值对应表
A 0X65 U 0X85
B 0X66 V 0X86
C 0X67 W 0X87
D 0X68 X 0X88
E 0X69 Y 0X89
F 0X70 Z 0X90
G 0X71 0 0X48
H 0X72 1 0X49
I 0X73 2 0X50
J 0X74 3 0X51
K 0X75 4 0X52
L 0X76 5 0X53
M 0X77 6 0X54
N 0X78 7 0X55
O 0X79 8 0X56
P 0X80 9 0X57
Q 0X81 ESC 0X1B
R 0X82 CTRL 0X11
S 0X83 SHIFT 0X10
T 0X84 ENTER 0XD
如果要使用组合键,则可以利用event.ctrlKey,event.shiftKey,event .altKey判断是否按下了ctrl键、shift键以及alt键
发表评论
-
进制转换及JS进制转换
2013-07-09 15:55 1149八进制:0,1,2,3,4,5,6,7 十六进制:0,1 ... -
javascript标签的id属性
2012-12-25 23:18 1137转:http://countme.iteye.com/blog ... -
判断JS键盘事件
2010-01-21 11:12 1794<STYLE TYPE="text/css&q ... -
JAVASCRIPT基础学习篇(10)附2-URL编码转换,escape() encodeURI() encodeURIComponent()
2008-12-16 13:58 1019escape()方法: 采用ISOLatin字符集对指定的 ... -
JAVASCRIPT基础学习篇(10)附1-escape,encodeURI,encodeURIComponent函数比较
2008-12-16 13:59 940http://edu.136z.com/Web/38376.h ... -
JS基础学习篇----JS控制checkbox全选、取消全选、删除功能
2008-12-19 10:22 2059前面讨论了JS控制checkbox,及对document.al ... -
JAVASCTIPT调试工具集
2009-02-18 23:24 10821.Firefox + Venkman : http://w ... -
Javascript 学习提高JAVASCRIPT的两本好书
2009-02-19 09:42 1926另有推荐书目:javascript ... -
Javascript JavaScript判断浏览器类型及版本
2009-02-19 09:53 1599本文引自:http://www.cnblogs.com/lea ... -
JAVASCRIPT基础学习篇(1)--JAVAScript起源之:ECMAScript
2009-02-20 09:16 1683[编辑] 历史 1995年12月升阳公司与网景通讯公 ... -
JAVASCRIPT基础学习篇(2)--浏览器发展史
2009-02-20 09:45 894网景(Netscape)是一个 ... -
JAVASCRIPT基础学习篇(3)--ECMAScript Basic:constructor属性
2009-02-20 17:13 874The constructor property is a r ... -
JAVASCRIPT基础学习篇(4)--ECMAScript Basic:prototype属性及通过该属性建立面向对象的JavaScript
2009-02-20 17:45 950JAVASctipt 继承机制的实 ... -
Python
2009-02-21 02:24 2407[编辑] 发展历史 Python的创始人为Guido ... -
JAVASCRIPT基础学习篇(5)--ECMAScript Basic1(EcmaScript 基本类型)
2009-02-23 11:05 978第一章 基本类型 一、The basic concept ... -
JAVASCRIPT基础学习篇(6)--ECMAScript Basic2(EcmaScript 引用类型)
2009-02-23 15:08 871第二章 Reference Types引用类型: 可以使用 ... -
JAVASCRIPT基础学习篇(7)--ECMAScript Basic3(EcmaScript 运算符)
2009-02-24 10:03 1068第三章 运算符 1、The instanceof oper ... -
JAVASCRIPT基础学习篇(8)--ECMAScript Basic4(EcmaScript 表达式)
2009-02-27 14:47 842第四章 表达式 1、The if statement ... -
JAVASCRIPT基础学习篇(9)--ECMAScript Basic5(EcmaScript Function)
2009-02-27 16:52 865第五章 方法 1、The basic syntax ... -
JAVASCRIPT基础学习篇(10)--ECMAScript Basic6(Object Basics)
2009-03-03 09:29 892第六章 对象 The object definitio ...
相关推荐
以上就是JavaScript Keycode大全的主要内容,这些Keycode值对于编写处理键盘输入的JavaScript代码非常有用,可以帮助开发者实现各种复杂的交互功能,如游戏控制、文本编辑等。需要注意的是,由于浏览器兼容性和操作...
安装# Using npm$ npm install keycode-js --save# Using yarn$ yarn add keycode-js# Using bower$ bower install keycode-js --save用法使用require()或ES / TypeScript import语句导入包: // CommonJSconst ...
通过本文的介绍,我们不仅了解了JavaScript中`window.event.keycode`的含义,还学习了一组完整的`keycode`值及其对应按键。这对于编写与键盘相关的交互式应用程序至关重要。希望本文能够帮助读者在实际项目中更加...
### JavaScript KeyCode详解 在网页开发过程中,经常需要处理用户的键盘输入事件。JavaScript 提供了多种方式来检测用户按下的键,其中最常用的一种是通过 `keyCode` 属性。`keyCode` 是一个数值型属性,用于表示按...
### JavaScript Event.keyCode 大全解析 #### 一、概述 在JavaScript中,`event.keyCode`是用于捕获键盘事件中的键码的一种方式。虽然在现代Web开发中更推荐使用`event.key`或`event.code`来获取按键信息,但在...
在本文中,我们将详细介绍JavaScript中与键盘事件相关的keycode值及其使用方法,为了方便大家在实际开发中快速查找和使用。在JavaScript中,keycode值是对应于键盘上各个按键的数字标识,当我们使用键盘事件监听函数...
### JavaScript Keycode 大全知识点解析 #### 一、引言 在JavaScript编程中,处理用户输入时常常需要用到按键码(keycode)来识别用户按下的是哪个键。本篇内容将详细解析不同按键与对应的keyCode值之间的关系,为...
在实际应用中,`ansi-keycode`常与其他前端库如`readline-sync`或`xterm.js`结合使用,以实现更复杂的命令行模拟功能。例如,在一个基于浏览器的代码编辑器中,用户可以使用上下箭头浏览历史输入,或者用左右箭头...
总之,“WoC3.0-JS-KeyCode-Visualizer”是一个有益的学习资源,它将帮助开发者熟悉JavaScript中的键盘事件处理,理解键码的工作原理,并加深对HTML、CSS和JavaScript整体交互的理解。通过实际操作和观察,学习者...
### 键盘Keycode值与JavaScript触发事件 在前端开发中,经常需要处理用户的键盘输入事件,例如表单验证、快捷键操作等场景。在JavaScript中,可以通过监听`keydown`、`keyup`或`keypress`事件来获取用户按下的按键...
### JS下的键盘码大全 在JavaScript编程中,处理用户的键盘输入是常见的需求之一。通过键盘码(Keycode),我们可以识别用户按下的是哪个按键,并据此执行相应的逻辑操作。本篇文章将详细介绍JavaScript中的各种...
标题“keycode-finder”指的是一个工具,它的主要功能是帮助用户识别并获取键盘上各个按键对应的keycode。Keycode是计算机系统中用于识别物理按键的一种编码,它是一个整数值,对应于特定的键盘按键。在编程或者调试...
此外,`javascript-event-keycode-finder`工具可能是一个非常实用的资源,它允许开发者通过直观的界面来查找不同按键对应的键码,这对于调试和编写键盘事件处理程序来说非常方便。通过现场演示,你可以尝试各种按键...
javascript键盘事件大全,最全的键盘事件event.keycode
### JavaScript keyCode 键盘键码值表详解 在前端开发中,经常需要处理用户的键盘输入事件,例如监听用户的按键操作来实现特定的功能。在 JavaScript 中,`keyCode` 属性是处理键盘事件时的一个非常重要的概念。它...
KeyCode.js 是个跨浏览器的 JavaScript 常规键盘快捷键库。这个库围绕键盘对象来运行,还有一些 { Int code, bool shift, bool alt, bool ctrl } JavaScript 对象,记录用户按下的键盘对象。translate_event() 方法...
JavaScript是一种广泛应用于网页和网络应用开发的脚本语言,它主要负责实现客户端的交互效果和动态功能。在网页中,JavaScript通常与HTML和CSS结合使用,构建出丰富的用户体验。本资源"javascript经典特效---功能键...
没有更多的幻数\ o / 键盘事件的代码服务 少于2 kb 安装 凉亭 ... script src =" bower_components/angular-keycode/angular-keycode.min.js " > </ script > 使用 ( function ( ) { 'use