In Safari 3.1, which was released yesterday, the
keypress event is no longer fired for non-character keypresses other than enter.
I was sure this was just a bug, but it turns out the change was intentional, and was made in order to imitate the behavior of Internet Explorer.
In other words, the WebKit team looked at their
keypress implementation, which had some quirks but at least worked more or less the same as in Firefox and Opera, and they said, “Hey, you know what this needs? More suck!” and changed it to work like IE instead, thereby causing even more confusion in the already-muddled mess of DOM keyboard events.
If you’re developing a web browser, here’s a helpful tip: when faced with the question of whether you should imitate the behavior of Internet Explorer or [insert other browser name], always imitate the other browser. I don’t care if the other browser is Mosaic 1.0; odds are it’s a safer choice than IE.