Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.

SendKeyEvent

Post Reply
alpires2000
Posts: 48
Joined: Sat Dec 09, 2017 4:40 pm

SendKeyEvent

Post by alpires2000 »

Hi Salvador,
In CEF I use Chromium1.SendKeyEvent to send a keyboard event to the browser, there is something similar in WebView4?
Thanks
User avatar
salvadordf
Posts: 4079
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: SendKeyEvent

Post by salvadordf »

Hi,

Try using TWVBrowserBase.SimulateKeyEvent.

Read the code comments for that function. It uses the "Input.dispatchKeyEvent" DevTools method :
https://chromedevtools.github.io/devtools-protocol/1-3/Input/#method-dispatchKeyEvent

See the TWVBrowserBase.KeyboardShortcutSearch and TWVBrowserBase.KeyboardShortcutRefreshIgnoreCache functions as an example.
I used the SimpleOSRBrowser demo in CEF4Delphi to get the KeyCode parameter values ;)
Post Reply