From: Rob Farrow

Subject: RE: Where's my Key-Down-Event?

Date: 2000-6-15 13:50


Ciske,

I have had this type of problem, too.  Windows is not very good a
managing keystrokes in a dialog.  It really isn't an ACL issue, they
just do what windows does normally.  As Francis said, the default-button
will encounter the enter keystroke.  So you just have to make sure you
have one on the dialog where the filename is typed.  It makes sense,
since the other option the user has is to click the default-button ("OK"
button) with the mouse.

If you don't want a button for some reason, you need to change the
focus.  You can use set-focus or clear-focus, I can't remember which.
The trick is finding which event you want trigger the focus change.  I
was able to use the mouse-out of a window, but that may not suit your
purposes.

The other approach is to go with the accept each keystroke style of
interaction -- then you get each character as the value changes.

Good luck,


Rob Farrow                             || There is no ultimate answer.
Phone: 972/480-2698 MSGID: RCFJ        || Only more revealing ways
Email: <ti.com at farrow>                   || of looking at the question.
NOT SPEAKING FOR TEXAS INSTRUMENTS

Busch, Ciske writes:
> > Hi, > > thank your for your suggestion... >
> > >(I tried to solve this by using a static text and opening > > >a temporary editable-text at the same position after the > > >user clicked into the static-text. Removing the editable-text > > >works fine when using mouse-clicks but not when pressing > > >enter or tab.)
> > > > Looks too twisted to be a good solution. I think you just > > should use an > > editable-text with the following arguments: > > (make-instance 'editable-text > > :background-color light-gray > > :border :none > > ... ) > >
> > >Unfortunatly I do not know how to move the keyboard focus > > >away from that control after the user has finished editing.
> > > > You should not have to bother about focus here.
> > ... but if I cannot move the keyboard focus away from the control how can I > stop the user from changing the text? If I use your suggested solution any > keyboard entry will change the text once the control has been "activated". > > What I want to achieve is a control that behaves like a "filename"-thingy in > windows which a user can click on to edit and which gives keyboard focus > back to it's parent after the user pressed ENTER. The only way I know to > recognize the ENTER key would be to use a multi-line-editable-text and check > for newlines. BUT this control always has a 3d-border which I can not get > rid of (at least not by using the :border argument). > > And there may just be one control in the parent-dialog - so I can not just > "tab" over to another control. > > ciske busch > >