Login  Register

KeyListener problem

Posted by Kenneth Sloan-2 on Mar 18, 2020; 1:19am
URL: http://imagej.273.s1.nabble.com/KeyListener-problem-tp5023044.html

I have a plugin which displays an image, removes IJ.instance Key and Image Listeners, adds itself as Key and ImageListener, and handles keypresses for the keys 1-6.  

It works perfectly on my machine (a mac, latest OS) - but fails on someone elses - INTERMITTENTLY.

When it fails, the plugin reports removing and adding the appropriate listeners...and then never reports seeing ANY keypress. (keyPressed() is never called).

I followed the template in keyListener.java (I think that's the right name).

There is a requestFocus() in what I think is the right place, and I've asked the "client" to be sure the image window is on top and "selected".  No joy.

I'm stumped - does anyone have any experience with similar problems?  Any suggestions on how to proceed?  Recall that I can't reproduce the problem on my machine.  My "client" reports that the plugin sometimes works - perhaps several times in a row - and then fails.  Once it starts to fail, even restarting FIJI does not revive it.  I'm guessing (but have not asked) that it requires a reboot to fix.

Any clues?
--
Kenneth Sloan
[hidden email]
Vision is the art of seeing what is invisible to others.

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html