我想使用 JavaScript 和 jQuery 处理 F1-F12 键.
I want to handle F1-F12 keys using JavaScript and jQuery.
我不确定要避免哪些陷阱,而且我目前无法在 Internet Explorer 8、Google Chrome 和 Mozilla FireFox 3 之外的任何其他浏览器中测试实现.
I am not sure what pitfalls there are to avoid, and I am not currently able to test implementations in any other browsers than Internet Explorer 8, Google Chrome and Mozilla FireFox 3.
对完整的跨浏览器解决方案有什么建议吗?类似于经过良好测试的 jQuery 库,或者只是普通的 jQuery/JavaScript?
Any suggestions to a full cross-browser solution? Something like a well-tested jQuery library or maybe just vanilla jQuery/JavaScript?
这类问题的最佳来源是这个页面:http://www.quirksmode.org/js/keys.html
The best source I have for this kind of question is this page: http://www.quirksmode.org/js/keys.html
他们说的是 Safari 上的键码很奇怪,其他地方都一致(除了 IE 上没有按键事件,但我相信 keydown 有效).
What they say is that the key codes are odd on Safari, and consistent everywhere else (except that there's no keypress event on IE, but I believe keydown works).
这篇关于使用 JavaScript 和 jQuery,跨浏览器处理按键事件 (F1-F12)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
在 Angular 2/Typescript 中使用 IScrollUse IScroll in Angular 2 / Typescript(在 Angular 2/Typescript 中使用 IScroll)
Anime.js 在 Ionic 3 项目中不起作用anime.js not working in Ionic 3 project(Anime.js 在 Ionic 3 项目中不起作用)
Ionic 3 - 使用异步数据更新 ObservableIonic 3 - Update Observable with Asynchronous Data(Ionic 3 - 使用异步数据更新 Observable)
Angular 2:在本地 .json 文件中找不到文件Angular 2: file not found on local .json file(Angular 2:在本地 .json 文件中找不到文件)
在 Ionic 2 中,如何创建使用 Ionic 组件的自定义指In Ionic 2, how do I create a custom directive that uses Ionic components?(在 Ionic 2 中,如何创建使用 Ionic 组件的自定义指令?)
将 ViewChild 用于动态元素 - Angular 2 &离子2Use ViewChild for dynamic elements - Angular 2 amp; ionic 2(将 ViewChild 用于动态元素 - Angular 2 amp;离子2)