Login  Register

Intercepting keystrokes in plugin

Posted by Jeff Hardin on Jul 22, 2009; 5:39am
URL: http://imagej.273.s1.nabble.com/Intercepting-keystrokes-in-plugin-tp3691678.html

Hello Imagers,

I wrote a plugin a long time ago (for browsing 4d datasets from disc)  
that extends the ImageWindow class, and creates a KeyListener to act  
on the up, down, left, and right arrow keys. This worked well before  
the default behavior was to magnify or reduce the ImageWindow using  
the right and left arrow keys, as in more recent versions of ImageJ.  
Now the plugin reads the key stroke and acts on it, but the key stroke  
is passed to ImageJ, which then magnifies or reduces the ImageWindow.  
I guess I'm stupid, but I don't see how to prevent this.

Any ideas would be deeply appreciated!

Cheers,

Jeff
----------------------------------------------
Jeff Hardin
Professor and Chair, Department of Zoology
Director, Biology Core Curriculum
University of Wisconsin
1117 W. Johnson St.
Madison, WI 53706
voice: (608) 262-9634
fax: (608) 262-7319
email: [hidden email]
web page: http://worms.zoology.wisc.edu