1 KeyStroke triggering 2 actions?

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top