javascript:捕获功能 (f1-12) 键
我正在努力用 Web 应用程序替换旧的 vb6 应用程序。在旧应用程序中,保存按钮链接到 f8,该应用程序的用户希望保持不变。如何捕获 f8 按钮以便将其链接到我的保存按钮?谢谢
Possible Duplicate:
Handling key-press events (F1-F12) using JavaScript and jQuery, cross-browser
I am working to replace an old vb6 app with a web app. in the old app the save button was linked to f8 and the users of this application want that to stay the same. How can i capture the f8 button so that it is linked to my save button? Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您应该能够绑定到“keyup”事件并查看 keyCode。以下是您需要的键码列表。
http://www.cambiaresearch.com/c4/702b8cd1-e5b0-42e6-83ac-25f0306e3e25/javascript-char-codes-key-codes.aspx
YOu should be able to bind to the 'keyup' event and look at the keyCode. Here is a list of the keycodes you will need.
http://www.cambiaresearch.com/c4/702b8cd1-e5b0-42e6-83ac-25f0306e3e25/javascript-char-codes-key-codes.aspx
DOM_VK_F8 = 119
,因此您应该检查keypress
事件侦听器的事件对象的keyCode
属性是否等于 119。DOM_VK_F8 = 119
, so you should check to see that thekeypress
event listener's event object'skeyCode
property is equal to 119.