powered by Jive Software

Plugin help: Change ChatInputEditor key behavior


for my first plugin I am trying to change the behavior of the ChatInputEditor to send the message with Shift-Enter and Alt-S and to make a linebreak with Enter.

I wrote a custom KeyListener for the ChatInputArea which works nicely, but I don’'t seem to have the possibility to do what I described above with the normal plugin API … Is this correct or did I miss the right way?

Thanks for any info on this!

No idea, anyone?

In addition to creating your new bindings, you probably need to remove the default ones. How to do that depends on how they implemented them. You could try removing any exising key listeners from the chatarea before adding yours. You could also try ChatArea.getInputMap().remove(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,0)) if they did it through the input map.

Thanks, I will try that!