jaywcjlove / hotkeys-js

➷ A robust Javascript library for capturing keyboard input. It has no dependencies.
https://jaywcjlove.github.io/hotkeys-js
MIT License
6.65k stars 410 forks source link

"ArrowDown","ArrowUp","ArrowLeft","ArrowRight"等键位在注册时keycode是错误的 #458

Open longtaipeng opened 11 months ago

longtaipeng commented 11 months ago

我在使用 hotkeys 监听 "ArrowDown","ArrowUp","ArrowLeft","ArrowRight"等键位时存在无法监听的问题

如图:

截屏2023-11-06 14 04 47

"ArrowDown","ArrowUp"的keys都是65,我不知道这是否对于键位的keyCode,但这也许是导致无法监听的原因。

我的代码如下

hotKyes("ArrowDown", () => {
...
})

hotKyes("ArrowUp", () => {
...
})

这样写是否存在问题呢?望告知,非常感谢!!!

MikeSpitz commented 10 months ago

You need to use up, down, left, right

More info here: https://github.com/jaywcjlove/hotkeys-js/issues/13 https://github.com/jaywcjlove/hotkeys-js/issues/311