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.
If you find these projects useful please consider becoming a sponsor with Patreon, GitHub or Liberapay.

SendKeyEvent does not sent a .(point)

Post Reply
micmorozov
Posts: 18
Joined: Mon Oct 07, 2019 7:53 am

SendKeyEvent does not sent a .(point)

Post by micmorozov »

Hello!

i need to send a text to CEF. I do it as follows:

Code: Select all

New(event);
  try
    event.focus_on_editable_field:= 1;
    event.is_system_key:= 0;
    event.modifiers:= EVENTFLAG_NONE;
    event.windows_key_code := Ord(tmp);
    event.native_key_code := Ord(tmp);
    event.character := #0;
    event.unmodified_character := #0;

    event.kind:= KEYEVENT_RAWKEYDOWN;
    ASurfWebBrowserChr.Browser.Host.SendKeyEvent(event);
    event.kind:= KEYEVENT_CHAR;
    ASurfWebBrowserChr.Browser.Host.SendKeyEvent(event);
    event.kind:= KEYEVENT_KEYUP;
    ASurfWebBrowserChr.Browser.Host.SendKeyEvent(event);
  finally
    Dispose(event);
  end;
Еeverything works well, but if tmp='.'; then the point is not displayed in the browser.
Why? How does a dot differ from a comma, for example?

Thanks
User avatar
salvadordf
Posts: 4572
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: SendKeyEvent does not sent a .(point)

Post by salvadordf »

Hi,

I haven't tried sending a dot but I just tested the SimpleOSRBRowser demo to see if there was a problem with that particular character and it worked fine.

Run that demo and log all the event information sent to the browser when you press that key. Use the TForm1.AppEventsMessage procedure to log all that information and you will get all the event parameters you need to use TChromium.SendKeyEvent
Post Reply