javascript - 有没有办法在不硬编码的情况下获取键盘键列表及其各自的键码?
问题描述
我想创建一个以键盘键为选项的下拉列表,但我不想对所有键及其代码进行硬编码。
解决方案
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?
推荐阅读
- c++ - 从 gcc 切换到 clang 后的 ndk sigbus adraln
- javascript - Chrome DevTools getEventlisteners 在 iFrame 中不起作用
- html - 可调整大小的 div 和 contenteditable 标题的问题
- xpath - Katalon - 无法读取 SVG
- sparql - SPARQL 查询从给定的根路径走路径
- php - 在 MySQLi 中的 select 语句中绑定参数时出错
- haproxy - 具有多个后端路径的 Haproxy HTTP 到 HTTPs 重定向
- ios - Xcode Git 合并 project.pbxproj 文件
- sql-server - 当你想在 T-SQL 中打破多列数据时添加四分位数
- qemu - 我可以检查 Qemu tcg ir 代码吗?如果有怎么办?