Welcome Guest Search | Active Topics | Sign In | Register

how send keyboard correct? Options
lsl
Posted: Tuesday, April 19, 2016 11:27:23 PM
Rank: Member
Groups: Member

Joined: 1/14/2016
Posts: 28
hi support:

I want to send {Tab} to the webview , so I used next step:

1. webview.sendchar('\t') no effect
2. webview.sendkeyevent down{tab} sleep up{tab} it effect but the {tab} will be trigged random times

how do i send {tan} to the webview only one time? 3q!





second question:
how get the coordinate from any element? may be I can invoke webview.sendmouseevent after I get the coordinate , because sometimes a mouse click != getelemet****.click()
eo_support
Posted: Wednesday, April 20, 2016 8:20:51 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,229
Hi,

The number of time it will be triggered is related to the time delay between down and up event. There is no way to precisely control how many time it will be repeated though.

To get the coordination of an element, you will need to use JavaScript code and then use EvalScript to do that. The WebView does not have any built-in support for that.

Thanks!
lsl
Posted: Wednesday, April 20, 2016 10:13:58 AM
Rank: Member
Groups: Member

Joined: 1/14/2016
Posts: 28
eo_support wrote:
Hi,

The number of time it will be triggered is related to the time delay between down and up event. There is no way to precisely control how many time it will be repeated though.

To get the coordination of an element, you will need to use JavaScript code and then use EvalScript to do that. The WebView does not have any built-in support for that.

Thanks!



so can you tell me how send {tab} only one time?
and in my test when the webview i run wbview.evalscript , webview.send*** and I move the mouse together, the js script in evalscript will not run correct like xxx.value='111' no effect
eo_support
Posted: Wednesday, April 20, 2016 4:02:26 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,229
Hi,

Have you tried to call SendKeyEvent(up) immediately after SendKeyEvent(down)?

EvalScript should always work. If you have problem with that, please send a test project to us and we will investigate further.

Thanks!
joinyasin
Posted: Friday, July 1, 2016 7:25:45 AM
Rank: Member
Groups: Member

Joined: 3/17/2016
Posts: 12
Hi Administration
i want to know how i can disable keyboard on my webcontrol, simply i don't want to allow keyboard on browser so how i can disable keydown or keyboard
can you please give me a explained code
i have tryied these two method but both not working

private void MainBrowser_KeyDown(object sender, WndMsgEventArgs e)
{
return;
}
private void MainBrowser_KeyDown(object sender, EventArgs e)
{
return;
}

Thanks in advance
eo_support
Posted: Friday, July 1, 2016 7:50:40 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,229
joinyasin wrote:
Hi Administration
i want to know how i can disable keyboard on my webcontrol, simply i don't want to allow keyboard on browser so how i can disable keydown or keyboard
can you please give me a explained code
i have tryied these two method but both not working

private void MainBrowser_KeyDown(object sender, WndMsgEventArgs e)
{
return;
}
private void MainBrowser_KeyDown(object sender, EventArgs e)
{
return;
}

Thanks in advance


Hi,

You will not be able to do that. The browser engine's keyboard event handling is independent of your form's event handling. The only way to "eat up" the events is from within the page with JavaScript.

Thanks!
joinyasin
Posted: Saturday, July 2, 2016 7:42:50 AM
Rank: Member
Groups: Member

Joined: 3/17/2016
Posts: 12
i have notice that this event detect key down but this webview1.keydown event not have handle and cancal method

private void WebView1_KeyDown(object sender, System.EventArgs e)
{
MessageBox.Show("keyDown");
}

can you please add e.handled or e.cancal in this event in next release
eo_support
Posted: Saturday, July 2, 2016 7:26:03 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,229
joinyasin wrote:
i have notice that this event detect key down but this webview1.keydown event not have handle and cancal method

private void WebView1_KeyDown(object sender, System.EventArgs e)
{
MessageBox.Show("keyDown");
}

can you please add e.handled or e.cancal in this event in next release


As we have already mentioned in our previous reply, there is no way to cancel the keyboard events this way. These event occurs inside the browser engine and it does not follow the normal Windows Forms event architecture. It follows the browser engine's own event architecture, that is the JavaScript event bubbling and capturing model. Everything you want to do with the vent has to be done in that world. The most your .NET side code can do is to "see" and "observe" the events.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.