By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,462 Members | 3,388 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,462 IT Pros & Developers. It's quick & easy.

onkeydown bug with multiple keys in Firefox/Linux?

P: 4
I'm working on some javascript games, and I encountered what appears to be a bug specific to Firefox on Linux (I'm using several recent versions of Ubuntu).

I'd love to get some help verifying that it is a bug as well as possibly devising a workaround.

Here's the situation: in my game, you control a space ship with the arrow keys. You move the ship by pressing the arrow keys, and often you will press both the up key and the left or right key at the same time.

This seems to work fine in the latest versions of IE and Safari and Firefox(Win and Mac). But there's a small but significant glitch in Firefox(Linux): onkeydown doesn't register the second key (while the first one is still being held down) unless you tap the second key twice.

I prepared an example so that it is easier to visualize.

The example only uses the up/left/right keys. Trying holding one of those keys down. The webpage will indicate which key is down. While holding the first key down, press one of the other two keys. The page *should* immediately indicate the second key, but in Firefox(Linux) nothing happens. Now, while still holding the first key, hit the second key again and the page will indicate properly in all browsers.

I hope I've explained this problem ok. It is a small glitch but it has a significant impact on game play with certain games.

Thanks for any input!
Jay Cotton
Jun 4 '07 #1
Share this Question
Share on Google+
2 Replies

P: 4
Sorry - I forgot to make a hyperlink for my example. Here you go:
Jun 4 '07 #2

Expert Mod 15k+
P: 16,027
I'm keeping this here, but I've also copied it over to the Linux forum. Watch out for the thread over there too.
Jun 5 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.