How do I listen for Ctrl+Enter Command on Editor ? #3432
-
I'm trying to trigger a function when the user presses Ctrl+Enter while focused on the editor. I found .registerCommand() but it does not have a command to detect ctrl+enter. would love to know it's possible to do so now & if so how? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Use the |
Beta Was this translation helpful? Give feedback.
-
Is there any way that after detecting the Enter keypress using KEY_ENTER_COMMAND, I can avoid its default behavior i.e cursor going to the next line? Trying to do this as the cursor going down, changes the states once. |
Beta Was this translation helpful? Give feedback.
Use the
KEY_ENTER_COMMAND
command, and the payload contains the DOM event to check if the Ctrl key is also being pressed as well.