js键盘码

简介:

js获取键盘按键的键码event.keyCode,记录-方便查找。

1、键盘各按键对应的数字

  • keycode 8 = BackSpace
  • keycode 9 = Tab
  • keycode 12 = Clear
  • keycode 13 = Enter
  • keycode 16 = Shift
  • keycode 17 = Control
  • keycode 18 = Alt
  • keycode 19 = Pause
  • keycode 20 = CapsLock
  • keycode 27 = 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
  • keycode 49 = 1
  • keycode 50 = 2
  • keycode 51 = 3
  • keycode 52 = 4
  • keycode 53 = 5
  • keycode 54 = 6
  • keycode 55 = 7
  • keycode 56 = 8
  • keycode 57 = 9
  • keycode 65 = A
  • keycode 66 = B
  • keycode 67 = C
  • keycode 68 = D
  • keycode 69 = E
  • keycode 70 = F
  • keycode 71 = G
  • keycode 72 = H
  • keycode 73 = I
  • keycode 74 = J
  • keycode 75 = K
  • keycode 76 = L
  • keycode 77 = M
  • keycode 78 = N
  • keycode 79 = O
  • keycode 80 = P
  • keycode 81 = Q
  • keycode 82 = R
  • keycode 83 = S
  • keycode 84 = T
  • keycode 85 = U
  • keycode 86 = V
  • keycode 87 = W
  • keycode 88 = X
  • keycode 89 = Y
  • keycode 90 = Z
  • 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

2、键盘码使用

2.1、原生js使用

2.2、jQuery使用

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值