Opera onkeyup 坏了?重复,倒下时开火

发布于 2024-09-25 19:02:14 字数 570 浏览 4 评论 0原文

当我添加任何 onkeyup 事件时,它不会执行 Opera 中应有的操作。当按住按键时(而不是松开按键时)它会重复触发。同样的事件在 Chrome 和 Firefox 中可以正常工作。我没有 keydownkeypressed 的监听器。

当按下按键时,这个简单的代码会将按键事件流记录到 Opera 的控制台。在 Firefox 和 Chrome 中,当释放按键时,它会记录一行(我使用的是 Mootools,但它与传统的事件附加相同,并且是否附加到任何地方:窗口、文档、文本字段...)

        $(window).addEvent("keyup", trapKeyUp);
        function trapKeyUp(e) {
            console.log(e);
        }

<强>所以我的问题是:在 Opera 的情况下,我是否在代码方面做了错误的事情,或者浏览器只是严重损坏?在这个网站和谷歌上搜索时,我没有轻易找到任何对此特定的引用问题。我在 Ubuntu 上使用最新的 Opera。

When I add any onkeyup event, it does not do what it's supposed to in Opera. It fires repeatedly while the key is held, not when it's released. This same event works correctly in Chrome and Firefox. I have no listeners for keydown or keypressed.

This simple code logs a stream of key events to the console in Opera when the key is held down. In Firefox and Chrome, it logs a single line when the key is released (I'm using Mootools, but it does the same with traditional event attaching, and does it attached anywhere: window, document, a text field...)

        $(window).addEvent("keyup", trapKeyUp);
        function trapKeyUp(e) {
            console.log(e);
        }

So my question is: is there something I'm doing wrong code wise in Opera's case, or is the browser just horribly broken? In searching on this site and Google I did not readily find any references to this specific issue. I'm using the latest Opera on Ubuntu.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

雪化雨蝶 2024-10-02 19:02:14

我知道 Opera 不会在 Windows 上重复 keyup 事件,因此这看起来像是与 Ubuntu 平台集成时的错误(错误)。如果 10.70 预览版本中仍然存在问题,请在 https://bugs.opera.com/ 报告错误Wizard/ - 如果您给我错误的参考号,我可以将其推进。

I know that Opera doesn't repeat keyup events on Windows, so it seems like an error (a bug) in the integration with the Ubuntu platform. If it is still a problem in a 10.70 preview build please report a bug at https://bugs.opera.com/wizard/ - if you give me the bug's reference number I can push it forward.

极度宠爱 2024-10-02 19:02:14

我在 Linux 上运行 Opera 时遇到了问题,键盘确实是根据操作系统中设置的自动重复的速率触发的。我测试了一下,Linux 上的 Opera 是唯一仍然这样做的浏览器,我认为它更早更常见。

我之前为此提交了一个错误,如果有帮助,请参考 ID DSK-307269

PS:那是几个月前的事了,所以它可能已经被修复了,但我假设你是最新的,所以情况并非如此。

来自报告错误时自动生成的电子邮件:

您可以使用此电子邮件地址(或回复此电子邮件)来更新您的报告,其中包含更多信息,例如屏幕截图、崩溃日志、代码示例等:

[电子邮件受保护]

这是您提交给我们的信息:
版本:10.60
内部版本:6386
操作系统:Linux
平台:PC

摘要:当按键保持按下状态时,keyup js-event 会重复

I've had problems with this running opera for linux, the keyup is indeed triggered at a rate according to the auto-repeat set in the OS. I tested around, and opera on linux is the only browser still doing this, I think it was more common earlier.

I filed a bug for this earlier, reference id DSK-307269 if helps.

PS: It was a couple of months ago, so it might've been fixed since, but I assume you're on the latest, so not the case.

From email auto-generated when bug reported:

You can use this e-mail address (or reply to this e-mail) to update your report with more information, such as screenshots, crash logs, code examples, and so on:

[email protected].

This is the information you submitted to us:
Version: 10.60
Build: 6386
Operating system: Linux
Platform: PC

Summary: keyup js-event repeated while key stays down

梦断已成空 2024-10-02 19:02:14

它仍然发生在 Ubuntu 下的 Opera 11.50 上。虽然这并不是一个真正的问题,但知道你的代码在浏览器和/或操作系统上的工作方式不一样有点烦人。我使用此事件(onkeyup)来防止用户向服务器发送非常快速的请求,并使其挂在较慢的网络上。

it's still happen on Opera 11.50 under Ubuntu.. not really an issue though, but kinda annoying to know that your code doesn't work the same way across browser and/or operating system. i use this event (onkeyup) to prevent user sending very rapid request to the server, and making it hung on slower network.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文