Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
inputdlg

Subject: inputdlg

From: Jessica

Date: 25 Jun, 2008 12:30:21

Message: 1 of 3

Hi,

I am using the inputdlg command to create boxes that pop-up
on the screen. As it is, after a value is typed into the
box, I must press the “OK” button with a mouse click. Is
there a way to “press OK” by just hitting the enter button
on the keyboard?

Thanks!

Subject: inputdlg

From: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)

Date: 25 Jun, 2008 16:57:32

Message: 2 of 3

In article <g3tdot$i4f$1@fred.mathworks.com>,
Jessica <jyorzinski@ucdavis.edu> wrote:

>I am using the inputdlg command to create boxes that pop-up
>on the screen. As it is, after a value is typed into the
>box, I must press the “OK” button with a mouse click. Is
>there a way to “press OK” by just hitting the enter button
>on the keyboard?

Yes and No.

You can get the effect of pressing OK without clicking on the OK
button. However, in order to do so, you must remove the focus from
any of the input boxes. You can do that by pressing the tab key
until you are not positioned over one of the input boxes.
If that places you over one of the buttons, then if you press return
then that button will be "pressed". The first button will -probably-
be the OK button; if you end up over the wrong button you can
press tab more until you get to the OK button before pressing return.

Alternately if you remove focus from the edit boxes by clicking in
the figure outside of the edit boxes, and then press return, then
the default button action result be taken (usually the OK button.)
If your intent is to keep your hand off of the mouse then this
would not be suitable; if the difficulty is just in the amount of
mouse-travel to get to OK then this would work.
--
  "I will not approve any plan which is based on the old principle
  of build now and repair later." -- Walter Hickle

Subject: inputdlg

From: Jessica

Date: 26 Jun, 2008 03:21:02

Message: 3 of 3

roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson) wrote in
message <g3ttds$7v3$1@canopus.cc.umanitoba.ca>...
> In article <g3tdot$i4f$1@fred.mathworks.com>,
> Jessica <jyorzinski@ucdavis.edu> wrote:
>
> >I am using the inputdlg command to create boxes that pop-up
> >on the screen. As it is, after a value is typed into the
> >box, I must press the “OK” button with a mouse click. Is
> >there a way to “press OK” by just hitting the enter button
> >on the keyboard?
>
> Yes and No.
>
> You can get the effect of pressing OK without clicking on
the OK
> button. However, in order to do so, you must remove the
focus from
> any of the input boxes. You can do that by pressing the
tab key
> until you are not positioned over one of the input boxes.
> If that places you over one of the buttons, then if you
press return
> then that button will be "pressed". The first button will
-probably-
> be the OK button; if you end up over the wrong button you can
> press tab more until you get to the OK button before
pressing return.
>
> Alternately if you remove focus from the edit boxes by
clicking in
> the figure outside of the edit boxes, and then press
return, then
> the default button action result be taken (usually the OK
button.)
> If your intent is to keep your hand off of the mouse then this
> would not be suitable; if the difficulty is just in the
amount of
> mouse-travel to get to OK then this would work.
> --
> "I will not approve any plan which is based on the old
principle
> of build now and repair later." --
Walter Hickle


Thanks for this tip. I found software online that I can use
to program the return keystroke to actually be the tab key
followed by the return key. Thus, no mouse is required!

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us