精华内容
下载资源
问答
  • 键盘输入组合键的时候 。 比如说 先按下ctrl 再按 5 可不可以得到ctrl+5的码值 。然后按6 得到ctrl+6的码值.如果只按6,就只得到6的码值,就像下面自己写的例子, $(document).bind("keypress",keypressHandler)...
  • keyCode对照表及JS监听组合按键

    万次阅读 2017-03-28 19:21:51
    keyCode对照表 字母和数字的键码值(keyCode) 按键 数字键盘上的的键码值 功能的键码值 控制的键码值 多媒体的键码值 onkeyup的缺陷处理 JS监听组合按键 拓展 shortcuts

    keyCode对照表

    1、 字母和数字键的键码值(keyCode)

    按键键码按键键码按键键码按键键码
    A65J74S83149
    B66K75T84250
    C67L76U85351
    D68M77V86452
    E69N78W87553
    F70O79X88654
    G71P80Y89755
    H72Q81Z89856
    I73R82048957

    2、数字键盘上的键的键码值

    按键键码按键键码
    0968104
    1979105
    298*106
    399+107
    4100Enter108
    5101-109
    6102.110
    7103/111

    3、功能键的键码值

    按键键码按键键码
    F1112F7118
    F2113F8119
    F3114F9120
    F4115F10121
    F5116F11122
    F6117F12123

    4.、控制键的键码值(keyCode)

    按键键码按键键码按键键码按键键码
    BackSpace8Esc27Right Arrow39-_189
    Tab9Spacebar32Down Arrow40.>190
    Clear12Page Up33Insert45/?191
    Enter13Page Down34Delete46`~192
    Shift16End35Num Lock144[{219
    Control17Home36;:186/|220
    Alt18Left Arrow37=+187]}221
    Cape Lock20Up Arrow38,<188'"222

    5、多媒体键的键码值(keyCode)

    按键键码
    音量加175
    音量减174
    停止179
    静音193
    浏览器172
    邮件180
    搜索170
    收藏171

    onkeyup的缺陷处理

    场景说明:在html的input框中限制指定内容输入,例如只允许输入数字(其他情况都是正则表达式变化)。方法很多,以如下代码为例:

    <!DOCTYPE>
    <html>
    <head>
        <meta charset="UTF-8">
    </head>
    <body>
    <input type="text" onkeyup='this.value=this.value.replace(/[^\w_]/g,"");'/>
    </body>
    

    代码缺陷:上边代码中,input框只能输入数字(本文想阐述的不是这个),但是该方法有个缺陷,当用户输入数字后想修改时,键盘的←键无法使光标向左移动,即便鼠标点击,使光标到指定位置,在按下键盘任意键修改时,光标还是会跑到最右端。
    解决方案及原理:onkeyup中代码是键盘每一次按下放开之后将input框中的value按照正则处理,不符合正则的替换成“”,也就是去掉,具体可以查看js的replace函数。那么上述代码缺陷就可以从keyCode入手。代码如下

    <!DOCTYPE>
    <html>
    <head>
        <meta charset="UTF-8">
    </head>
    <body>
    <input type="text"  onkeyup='if(event.keyCode!=8 && event.keyCode!=37 && event.keyCode!=16 && event.keyCode!=20 && event.keyCode!=39 && (event.keyCode<48 || event.keyCode>105) && (!event.shiftKey && event.keyCode != 189))this.value=this.value.replace(/[^\w_]/g,"");'/>
    </body>
    

    代码说明:上边event.keyCode后边的数字代表的是键盘对应的按键,可以查看上边的keyCode对照表。上边代码中是按下键盘上数字按键,Backspace按键,←,→按键时,不作正则处理,从而避免了第一段代码的问题。

    JS监听组合按键

    组合按键一般分以下两种:
    两位组合建,如:ctrl(cmd)+ 其他按键,alt+其他按键,shift+其他按键
    三位组合键,如:ctrl(cmd)+ shift + 其他按键,Ctrl(cmd)+ alt + 其他按键
    在组合键中,js的event中有以下几种属性:ctrlKey(metaKey)、altKey、shiftKey
    以下以按下Shift+1组合键为例(其他的类似):

    <!DOCTYPE>
    <html>
    <head>
        <meta charset="UTF-8">
    </head>
    <body>
    <input type="text" onkeyup="test()"/>
    </body>
    <script>
    function test(){
    	if(event.shiftKey && event.keyCode == 49){
    		alert(1);
    	}
    }
    </script>
    
    

    代码说明:执行上述代码后,按下组合键Shift+1在input框中输出!同时,会alert出1。但是个人在测试过程中有个疑问,就是组合键的Shift+其他按键,js如何区分中英文的。

    拓展 shortcuts

    shortcuts.js可以在网页中增加组合按键,使组合按键更丰富。
    具体使用方法,及更多信息,可以在下面下载链接中下载之后,尝试下。
    点我,shortcuts.js下载地址

    展开全文
  • 键盘keyCode

    2017-11-20 11:41:58
    js 里面的键盘事件对应的键码 先贴mdn https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/keyCode 下来是网友收集 ...keyCode 8 = BackSpace BackSpace ke

    js 里面的键盘事件对应的键码

    先贴mdn

    https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/keyCode


    下来是网友收集



    js 里面的键盘事件经常用到,所以收集了键盘事件对应的键码来分享下:
    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
    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
    使用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
    如果要使用组合键,则可以判断是否同时按下了这几个键,比如ctrl键、shift键以及alt键的组合使用就可以判断是否多按下了ctrl键、shift键以及alt键

     

    <script type="text/javascript" language=JavaScript charset="UTF-8">
    document.οnkeydοwn=function(event){
    var e = event || window.event || arguments.callee.caller.arguments[0];
    if(e && e.keyCode==27){ // 按 Esc 
    //要做的事情
    }
    if(e && e.keyCode==113){ // 按 F2 
    //要做的事情

    if(e && e.keyCode==13){ // enter 键
    //要做的事情
    }
    }; 
    </script>
    只要你定义了这些键的动作,你在浏览器里按下这些键就会响应,兼容目前所有浏览器。

    欢迎大家指正










    js 里面的键盘事件经常用到,所以收集了键盘事件对应的键码来分享下:
    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
    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
    使用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
    如果要使用组合键,则可以判断是否同时按下了这几个键,比如ctrl键、shift键以及alt键的组合使用就可以判断是否多按下了ctrl键、shift键以及alt键

     

    <script type="text/javascript" language=JavaScript charset="UTF-8">
    document.οnkeydοwn=function(event){
    var e = event || window.event || arguments.callee.caller.arguments[0];
    if(e && e.keyCode==27){ // 按 Esc 
    //要做的事情
    }
    if(e && e.keyCode==113){ // 按 F2 
    //要做的事情

    if(e && e.keyCode==13){ // enter 键
    //要做的事情
    }
    }; 
    </script>
    只要你定义了这些键的动作,你在浏览器里按下这些键就会响应,兼容目前所有浏览器。

    欢迎大家指正
    展开全文
  • adb模拟按键keycode

    2019-10-23 16:03:59
    KEYCODE列表 电话   KEYCODE_CALL 拨号 5 KEYCODE_ENDCALL 挂机 6 KEYCODE_HOME 按键Home 3 KEYCODE_MENU 菜单 82 KEYCODE_BACK 返回 4 KEYCODE_SEARCH 搜索 84 KEYCODE_...


    KEYCODE列表

    电话键


     
    KEYCODE_CALL 拨号键 5
    KEYCODE_ENDCALL 挂机键 6
    KEYCODE_HOME 按键Home 3
    KEYCODE_MENU 菜单 82
    KEYCODE_BACK 返回键 4
    KEYCODE_SEARCH 搜索 84
    KEYCODE_CAMERA 拍照键 27
    KEYCODE_FOCUS 拍照对焦键 80
    KEYCODE_POWER 电源键 26
    KEYCODE_NOTIFICATION 通知键 83
    KEYCODE_MUTE 话筒静音键 91
    KEYCODE_VOLUME_MUTE 扬声器静音键 164
    KEYCODE_VOLUME_UP 音量增加键 24
    KEYCODE_VOLUME_DOWN 音量减小键 25


     

    控制键


     
    KEYCODE_ENTER 回车键 66
    KEYCODE_ESCAPE ESC键 111
    KEYCODE_DPAD_CENTER 导航键 确定键 23
    KEYCODE_DPAD_UP 导航键 向上 19
    KEYCODE_DPAD_DOWN 导航键 向下 20
    KEYCODE_DPAD_LEFT 导航键 向左 21
    KEYCODE_DPAD_RIGHT 导航键 向右 22
    KEYCODE_MOVE_HOME 光标移动到开始键 122
    KEYCODE_MOVE_END 光标移动到末尾键 123
    KEYCODE_PAGE_UP 向上翻页键 92
    KEYCODE_PAGE_DOWN 向下翻页键 93
    KEYCODE_DEL 退格键 67
    KEYCODE_FORWARD_DEL 删除键 112
    KEYCODE_INSERT 插入键 124
    KEYCODE_TAB Tab键 61
    KEYCODE_NUM_LOCK 小键盘锁 143
    KEYCODE_CAPS_LOCK 大写锁定键 115
    KEYCODE_BREAK Break/Pause键 121
    KEYCODE_SCROLL_LOCK 滚动锁定键 116
    KEYCODE_ZOOM_IN 放大键 168
    KEYCODE_ZOOM_OUT 缩小键 169


     

    组合键


     
    KEYCODE_ALT_LEFT Alt+Left
    KEYCODE_ALT_RIGHT Alt+Right
    KEYCODE_CTRL_LEFT Control+Left
    KEYCODE_CTRL_RIGHT Control+Right
    KEYCODE_SHIFT_LEFT Shift+Left
    KEYCODE_SHIFT_RIGHT Shift+Right


     

    基本

     
    KEYCODE_0 按键'0' 7
    KEYCODE_1 按键'1' 8
    KEYCODE_2 按键'2' 9
    KEYCODE_3 按键'3' 10
    KEYCODE_4 按键'4' 11
    KEYCODE_5 按键'5' 12
    KEYCODE_6 按键'6' 13
    KEYCODE_7 按键'7' 14
    KEYCODE_8 按键'8' 15
    KEYCODE_9 按键'9' 16
    KEYCODE_A 按键'A' 29
    KEYCODE_B 按键'B' 30
    KEYCODE_C 按键'C' 31
    KEYCODE_D 按键'D' 32
    KEYCODE_E 按键'E' 33
    KEYCODE_F 按键'F' 34
    KEYCODE_G 按键'G' 35
    KEYCODE_H 按键'H' 36
    KEYCODE_I 按键'I' 37
    KEYCODE_J 按键'J' 38
    KEYCODE_K 按键'K' 39
    KEYCODE_L 按键'L' 40
    KEYCODE_M 按键'M' 41
    KEYCODE_N 按键'N' 42
    KEYCODE_O 按键'O' 43
    KEYCODE_P 按键'P' 44
    KEYCODE_Q 按键'Q' 45
    KEYCODE_R 按键'R' 46
    KEYCODE_S 按键'S' 47
    KEYCODE_T 按键'T' 48
    KEYCODE_U 按键'U' 49
    KEYCODE_V 按键'V' 50
    KEYCODE_W 按键'W' 51
    KEYCODE_X 按键'X' 52
    KEYCODE_Y 按键'Y' 53
    KEYCODE_Z 按键'Z' 54


     

    符号


     
    KEYCODE_PLUS 按键'+'
    KEYCODE_MINUS 按键'-'
    KEYCODE_STAR 按键'*'
    KEYCODE_SLASH 按键'/'
    KEYCODE_EQUALS 按键'='
    KEYCODE_AT 按键'@'
    KEYCODE_POUND 按键'#'
    KEYCODE_APOSTROPHE 按键''' (单引号)
    KEYCODE_BACKSLASH 按键'\'
    KEYCODE_COMMA 按键','
    KEYCODE_PERIOD 按键'.'
    KEYCODE_LEFT_BRACKET 按键'['
    KEYCODE_RIGHT_BRACKET 按键']'
    KEYCODE_SEMICOLON 按键';'
    KEYCODE_GRAVE 按键'`'
    KEYCODE_SPACE 空格键


     

    小键盘


     
    KEYCODE_NUMPAD_0 小键盘按键'0'
    KEYCODE_NUMPAD_1 小键盘按键'1'
    KEYCODE_NUMPAD_2 小键盘按键'2'
    KEYCODE_NUMPAD_3 小键盘按键'3'
    KEYCODE_NUMPAD_4 小键盘按键'4'
    KEYCODE_NUMPAD_5 小键盘按键'5'
    KEYCODE_NUMPAD_6 小键盘按键'6'
    KEYCODE_NUMPAD_7 小键盘按键'7'
    KEYCODE_NUMPAD_8 小键盘按键'8'
    KEYCODE_NUMPAD_9 小键盘按键'9'
    KEYCODE_NUMPAD_ADD 小键盘按键'+'
    KEYCODE_NUMPAD_SUBTRACT 小键盘按键'-'
    KEYCODE_NUMPAD_MULTIPLY 小键盘按键'*'
    KEYCODE_NUMPAD_DIVIDE 小键盘按键'/'
    KEYCODE_NUMPAD_EQUALS 小键盘按键'='
    KEYCODE_NUMPAD_COMMA 小键盘按键','
    KEYCODE_NUMPAD_DOT 小键盘按键'.'
    KEYCODE_NUMPAD_LEFT_PAREN 小键盘按键'('
    KEYCODE_NUMPAD_RIGHT_PAREN 小键盘按键')'
    KEYCODE_NUMPAD_ENTER 小键盘按键回车


     

    功能键


     
    KEYCODE_F1 按键F1
    KEYCODE_F2 按键F2
    KEYCODE_F3 按键F3
    KEYCODE_F4 按键F4
    KEYCODE_F5 按键F5
    KEYCODE_F6 按键F6
    KEYCODE_F7 按键F7
    KEYCODE_F8 按键F8
    KEYCODE_F9 按键F9
    KEYCODE_F10 按键F10
    KEYCODE_F11 按键F11
    KEYCODE_F12 按键F12


     

    多媒体键


     
    KEYCODE_MEDIA_PLAY 多媒体键 播放
    KEYCODE_MEDIA_STOP 多媒体键 停止
    KEYCODE_MEDIA_PAUSE 多媒体键 暂停
    KEYCODE_MEDIA_PLAY_PAUSE 多媒体键 播放/暂停
    KEYCODE_MEDIA_FAST_FORWARD 多媒体键 快进
    KEYCODE_MEDIA_REWIND 多媒体键 快退
    KEYCODE_MEDIA_NEXT 多媒体键 下一首
    KEYCODE_MEDIA_PREVIOUS 多媒体键 上一首
    KEYCODE_MEDIA_CLOSE 多媒体键 关闭
    KEYCODE_MEDIA_EJECT 多媒体键 弹出
    KEYCODE_MEDIA_RECORD 多媒体键 录音


     

    手柄按键


     
    KEYCODE_BUTTON_1 通用游戏手柄按钮#1
    KEYCODE_BUTTON_2 通用游戏手柄按钮 #2
    KEYCODE_BUTTON_3 通用游戏手柄按钮 #3
    KEYCODE_BUTTON_4 通用游戏手柄按钮 #4
    KEYCODE_BUTTON_5 通用游戏手柄按钮 #5
    KEYCODE_BUTTON_6 通用游戏手柄按钮 #6
    KEYCODE_BUTTON_7 通用游戏手柄按钮 #7
    KEYCODE_BUTTON_8 通用游戏手柄按钮 #8
    KEYCODE_BUTTON_9 通用游戏手柄按钮 #9
    KEYCODE_BUTTON_10 通用游戏手柄按钮 #10
    KEYCODE_BUTTON_11 通用游戏手柄按钮 #11
    KEYCODE_BUTTON_12 通用游戏手柄按钮 #12
    KEYCODE_BUTTON_13 通用游戏手柄按钮 #13
    KEYCODE_BUTTON_14 通用游戏手柄按钮 #14
    KEYCODE_BUTTON_15 通用游戏手柄按钮 #15
    KEYCODE_BUTTON_16 通用游戏手柄按钮 #16
    KEYCODE_BUTTON_A 游戏手柄按钮 A
    KEYCODE_BUTTON_B 游戏手柄按钮 B
    KEYCODE_BUTTON_C 游戏手柄按钮 C
    KEYCODE_BUTTON_X 游戏手柄按钮 X
    KEYCODE_BUTTON_Y 游戏手柄按钮 Y
    KEYCODE_BUTTON_Z 游戏手柄按钮 Z
    KEYCODE_BUTTON_L1 游戏手柄按钮 L1
    KEYCODE_BUTTON_L2 游戏手柄按钮 L2
    KEYCODE_BUTTON_R1 游戏手柄按钮 R1
    KEYCODE_BUTTON_R2 游戏手柄按钮 R2
    KEYCODE_BUTTON_MODE 游戏手柄按钮 Mode
    KEYCODE_BUTTON_SELECT 游戏手柄按钮 Select
    KEYCODE_BUTTON_START 游戏手柄按钮 Start
    KEYCODE_BUTTON_THUMBL Left Thumb Button
    KEYCODE_BUTTON_THUMBR Right Thumb Button


     

    待查

     


     

    KEYCODE_NUM

    按键Number modifier

    KEYCODE_INFO

    按键Info

    KEYCODE_APP_SWITCH

    按键App switch

    KEYCODE_BOOKMARK

    按键Bookmark

    KEYCODE_AVR_INPUT

    按键A/V Receiver input

    KEYCODE_AVR_POWER

    按键A/V Receiver power

    KEYCODE_CAPTIONS

    按键Toggle captions

    KEYCODE_CHANNEL_DOWN

    按键Channel down

    KEYCODE_CHANNEL_UP

    按键Channel up

    KEYCODE_CLEAR

    按键Clear

    KEYCODE_DVR

    按键DVR

    KEYCODE_ENVELOPE

    按键Envelope special function

    KEYCODE_EXPLORER

    按键Explorer special function

    KEYCODE_FORWARD

    按键Forward

    KEYCODE_FORWARD_DEL

    按键Forward Delete

    KEYCODE_FUNCTION

    按键Function modifier

    KEYCODE_GUIDE

    按键Guide

    KEYCODE_HEADSETHOOK

    按键Headset Hook

    KEYCODE_META_LEFT

    按键Left Meta modifier

    KEYCODE_META_RIGHT

    按键Right Meta modifier

    KEYCODE_PICTSYMBOLS

    按键Picture Symbols modifier

    KEYCODE_PROG_BLUE

    按键Blue “programmable”

    KEYCODE_PROG_GREEN

    按键Green “programmable”

    KEYCODE_PROG_RED

    按键Red “programmable”

    KEYCODE_PROG_YELLOW

    按键Yellow “programmable”

    KEYCODE_SETTINGS

    按键Settings

    KEYCODE_SOFT_LEFT

    按键Soft Left

    KEYCODE_SOFT_RIGHT

    按键Soft Right

    KEYCODE_STB_INPUT

    按键Set-top-box input

    KEYCODE_STB_POWER

    按键Set-top-box power

    KEYCODE_SWITCH_CHARSET

    按键Switch Charset modifier

    KEYCODE_SYM

    按键Symbol modifier

    KEYCODE_SYSRQ

    按键System Request / Print Screen

    KEYCODE_TV

    按键TV

    KEYCODE_TV_INPUT

    按键TV input

    KEYCODE_TV_POWER

    按键TV power

    KEYCODE_WINDOW

    按键Window

    KEYCODE_UNKNOWN

    未知按键



    每个数字与keycode对应表如下:
    0 -->  "KEYCODE_UNKNOWN"
    1 -->  "KEYCODE_MENU"
    2 -->  "KEYCODE_SOFT_RIGHT"
    3 -->  "KEYCODE_HOME"
    4 -->  "KEYCODE_BACK"
    5 -->  "KEYCODE_CALL"
    6 -->  "KEYCODE_ENDCALL"
    7 -->  "KEYCODE_0"
    8 -->  "KEYCODE_1"
    9 -->  "KEYCODE_2"
    10 -->  "KEYCODE_3"
    11 -->  "KEYCODE_4"
    12 -->  "KEYCODE_5"
    13 -->  "KEYCODE_6"
    14 -->  "KEYCODE_7"
    15 -->  "KEYCODE_8"
    16 -->  "KEYCODE_9"
    17 -->  "KEYCODE_STAR"
    18 -->  "KEYCODE_POUND"
    19 -->  "KEYCODE_DPAD_UP"
    20 -->  "KEYCODE_DPAD_DOWN"
    21 -->  "KEYCODE_DPAD_LEFT"
    22 -->  "KEYCODE_DPAD_RIGHT"
    23 -->  "KEYCODE_DPAD_CENTER"
    24 -->  "KEYCODE_VOLUME_UP"
    25 -->  "KEYCODE_VOLUME_DOWN"
    26 -->  "KEYCODE_POWER"
    27 -->  "KEYCODE_CAMERA"
    28 -->  "KEYCODE_CLEAR"
    29 -->  "KEYCODE_A"
    30 -->  "KEYCODE_B"
    31 -->  "KEYCODE_C"
    32 -->  "KEYCODE_D"
    33 -->  "KEYCODE_E"
    34 -->  "KEYCODE_F"
    35 -->  "KEYCODE_G"
    36 -->  "KEYCODE_H"
    37 -->  "KEYCODE_I"
    38 -->  "KEYCODE_J"
    39 -->  "KEYCODE_K"
    40 -->  "KEYCODE_L"
    41 -->  "KEYCODE_M"
    42 -->  "KEYCODE_N"
    43 -->  "KEYCODE_O"
    44 -->  "KEYCODE_P"
    45 -->  "KEYCODE_Q"
    46 -->  "KEYCODE_R"
    47 -->  "KEYCODE_S"
    48 -->  "KEYCODE_T"
    49 -->  "KEYCODE_U"
    50 -->  "KEYCODE_V"
    51 -->  "KEYCODE_W"
    52 -->  "KEYCODE_X"
    53 -->  "KEYCODE_Y"
    54 -->  "KEYCODE_Z"
    55 -->  "KEYCODE_COMMA"
    56 -->  "KEYCODE_PERIOD"
    57 -->  "KEYCODE_ALT_LEFT"
    58 -->  "KEYCODE_ALT_RIGHT"
    59 -->  "KEYCODE_SHIFT_LEFT"
    60 -->  "KEYCODE_SHIFT_RIGHT"
    61 -->  "KEYCODE_TAB"
    62 -->  "KEYCODE_SPACE"
    63 -->  "KEYCODE_SYM"
    64 -->  "KEYCODE_EXPLORER"
    65 -->  "KEYCODE_ENVELOPE"
    66 -->  "KEYCODE_ENTER"
    67 -->  "KEYCODE_DEL"
    68 -->  "KEYCODE_GRAVE"
    69 -->  "KEYCODE_MINUS"
    70 -->  "KEYCODE_EQUALS"
    71 -->  "KEYCODE_LEFT_BRACKET"
    72 -->  "KEYCODE_RIGHT_BRACKET"
    73 -->  "KEYCODE_BACKSLASH"
    74 -->  "KEYCODE_SEMICOLON"
    75 -->  "KEYCODE_APOSTROPHE"
    76 -->  "KEYCODE_SLASH"
    77 -->  "KEYCODE_AT"
    78 -->  "KEYCODE_NUM"
    79 -->  "KEYCODE_HEADSETHOOK"
    80 -->  "KEYCODE_FOCUS"
    81 -->  "KEYCODE_PLUS"
    82 -->  "KEYCODE_MENU"
    83 -->  "KEYCODE_NOTIFICATION"
    84 -->  "KEYCODE_SEARCH"
    85 -->  "TAG_LAST_KEYCODE"
    展开全文
  • 键盘KeyCode值列表

    2014-04-28 13:56:58
    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 ...
    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键
    展开全文
  • JS键盘KEYCODE值参考

    2016-10-10 18:14:00
    keycode 1 = 鼠标左键keycode 2 = 鼠标右键keycode 3 = Cancelkeycode 4 = 鼠标中键keycode 8 = BackSpacekeycode 9 = Tabkeycode 12 = Clear(未知)keycode 13 = Enterkeycode 16 = Shift_Lkeycode 17 = Control_...
  • 原文:... ... 这个时候,就要获取键盘每次按键时候的 keyCode, 来判断是按的哪个键(数字键还是字符键,还是组合键), 然后加入我们的需求对应的处理逻辑。 -----------------...
  • 键盘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
  • KEYCODE 按键列表

    千次阅读 2016-01-05 23:04:35
    KEYCODE列表 电话 名 描述 键值   KEYCODE_CALL 拨号 5 KEYCODE_ENDCALL 挂机 6 KEYCODE_HOME 按键Home 3 KEYCODE_MENU 菜单 82 KEYCODE_BACK 返回 4...
  • If KeyCode = vbKeyF2 Then ' 显示键组合. If ShiftDown And CtrlDown And AltDown Then Txt = "SHIFT+CTRL+ALT+F2." ElseIf ShiftDown And AltDown Then Txt = "SHIFT+ALT+F2." ElseIf ShiftDown And ...
  • KeyCode

    2021-09-10 14:39:09
    KEYCODE_CALL 拨号 5 KEYCODE_ENDCALL 挂机 6 KEYCODE_HOME 按键Home 3 KEYCODE_MENU 菜单 82 KEYCODE_BACK 返回 4 KEYCODE_SEARCH 搜索 84 KEYCODE_CAMERA 拍照 27 KEYCODE_FOCUS 拍照对焦 80 ...
  • 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  ...
  • Appium--键盘操作 KEYCODE

    千次阅读 2017-12-23 16:17:24
    附录 keycode电话键KEYCODE_CALL 拨号键 5 KEYCODE_ENDCALL 挂机键 6 KEYCODE_HOME 按键Home 3 KEYCODE_MENU 菜单键 82 KEYCODE_BACK 返回键 4 KEYCODE_SEARCH 搜索键 84 KEYCODE_CAMERA 拍照键 2
  • 键盘事件 keycode收集

    2019-10-07 02:09:04
    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 keyco...
  • 组合键最后用onkeyup触发 按键 键码 A 65 B 66 C 67 D 68 E 69 F 70 G 71 H 72 I 73 J 74 K 75 L 76 M 77 N 78 O 79 P 80 Q 81 R 82 S 83 T 84 U 85 V 86 W 87 X 88 Y 89 Z 90 0 48 1 ...
  • 1)KeyPress主要用来捕获数字(注意:包括Shift+数字的符号)、字母(注意:包括大小写)、小键盘等除了F1-12、SHIFT、Alt、Ctrl、Insert、Home、PgUp、Delete、End、PgDn、ScrollLock、Pause、NumLock、{菜单}、{
  • adb命令模拟按键事件 KeyCode

    万次阅读 多人点赞 2014-09-14 11:02:22
    adb shell input keyevent 4 #这条命令相当于按了设备的Backkey adb shell input keyevent 3 #press home key   每个数字与keycode对应表如下: 0 --> "KEYCODE_UNKNOWN" 1 --> "KEYCODE_MENU" 2 --> "KEYCODE_...

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 8,987
精华内容 3,594
关键字:

组合键的keycode