首页 > 解决方案 > 有没有办法在不硬编码的情况下获取键盘键列表及其各自的键码?

问题描述

我想创建一个以键盘键为选项的下拉列表,但我不想对所有键及其代码进行硬编码。

标签: javascriptjquerykeyboardfrontendkeyboard-shortcuts

解决方案


Based on w3schools docs here I think you'll have to hardcode it. Why don't you just listen to a keyboard input from the user and save its value instead of the dropdown?


推荐阅读