Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
Thread: keypress event in DOM?
06-18-2003, 09:42 PM #1
- Join Date
- Apr 2003
- Atlanta, GA
- Thanked 0 Times in 0 Posts
keypress event in DOM?
DOM2 does not provide a key event module. That's fine. I'm down with that.
According to the DOM3 Events spec (in last call), there's no keyPress event, only keyDown and keyUp. Instead (I guess) they've defined a new interface for text events, which provides one event type: textInput.
Should I not code event handlers for keyPress events if I wish to write DOM-compliant scripts? IE & Moz both register a keyPress; I'm sure that it won't be outphased. I worry instead about a new and better browser appearing and balking on my script because it's coded exactly to spec.
06-19-2003, 01:28 AM #2
Well, you're going to have to keep using keypress for a while. And then would "Uberbrowser 1.0" (when released) support non-DOM3 events? I'd say so. Mozilla supports quite a few non-DOM2 Events, and even has it's own, entirely proprietary, KeyEvent interface to make up for DOM2's lack of one.
And if not, it shouldn't take more than 10 minutes to update a script already friendly to the DOM to use the textInput event. It looks as though it should simplify most of them anyway, cutting that keyCode/charCode crap.