I'm working on implementing rich text editing for Instantbird so we can
send HTML messages. When I input "enter" it appends a <br> to the
document, then sends the message. I want to (in some way) change the
rules set  to only insert a <br> for Shift+Enter, so I can observe
when an enter is pressed and send the message (which works fine). 
contains a statement implying this can be done, I believe, in:
> Every instantiation of an editor has it's own rules object.
> nsTextEditor and nsHTMLEditor both have an InitRules() function which
> handles this. Until we make rules plugin at the runtime level, you
> will have to settle for plugging them in programmatically by altering
> the InitRules() method of nsHTMLEditor to use your rules system
This seems to imply it can be done, but I have no idea how to go about
doing this. If possible we could patch the Mozilla editor component
(and we try to patch the toolkit as little as possible).
If someone has an idea of how I could work around this in an easier way
I'd be interested, but a lot of the documentation seems poorly documented.
Also, is there more up-to-date documentation about editor interfaces and
components? In particular using them from a XUL application (as opposed
from a website)?
> Patrick Cloke wrote:
>> If someone has an idea of how I could work around this in an easier
>> way I'd be interested, but a lot of the documentation seems poorly
> How are you watching for the enter that is used to send the message? If
> preventDefault() on the enter key event.
already, but apparently not! It works. Thanks a lot Neil!