Posted by
Wayne Rasband-2 on
Dec 28, 2017; 5:19pm
URL: http://imagej.273.s1.nabble.com/Fn-Shortcut-keys-requires-control-key-they-should-not-tp5019772p5019796.html
> On Dec 20, 2017, at 4:01 AM, Stein Rørvik <
[hidden email]> wrote:
>
> Hello,
>
> There is an option "Require control key for shortcuts" which is very useful for controlling the behaviour of the alphanumeric keys.
> This does not apply for macros, so you can for example define "my macro [p]" which launches when you press the key 'p' and "another macro [P]" which launches when you press the key shift 'P'. If you have the "Require control key for shortcuts" setting turned on, this will not conflict with the Print and Properties... commands; which then launches when you press control-p and control-shift-P respectively. This is good and flexible behaviour, as the "Require control key for shortcuts" setting thus enables many more possibilities for keyboard shortcuts.
>
> The problem I want to address is that in order to launch macros that uses F-keys as shortcuts, you must press the control key to access them if the "Require control key for shortcuts" is enabled. So "my macro [F2]" require you to press control-F2 to launch it. I think that is both unnecessary (as no F-key shortcuts are defined in the existing menus) and inconsistent (as the other macro shortcuts run without requiring the control key). Can this behaviour be changed so that the F-key macros launch independently of the "Require control key for shortcuts" setting? If the F-key shortcut macros launched independently of the modifier key settings, you could even use isKeyDown("shift"/"alt"/"space") to modify its behaviour inside the macro.
>
> For the numeric pad, whether or not the given macro shortcut key requires a control press varies from key to key. The + and - keys work without control, but not * or / or any of the number keys. This is quite inconsistent behaviour. The numeric period does not work at all for me but that could be a keyboard issue since I am in Europe and the period key maps to comma by default here.
In the latest ImageJ daily build (1.51t19), function key and numeric keypad macro shortcuts should work as expected when "Require control key for shortcuts” is enabled. The numeric keypad period key problem is not fixed.
-wayne
> Here is a test macro to illustrate the current behaviour:
>
> macro "F1 [f1]" {print("F1");} //requires ctrl
> macro "Numeric Pad 0 [n0]" { print("npad 0"); } //requires ctrl
> macro "Numeric Pad 9 [n9]" { print("npad 9"); } //requires ctrl
> macro "Numeric Pad / [n/]" { print("npad /"); } //requires ctrl
> macro "Numeric Pad * [n*]" { print("npad *"); } //requires ctrl
> macro "Numeric Pad - [n-]" { print("npad -"); } //ok
> macro "Numeric Pad + [n+]" { print("npad +"); } //ok
> macro "Numeric Pad . [n.]" { print("npad ."); } //does not work at all
>
> I am using daily build ImageJ 1.51s with Java 1.6 on Windows 7/64-bit.
> I don't know if this behaviour happens on Linux and MacOS too?
> Is this a bug or a limitation of the way the keyboard is mapped in Windows?
>
> Stein
>
>
> --
> ImageJ mailing list:
http://imagej.nih.gov/ij/list.html--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html