Richard,
The problem is that the instance of ij.ImageJ reads the KeyEvent before
it reaches your plugin (even if you call consume() on the event, it has
already been read). So, easy: remove the KeyListener from the ImageJ
class, and when your plugin finishes (inside the finally clause of a try
{ } catch () {} finally {} , just to be sure) re-add the listener.
As easy as:
IJ.getInstance().removeKeyListener(IJ.getInstance());
If you want to test this on the fly, just use the Jython Intepreter,
type the same without the ending semicolon
http://www.mcdb.ucla.edu/research/hartenstein/software/imagej/other_plugins.html#interpreter
To add back the listener:
IJ.getInstance().addKeyListener(IJ.getInstance());
Albert