Auto capitalization when pressing Enter

Hi,

I’m working on a plugin of auto capitalization that should act like the auto capitalization in MS-word (start of line or start of a sentence).

What is the best way to catch the Enter being pressed so I could check if auto capitalization is required or not? HandleKeyDown doesn’t catch it.

Thanks.

A keydown handler should absolutely catch enter presses (unless it has a lower precedence than another handler or the keymap).

In our application the default chain command for enter is defined and get done before the call to handleKeyDown. I don’t want to override the default behavior. I want to add to it. What is the best approach to do that?

Put the plugin that listens for enter before the plugin that defines the key binding, and make sure it doesn’t call preventDefault on the event.