Fwd: KeyListener problem

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Fwd: KeyListener problem

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





> Begin forwarded message:
>
> From: Kenneth Sloan <[hidden email]>
> Subject: Re: KeyListener problem
> Date: March 19, 2020 at 07:49:23 CDT
> To: ImageJ Interest Group <[hidden email]>
>
> In my code, imp.show() is not called in a Listener callback.  It's in the mainline program, well before addKeyListener() is called.
>
> In any event, I first tried checking to see that the result of getWindow() was not null...it never was.  Then, (to use the current hot phrase) "in an abundance of caution" I moved the call to getWindow() to a point  well after several interactions that ensured the window was open.  This made no difference.
>
> This plugin will never be called by a macro.
>
> Recall - this plugin has NEVER FAILED on my development machine.  The behavior on my client's machine is variable.  Sometimes it fails out of the box.  Sometimes it works several times in a row, and then fails.  When it fails, it apparently is stuck in that mode.  When it fails, it  often (but not always) works the first time after re-installing the plugin.  It's not clear what ELSE happens on the machine during this re-install.
>
> When it fails, keyPressed() is never called.  IJ does not see any keys either (the keys 1-6 include a number of shortcuts that do obvious things when invoked).  I am assured (but I haven't seen it in person, yet) that the image window is on top and selected.  On my list of things to explore when I get to debug in person is: are there any other processes that might pop up and take control of keyboard input.  My current theory is that some other program is interfering with IJ - but right now I have no evidence for (or against) that.
>
> On one machine, it fails if the image was read from an external hard drive, but not if the images are first transferred to the internal drive.  Note that this may well be "superstitious behavior" - no systematic testing was done.  It may just be coincidence that it failed with the external drive in use.  Note that the external drive is not being used (by the plugin) while the keyListener is active.  It is used at the beginning to read the image file, and at the end to write an output .csv file.
>
> At present, it seems to be working on ONE of my client's machines (when not using an external drive), so it's not (yet) a crisis.  But, it's very strange!
>
> All machines are mac laptops, running Catalina.  The client machines are a bit old (2012).  My development machine is a 2018  macBook Pro.
>
> I have put the source code (it's just one .java file) on Box, at:
>
> https://uab.box.com/s/3u7ivyf209c5p8ezph4m3hdbe7nzaxi8 <https://uab.box.com/s/3u7ivyf209c5p8ezph4m3hdbe7nzaxi8>
>
> All comments welcome.  
>
> --
> Kenneth Sloan
> [hidden email] <mailto:[hidden email]>
> Vision is the art of seeing what is invisible to others.
>
>
>
>
>


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