Re: controlKeyDown within macro

Posted by Wayne Rasband-2 on
URL: http://imagej.273.s1.nabble.com/controlKeyDown-within-macro-tp5021932p5021934.html

> On Mar 26, 2019, at 6:33 AM, Philippe CARL <[hidden email]> wrote:
>
> Dear all,
>
> Is there a reason why the macro methods "isKeyDown(key)" and/or
> "setKeyDown(keys)" are only applying for the "shift", "alt" or "space" keys
> and not the "control" one?

The isKeyDown(key) and setKeyDown(keys) macro functions support the control key in the latest daily build (1.52o4).

Use this macro to test isKeyDown():

  print("\nClose Log window to abort");
  setKeyDown("none");
  while (true) {
     keys = "Keys down: ";
     if (isKeyDown("shift")) keys+="shift ";
     if (isKeyDown("alt")) keys+="alt ";
     if (isKeyDown("space")) keys+="space ";
     if (isKeyDown("control")) keys+="control ";
     print(keys);
     wait(1000);
     if (!isOpen("Log")) break;
  }

-wayne

> I ask this question given especially that there is already the "public
> static boolean controlKeyDown()" method within the ij.IJ.java file.
>
> My best regards,
>
> Philippe

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