One of my customers complains that accidental keypresses do strange things.
Is there a way to disable *all* keyboard shortcuts under Java plugin control? I’d like to simply make them all “do nothing”. It would be nice to restore them on plugin exit - but that would be a frill. This user would be happy to simply re-start Fiji. Can I globally require control (command) to access keyboard shortcuts? That would solve the problem. Even better if I could turn this on/off on the start/exit of my plugin. I suppose the brute force way to do that would be to write a macro for every keypress, with an empty action. I’m hoping for something cleaner. -- 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 |
Hi Kenneth,
You could remove the key listeners as in this example plugin : http://rsbweb.nih.gov/ij/plugins/key-listener.html Sincerely Jerome. On 13 May 2016 at 07:24, Kenneth Sloan <[hidden email]> wrote: > One of my customers complains that accidental keypresses do strange things. > > Is there a way to disable *all* keyboard shortcuts under Java plugin > control? > > I’d like to simply make them all “do nothing”. > > It would be nice to restore them on plugin exit - but that would be a > frill. This user > would be happy to simply re-start Fiji. > > Can I globally require control (command) to access keyboard shortcuts? > That would solve the problem. Even better if I could turn this on/off on > the start/exit of my plugin. > > I suppose the brute force way to do that would be to write a macro for > every keypress, with an empty action. I’m hoping for something cleaner. > > -- > 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 > -- Jerome Mutterer CNRS - Institut de biologie moléculaire des plantes 12, rue du Général Zimmer 67084 Strasbourg Cedex www.ibmp.cnrs.fr -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
In reply to this post by Kenneth Sloan-2
On May 13, 2016, at 1:24 AM, Kenneth Sloan <[hidden email]> wrote:
> > One of my customers complains that accidental keypresses do strange things. > > Is there a way to disable *all* keyboard shortcuts under Java plugin control? > > I’d like to simply make them all “do nothing”. > > It would be nice to restore them on plugin exit - but that would be a frill. This user > would be happy to simply re-start Fiji. > > Can I globally require control (command) to access keyboard shortcuts? That would solve the problem. Even better if I could turn this on/off on the start/exit of my plugin. You can require use of the control (command) key for shortcuts by checking “Require control (command) key for shortcuts” in Edit>Options>Misc. -wayne -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
That’s the solution I was looking for. Thank you.
Can I: a) make it persistent? (This customer probably wants them off all the time) b) do this from inside a Java plugin (I can probably figure this out, and wouldn’t ordinarily ask, but as a “just one more question” - I’ll ask) -- Kenneth Sloan [hidden email] Vision is the art of seeing what is invisible to others. > On May 13, 2016, at 09:09 , Rasband, Wayne (NIH/NIMH) [E] <[hidden email]> wrote: > > On May 13, 2016, at 1:24 AM, Kenneth Sloan <[hidden email]> wrote: >> >> One of my customers complains that accidental keypresses do strange things. >> >> Is there a way to disable *all* keyboard shortcuts under Java plugin control? >> >> I’d like to simply make them all “do nothing”. >> >> It would be nice to restore them on plugin exit - but that would be a frill. This user >> would be happy to simply re-start Fiji. >> >> Can I globally require control (command) to access keyboard shortcuts? That would solve the problem. Even better if I could turn this on/off on the start/exit of my plugin. > > You can require use of the control (command) key for shortcuts by checking “Require control (command) key for shortcuts” in Edit>Options>Misc. > > -wayne > > > > > -- > ImageJ mailing list: http://imagej.nih.gov/ij/list.html -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
On Friday 13 May 2016 20:32:15 Kenneth Sloan wrote:
> Can I: > a) make it persistent? (This customer probably wants them off all the time) Macro-record and choose that option. That will generate the macro line that sets it. Paste that in the StartupMacros.txt and restart IJ. Cheers Gabriel -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
In reply to this post by Kenneth Sloan-2
On May 13, 2016, at 9:32 PM, Kenneth Sloan <[hidden email]> wrote:
> > That’s the solution I was looking for. Thank you. > > Can I: > > a) make it persistent? (This customer probably wants them off all the time) “Require control key for shortcuts”, like almost all Edit>Options settings, is persistent. Edit>Options settings are saved in the preference file and restored when ImageJ restarts. > b) do this from inside a Java plugin (I can probably figure this out, and wouldn’t ordinarily ask, but as a “just one more question” - I’ll ask) The Edit>Options>Misc command is implemented by an internal plugin, so you can study the source code to see how it works. Enter “misc” in the Search box of the Command Finder (Plugins>Utilities>Find Commands) to get the name of the plugin. Click on “Source” to view the source code. Plugins that change a setting like “Require control key for shortcuts” should restore it when they finish. -wayne > On May 13, 2016, at 09:09 , Rasband, Wayne (NIH/NIMH) [E] <[hidden email]> wrote: >> >> On May 13, 2016, at 1:24 AM, Kenneth Sloan <[hidden email]> wrote: >>> >>> One of my customers complains that accidental keypresses do strange things. >>> >>> Is there a way to disable *all* keyboard shortcuts under Java plugin control? >>> >>> I’d like to simply make them all “do nothing”. >>> >>> It would be nice to restore them on plugin exit - but that would be a frill. This user >>> would be happy to simply re-start Fiji. >>> >>> Can I globally require control (command) to access keyboard shortcuts? That would solve the problem. Even better if I could turn this on/off on the start/exit of my plugin. >> >> You can require use of the control (command) key for shortcuts by checking “Require control (command) key for shortcuts” in Edit>Options>Misc. >> >> -wayne -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Excellent! Thank you.
-- Kenneth Sloan [hidden email] Vision is the art of seeing what is invisible to others. > On May 14, 2016, at 17:40 , Rasband, Wayne (NIH/NIMH) [E] <[hidden email]> wrote: > > On May 13, 2016, at 9:32 PM, Kenneth Sloan <[hidden email]> wrote: >> >> That’s the solution I was looking for. Thank you. >> >> Can I: >> >> a) make it persistent? (This customer probably wants them off all the time) > > “Require control key for shortcuts”, like almost all Edit>Options settings, is persistent. Edit>Options settings are saved in the preference file and restored when ImageJ restarts. > >> b) do this from inside a Java plugin (I can probably figure this out, and wouldn’t ordinarily ask, but as a “just one more question” - I’ll ask) > > The Edit>Options>Misc command is implemented by an internal plugin, so you can study the source code to see how it works. Enter “misc” in the Search box of the Command Finder (Plugins>Utilities>Find Commands) to get the name of the plugin. Click on “Source” to view the source code. Plugins that change a setting like “Require control key for shortcuts” should restore it when they finish. > > -wayne > > > >> On May 13, 2016, at 09:09 , Rasband, Wayne (NIH/NIMH) [E] <[hidden email]> wrote: >>> >>> On May 13, 2016, at 1:24 AM, Kenneth Sloan <[hidden email]> wrote: >>>> >>>> One of my customers complains that accidental keypresses do strange things. >>>> >>>> Is there a way to disable *all* keyboard shortcuts under Java plugin control? >>>> >>>> I’d like to simply make them all “do nothing”. >>>> >>>> It would be nice to restore them on plugin exit - but that would be a frill. This user >>>> would be happy to simply re-start Fiji. >>>> >>>> Can I globally require control (command) to access keyboard shortcuts? That would solve the problem. Even better if I could turn this on/off on the start/exit of my plugin. >>> >>> You can require use of the control (command) key for shortcuts by checking “Require control (command) key for shortcuts” in Edit>Options>Misc. >>> >>> -wayne > > -- > ImageJ mailing list: http://imagej.nih.gov/ij/list.html -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Free forum by Nabble | Edit this page |