By orblog
Tuesday, 23. June 2009, 07:43:10
Stopping javascript events (Opera Desktop)
As far as I know, Opera doesn't allow you to stop certain JS events. For example, the enter key.I can work around this fact, and although the workarounds are not as good as being able to stop it, they work fairly well. However, other browsers that support it will be better off using the version that prevents them, so I can't use the workaround for all browser. So, I need to write two different versions of the code so I can have decent support for Opera, but not compromise the other browsers.
This brings me to my question, is there any way in Opera to detect if the event will be stopped or not? Checking the event information on Opera's Dragonfly debugger seems to indicate that it accepted the event stop, and it will be stopped. But in reality it isn't stopped.
This has left me with only one option: browser detection. Yes, it is a bad option. Which is why I'm here, looking for an alternative. Any thoughts? I'd settle for a way to detect if the event will be stopped. The only other way out I see is to just not care if Opera works or not.
What I'm working on is a web based rich text editor written in javascript, and it has special handling for the enter key in most situations. There are other events that have the same problem, but the enter key is the biggest.