controlKeyDown within macro

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

controlKeyDown within macro

CARL Philippe (LBP)
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?

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

 

Philippe CARL

Laboratoire de Bioimagerie et Pathologies

UMR 7021 CNRS - Université de Strasbourg

Faculté de Pharmacie

74 route du Rhin

67401 ILLKIRCH

Tel : +33(0)3 68 85 41 84


--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: controlKeyDown within macro

Wayne Rasband-2
> 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
Reply | Threaded
Open this post in threaded view
|

Re: controlKeyDown within macro

CARL Philippe (LBP)
Dear Wayne,
Thanks a lot for your fast and efficient implementation.
Kindest regards,
Philippe

Le Mardi 26 Mars 2019 18:11 CET, Wayne Rasband <[hidden email]> a écrit:

> > 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

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