Posted by
Rasband, Wayne (NIH/NIMH) [E] on
May 14, 2016; 10:28pm
URL: http://imagej.273.s1.nabble.com/disabling-and-re-enabling-shortcuts-tp5016418p5016443.html
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