调用 KeyDown 事件
我所需要的只是能够单击一个按钮并让它执行 Enter 的 KeyDown 事件,我已经厌倦了 KeyDownCheck(13);和类似的事情,我可以进入 KeyDown 事件,但我无法让它识别出我想要 Enter,并且它不会转到任何特定的键。
Enter 所做的只是调用另一个函数,但是当我尝试从按钮调用该函数时,它似乎调用了另一个函数,这让我又回来了。讽刺的是,我在 Enter 事件中遇到了同样的问题,但我用 return false 修复了它;声明,但我不知道如何为按钮执行此操作,所以我只想调用 KeyDown。
有没有具体的方法可以把它放进去?提前致谢
All I need is to be able to click a button and have it do the KeyDown event for Enter, I've tired doing KeyDownCheck(13); and similar things, and I can get into the KeyDown event, but I can't get it to recognize that I want Enter, and it doesn't go to any specific key.
All Enter does is call another function, but when I try to call the function from a button it seems to call a different function which puts me back. Ironically, I had the same problem in the Enter event, but I fixed it with a return false; statement and I don't know how to do that for a button, so I was just going to call the KeyDown.
Is there a specific way to put this in? Thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
请注意,关键事件在很大程度上是特定于浏览器的。这真的一点也不有趣,尤其是没有像“enter”这样的字母数字键。
有关所有问题的完整概述,请参阅此处。
请参阅此处获取测试脚本,该脚本可帮助您确定浏览器为您提供的结果。
Notice, that key events are heavily browser specific. It is no fun at all really especially with none alphanumeric keys like 'enter'.
See here for a full run-down on all the issues.
See here for a test script, that helps you to determine the results your browser gives you.