R
Russell
I am trying to set up some key command to mimic Emacs. For ctrl-k, I
want to mark all text to the right of the cursor and then delete it
This code marks all the text to the right of the cursor
key = KeyStroke.getKeyStroke(KeyEvent.VK_K, Event.CTRL_MASK);
inputMap.put(key, DefaultEditorKit.selectionEndLineAction);
This line deletes all marked text
inputMap.put(key, DefaultEditorKit.deleteNextCharAction);
How can I combine them? What I really want is selectionEndLineAction
and deleteNextCharAction.
Thanks in advance. This is the first time I am using keymaps.
Russell
want to mark all text to the right of the cursor and then delete it
This code marks all the text to the right of the cursor
key = KeyStroke.getKeyStroke(KeyEvent.VK_K, Event.CTRL_MASK);
inputMap.put(key, DefaultEditorKit.selectionEndLineAction);
This line deletes all marked text
inputMap.put(key, DefaultEditorKit.deleteNextCharAction);
How can I combine them? What I really want is selectionEndLineAction
and deleteNextCharAction.
Thanks in advance. This is the first time I am using keymaps.
Russell