Just now I cut short my research to the two key properties
course I published the results, but I didn't go quite as far as I originally planned. The punctuation keys, especially, will remain a mystery for reasons explained on the page.
Nonetheless I produced a clear table with the meanings
charCode can have, as well as a compatibility table for the special keys (escape, home, pageDown and such). These keys will delight the hearts and minds of incompatibility-lovers from all over the world, and I heartily recommend them in case you have nothing to do. Browser vendors, especially on Mac, have made a concerted push to remain incompatible and sometimes downright vague. Of course, the lack of a public standard doesn't help.
I studied 19 keys, and only one of them (backspace) is treated exactly the same by all browsers. Fortunately most differences are pretty minor (pressing the delete key doesn't fire the keypress event in Explorer; big deal), but especially on Mac, there are serious differences, too. The Mac-only help key spans the crown: Mozilla reports
keyCode 6, Safari 45, and Opera either 5 or 63, depending on the event. Go figure!
If you like this blog, why not donate a little bit of money to help me pay my bills?
Comments are closed.