adimell
December 22, 2024, 6:36pm
1
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.
marijn
December 22, 2024, 8:50pm
2
A keydown handler should absolutely catch enter presses (unless it has a lower precedence than another handler or the keymap).
adimell
December 23, 2024, 6:10am
3
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?
marijn
December 23, 2024, 8:16am
4
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.