Board index » delphi » The OnEnter Event: Can I just return the "enter" character?

The OnEnter Event: Can I just return the "enter" character?

I have to work with a widget that has an OnEnter event on an ActiveX
control (TWebBrowser).

Problem is, that the Enter key doesn't echo in a web form which has a
text box. I suspect that is because an OnEnter event exists on the web
browser control which takes the event and does nothing if there is no
code for it.

What I want to do is write a routine that uses the OnEnter event to
echo back the carriage return. OnEnter doesn't accept functions, and I
am not sure how to grab hold of the same stream that the WebBrowser's
text box is on to echo the character. Any ideas?

 

Re:The OnEnter Event: Can I just return the "enter" character?


"Apply ROT13 to decode email address" <kbto...@ubgznvy.pbz> skrev i melding
news:f3uekugak1bfal634b7jv7h04c0k57tn89@4ax.com...

Quote
> I have to work with a widget that has an OnEnter event on an ActiveX
> control (TWebBrowser).

> Problem is, that the Enter key doesn't echo in a web form which has a
> text box. I suspect that is because an OnEnter event exists on the web
> browser control which takes the event and does nothing if there is no
> code for it.

> What I want to do is write a routine that uses the OnEnter event to
> echo back the carriage return. OnEnter doesn't accept functions, and I
> am not sure how to grab hold of the same stream that the WebBrowser's
> text box is on to echo the character. Any ideas?

Maybe you've misunderstood the OnEnter event - it's triggered whenever a
control receives input focus, not when Enter key is pressed...

--
Bj?rge S?ther
bjorge@hahaha_itte.no

Re:The OnEnter Event: Can I just return the "enter" character?


That still doesn't answer the basic problem: how to get the "Enter"
keypress to echo on to a web form inside TWebBrowser?

On Wed, 31 Jul 2002 15:03:04 GMT, "Bj?rge S?ther"

Quote
<bjorge@hahaha_itte.no> wrote:
>"Apply ROT13 to decode email address" <kbto...@ubgznvy.pbz> skrev i melding
>news:f3uekugak1bfal634b7jv7h04c0k57tn89@4ax.com...
>> I have to work with a widget that has an OnEnter event on an ActiveX
>> control (TWebBrowser).

>> Problem is, that the Enter key doesn't echo in a web form which has a
>> text box. I suspect that is because an OnEnter event exists on the web
>> browser control which takes the event and does nothing if there is no
>> code for it.

>> What I want to do is write a routine that uses the OnEnter event to
>> echo back the carriage return. OnEnter doesn't accept functions, and I
>> am not sure how to grab hold of the same stream that the WebBrowser's
>> text box is on to echo the character. Any ideas?

>Maybe you've misunderstood the OnEnter event - it's triggered whenever a
>control receives input focus, not when Enter key is pressed...

Re:The OnEnter Event: Can I just return the "enter" character?


On Wed, 31 Jul 2002 12:46:26 -0400, Apply ROT13 to decode email

Quote
address <cxvat...@flzcngvpb.pn> wrote:
>That still doesn't answer the basic problem: how to get the "Enter"
>keypress to echo on to a web form inside TWebBrowser?

<snip>

No, but it has pointed you away from a dead end
- and means that I can now get a vague grasp of what your original
post was all about.

1) What version of Delphi are you using ?

2) Which TWebBrowser ?

3) Are you sure that the Text area that you are filling in is
multiline - I assume that it is an HTML page that is generating the
'Textbox'

This is a TextArea :-

<textarea name="Q2EX" rows="2" cols="40">
</textarea>

I can't think of anything else that will allow CrLf in an entry field

Re:The OnEnter Event: Can I just return the "enter" character?


On Wed, 31 Jul 2002 17:49:33 GMT, Bounce_It_je...@iss.u-net.com (J

Quote
French) wrote:
>On Wed, 31 Jul 2002 12:46:26 -0400, Apply ROT13 to decode email
>address <cxvat...@flzcngvpb.pn> wrote:

>>That still doesn't answer the basic problem: how to get the "Enter"
>>keypress to echo on to a web form inside TWebBrowser?

><snip>

>No, but it has pointed you away from a dead end
>- and means that I can now get a vague grasp of what your original
>post was all about.

>1) What version of Delphi are you using ?

Version 6.

Quote
>2) Which TWebBrowser ?

It doesn't matter, actually. I have had this problem with both the
stock TWebBrowser and my own installed ActiveX TMSWebBrowser, based on
IE6.

Quote

>3) Are you sure that the Text area that you are filling in is
>multiline - I assume that it is an HTML page that is generating the
>'Textbox'

It is indeed multiline. "Enter" doesn't echo, while CTRL+M (the ASCII
equivalent) works.

Quote

>This is a TextArea :-

><textarea name="Q2EX" rows="2" cols="40">
></textarea>

Mine used:

<textarea name="foobar" cols="60" rows="15"></textarea>

Quote

>I can't think of anything else that will allow CrLf in an entry field

Re:The OnEnter Event: Can I just return the "enter" character?


It's a known problem with TWebbrowser, I believe a component called
Wbembedded or something similar claims to fix all related problems like
pressing enter and using the scrollwheel.

Cheers,
Nick

"Apply ROT13 to decode email address" <cxvat...@flzcngvpb.pn> wrote in
message news:ir3gku41rht6rapr2m22rr8nueahhfmf9l@4ax.com...

Quote
> That still doesn't answer the basic problem: how to get the "Enter"
> keypress to echo on to a web form inside TWebBrowser?

> On Wed, 31 Jul 2002 15:03:04 GMT, "Bj?rge S?ther"
> <bjorge@hahaha_itte.no> wrote:

> >"Apply ROT13 to decode email address" <kbto...@ubgznvy.pbz> skrev i
melding
> >news:f3uekugak1bfal634b7jv7h04c0k57tn89@4ax.com...
> >> I have to work with a widget that has an OnEnter event on an ActiveX
> >> control (TWebBrowser).

> >> Problem is, that the Enter key doesn't echo in a web form which has a
> >> text box. I suspect that is because an OnEnter event exists on the web
> >> browser control which takes the event and does nothing if there is no
> >> code for it.

> >> What I want to do is write a routine that uses the OnEnter event to
> >> echo back the carriage return. OnEnter doesn't accept functions, and I
> >> am not sure how to grab hold of the same stream that the WebBrowser's
> >> text box is on to echo the character. Any ideas?

> >Maybe you've misunderstood the OnEnter event - it's triggered whenever a
> >control receives input focus, not when Enter key is pressed...

Re:The OnEnter Event: Can I just return the "enter" character?


See my response under the subject line:

"Re: TWebBrowser: Can I just return the "enter" character? (WAS: The
OnEnter Event ...)"

On Wed, 31 Jul 2002 17:49:33 GMT, Bounce_It_je...@iss.u-net.com (J

Quote
French) wrote:
>On Wed, 31 Jul 2002 12:46:26 -0400, Apply ROT13 to decode email
>address <cxvat...@flzcngvpb.pn> wrote:

>>That still doesn't answer the basic problem: how to get the "Enter"
>>keypress to echo on to a web form inside TWebBrowser?

><snip>

>No, but it has pointed you away from a dead end
>- and means that I can now get a vague grasp of what your original
>post was all about.

>1) What version of Delphi are you using ?

>2) Which TWebBrowser ?

>3) Are you sure that the Text area that you are filling in is
>multiline - I assume that it is an HTML page that is generating the
>'Textbox'

>This is a TextArea :-

><textarea name="Q2EX" rows="2" cols="40">
></textarea>

>I can't think of anything else that will allow CrLf in an entry field

Re:The OnEnter Event: Can I just return the "enter" character?


I see,

are there any other controls on the Form in which you have your
TWebBrowser ?

Typically a TButton with its Default property set to True

Also is your Form's KeyPreview property set to True
- maybe you can track what is actually happening through that.

One thing I would do is run up a new project with just the TWebBrowser
on it - no other controls - and watch its behaviour.

On Wed, 31 Jul 2002 13:54:52 -0400, Apply ROT13 to decode email

Quote
address <cxvat...@flzcngvpb.pn> wrote:
>On Wed, 31 Jul 2002 17:49:33 GMT, Bounce_It_je...@iss.u-net.com (J
>French) wrote:

>>On Wed, 31 Jul 2002 12:46:26 -0400, Apply ROT13 to decode email
>>address <cxvat...@flzcngvpb.pn> wrote:

>>>That still doesn't answer the basic problem: how to get the "Enter"
>>>keypress to echo on to a web form inside TWebBrowser?

>><snip>

>>No, but it has pointed you away from a dead end
>>- and means that I can now get a vague grasp of what your original
>>post was all about.

>>1) What version of Delphi are you using ?

>Version 6.

>>2) Which TWebBrowser ?

>It doesn't matter, actually. I have had this problem with both the
>stock TWebBrowser and my own installed ActiveX TMSWebBrowser, based on
>IE6.

>>3) Are you sure that the Text area that you are filling in is
>>multiline - I assume that it is an HTML page that is generating the
>>'Textbox'

>It is indeed multiline. "Enter" doesn't echo, while CTRL+M (the ASCII
>equivalent) works.

>>This is a TextArea :-

>><textarea name="Q2EX" rows="2" cols="40">
>></textarea>

>Mine used:

><textarea name="foobar" cols="60" rows="15"></textarea>

>>I can't think of anything else that will allow CrLf in an entry field

Other Threads