Welcome Guest Search | Active Topics | Sign In | Register

EO.WebBrowser setup keyboard and mouse events Options
crenzi
Posted: Thursday, November 20, 2014 12:43:41 PM
Rank: Member
Groups: Member

Joined: 11/13/2014
Posts: 13
I am trying to setup the keyboard and mouse events, but they are not firing. I have the following code.

WpfWebControl Browser;
.
.
Browser.KeyDown+= W_KeyDown;
.
.
void W_KeyDown(object sender, System.Windows.Input.KeyEventArgs e)
{...}

The KeyDown event never gets raised.
The mouse events are setup the same way and are not working either.
Is there a different way I should approach this in order to detect key/mouse input within the browser control?
eo_support
Posted: Thursday, November 20, 2014 3:23:02 PM
Rank: Administration
Groups: Administration

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

You won't be able to handle the KeyDown event on the WebControl class. However you should be able to handle KeyDown event on the WebView class. For example:

Code: C#
Browser.WebView.KeyDown += W_KeyDown;


Note that the signature of the WebView.KeyDown event is different than the standard WPF KeyDown event. It does not particulate the standard WPF event bubbling process either. So you won't be able to cancel it like you do in WPF KeyDown event. If you are trying to implement hot keys, you should use the built in hot key support:

http://www.essentialobjects.com/doc/6/customize/hot_key.aspx

Hope this helps. Please feel free to let us know if you still have any more questions.

Thanks!
crenzi
Posted: Friday, November 21, 2014 10:06:19 AM
Rank: Member
Groups: Member

Joined: 11/13/2014
Posts: 13
Thanks. that works.
eo_support
Posted: Friday, November 21, 2014 10:57:28 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,217
You are very welcome. Please feel free to let us know if you have any more questions.

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.