Discussion:
keyboard buffer in Firefox
小谢
2010-08-18 03:27:14 UTC
Permalink
Hi

When I press a key and don't release it immediately, it takes about
half a second for Firefox before launching a series of keypress
events. Why the pause? Why isn't the consecutive keypress events
triggered immediately? Does Firefox have a keyboard buffer kind of
thing inside?



Xie
Mounir Lamouri
2010-08-18 04:27:06 UTC
Permalink
Post by 小谢
Hi
When I press a key and don't release it immediately, it takes about
half a second for Firefox before launching a series of keypress
events. Why the pause? Why isn't the consecutive keypress events
triggered immediately? Does Firefox have a keyboard buffer kind of
thing inside?
Hi,

I think your issue is not related to DOM. The key repetition should
behave exactly the way you have described it: there is a timeout before
considering the keypress as a key repetition instead of a simple long
keypress. This timeout is probably a system setting and not related to
Firefox.

By the way, why do you need a continuous flow of keypress events?

--
Mounir
小谢
2010-08-18 07:18:36 UTC
Permalink
Post by Mounir Lamouri
Post by 小谢
Hi
When I press a key and don't release it immediately, it takes about
half a second for Firefox before launching a series of keypress
events. Why the pause? Why isn't the consecutive keypress events
triggered immediately? Does Firefox have a keyboard buffer kind of
thing inside?
Hi,
I think your issue is not related to DOM. The key repetition should
behave exactly the way you have described it: there is a timeout before
considering the keypress as a key repetition instead of a simple long
keypress. This timeout is probably a system setting and not related to
Firefox.
By the way, why do you need a continuous flow of keypress events?
--
Mounir
Hi, Mounir.

Sorry I post in the wrong board and thanks for the answer. I'm
creating a game base on <canvas>. It's best to respond to user input
immediately in the game, so the timeout become intolerable. Is there
any better way to get rid of the timeout?


Xie
Martijn
2010-08-18 09:59:44 UTC
Permalink
Post by 小谢
Post by Mounir Lamouri
Post by 小谢
Hi
When I press a key and don't release it immediately, it takes about
half a second for Firefox before launching a series of keypress
events. Why the pause? Why isn't the consecutive keypress events
triggered immediately? Does Firefox have a keyboard buffer kind of
thing inside?
Hi,
I think your issue is not related to DOM. The key repetition should
behave exactly the way you have described it: there is a timeout before
considering the keypress as a key repetition instead of a simple long
keypress. This timeout is probably a system setting and not related to
Firefox.
By the way, why do you need a continuous flow of keypress events?
--
Mounir
Hi, Mounir.
Sorry I post in the wrong board and thanks for the answer. I'm
creating a game base on <canvas>. It's best to respond to user input
immediately in the game, so the timeout become intolerable. Is there
any better way to get rid of the timeout?
Can't you just listen for keydown, then do whatever function needs to
be called, and then stop doing that onkeyup?

Regards,
Martijn
Post by 小谢
Xie
_______________________________________________
dev-tech-dom mailing list
https://lists.mozilla.org/listinfo/dev-tech-dom
--
Martijn Wargers - Help Mozilla!
http://quality.mozilla.org/
http://wiki.mozilla.org/Mozilla_QA_Community
irc://irc.mozilla.org/qa - /nick mw22
Continue reading on narkive:
Loading...