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.

Send keys event dont work with dot

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

Send keys event dont work with dot

Post by alpires2000 »

Hi Guys, I need some help please. I am using this code to send keys to a form:

procedure TForm1.name(ref_name: string);
var
i: Integer;
TempKeyEvent: TCefKeyEvent;
begin
for i := 1 to length(ref_name) do
begin
// WM_KEYDOWN
TempKeyEvent.kind := KEYEVENT_RAWKEYDOWN;
TempKeyEvent.modifiers := 0;
TempKeyEvent.windows_key_code := ord(ref_name);
TempKeyEvent.native_key_code := 0;
TempKeyEvent.is_system_key := ord(false);
TempKeyEvent.character := #0;
TempKeyEvent.unmodified_character := #0;
TempKeyEvent.focus_on_editable_field := ord(false);
Chromium1.SendKeyEvent(@TempKeyEvent);

// WM_CHAR
TempKeyEvent.kind := KEYEVENT_CHAR;
Chromium1.SendKeyEvent(@TempKeyEvent);

// WM_KEYUP
TempKeyEvent.kind := KEYEVENT_KEYUP;
Chromium1.SendKeyEvent(@TempKeyEvent);
end;
end;

This code works well but not with dot (.)
Some idea how solve this issue?
Thanks
User avatar
salvadordf
Posts: 4040
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Send keys event dont work with dot

Post by salvadordf »

Hi,

Run the SimpleOSRBRowser demo and log the parameters passed with SendKeyEvent when you press the dot key.
Use TForm1.AppEventsMessage procedure to log that information and repeat it in your application.
alpires2000
Posts: 48
Joined: Sat Dec 09, 2017 4:40 pm

Re: Send keys event dont work with dot

Post by alpires2000 »

Thanks salvadordf, now works.
Post Reply