Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

About KeyEvent Solution! #4

Open
jerviscui opened this issue Jul 11, 2016 · 2 comments
Open

About KeyEvent Solution! #4

jerviscui opened this issue Jul 11, 2016 · 2 comments

Comments

@jerviscui
Copy link

Hi! Man

I find a solution for the ChromiumWebBrowser KeyEvent with WinForm.

I read the blog http://www.codeproject.com/Articles/990346/Using-HTML-as-UI-Elements-in-a-WinForms-Applicatio, and you refer

[As a side-note, I initially attempted to catch the F12 key on the form, however even with KeyPreview set to true, it seemed Chrome caught all key strokes and the key preview was never caught by the WinForm class.]

  1. bind the PreviewKeyDown event and set the KeyboardHandler to a Class which implement IKeyboardHandler
  2. in IKeyboardHandler.OnPreKeyEvent(IWebBrowser browserControl,...) method, I call the Control.PreProcessControlMessage(ref Message msg) for send message to the PreviewKeyDown event
  3. Just OK.
Mail to me, friend.
@OceanAirdrop
Copy link
Owner

Hi Jerviscui.

Thanks for your note and this info. That's great. When I am next in this project area I will update the code with your solution.

@jerviscui
Copy link
Author

Excuse me!
Can you tell me how to trigger KeyPressEvent by CefSharp, I want IKeyboardHandler execute that, but doesn't work.
Do you have any good idea?
Thx.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants