Welcome Guest Search | Active Topics | Sign In | Register

KeyUp event not firing Options
NRGSTREAM
Posted: Tuesday, December 22, 2015 12:29:56 PM
Rank: Member
Groups: Member

Joined: 9/1/2015
Posts: 23
Previously when I was using the .NET WebBrowser control, I had set KeyPreview=True and any keypress made in the form would fire the KeyUp event at form level. Since switching to EO.WebBrowser, neither form level KeyUp or WebControl KeyUp events are firing. Is there something I'm missing to turn these events on? The web pages displayed have no input controls on them so the event shouldn't be consumed there.

Version 2015.3.1
eo_support
Posted: Tuesday, December 22, 2015 1:35:06 PM
Rank: Administration
Groups: Administration

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

We do not have the equivalent of this event in the current build. The reason is because our EO.WebBrowser has a multi-process architecture (inherited from Chrome), so all the keyboard events actually occurs in a child process rather in your process. To support hotkeys, we do forward key down event from the child process to your process. However currently we do not forward key up event. What we can do is to add a key up event similar to this one:

http://www.essentialobjects.com/doc/eo.webbrowser.webview.keydown.aspx

Note that the event argument contains the raw data of a Windows message. You can search Windows SDK on those two messages (WM_KEYDOWN and WM_KEYUP) to get the exact meaning of WParam and LParam argument. Another key difference is you will not be able to cancel these key event. If you wish to cancel key events, you can inject JavaScript code into the WebView (either through WebView.EvalScript or WebView.JSInitCode) and then handle the keyboards event through JavaScript. In your JavaScript code, you will be able to cancel the event directly or even call .NET side code to determine whether you need to cancel the event.

Thanks!
NRGSTREAM
Posted: Tuesday, December 22, 2015 3:28:21 PM
Rank: Member
Groups: Member

Joined: 9/1/2015
Posts: 23
I can work with KeyDown. Thanks
eo_support
Posted: Tuesday, December 22, 2015 4:18:33 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,229
Great. Please feel free to let us know if there is anything else.


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.