I have a RichTextArea taMessage, and I added it a shortcutlistener;
taMessage.addShortcutListener(new ShortcutListener(“Send”, KeyCode.ENTER, null) {
@Override
public void handleAction(Object sender, Object target) {
send(taMessage.getValue);
}
});
But this does not work when the textArea is focused, it just gaves a new line. What I think is , textArea has a default shortcutListener for Enter key and when it is pressed it creates a new line. But when I use this code for KeyCode.ESCAPE it works as expected even when the textArea is focused. Is there a way to disable this new line feature when pressed enter and change it ?