Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread Sending virtual Keystrokes
Tue, Nov 26 2019 11:00 PMPermanent Link

KimHJ

Comca Systems, Inc

Is there any way to send a virtual key to the control that have focus.

I tried Delphi keybd_event, but that is not a function in EWB .

This is how I send keystroke in my windows app, I get the handle using TWinControl.Handle, but none of this is available in EWB.

procedure SendDownChar(hwnd: THandle; ch: Char);
var
 lparam, wparam: Integer;
begin
 wparam := VkKeyScan(ch);
 lparam := 1;
 SendMessage(hwnd, WM_KEYDOWN, wparam, lparam);
end;

Thanks,
Kim
Wed, Nov 27 2019 2:54 AMPermanent Link

Walter Matte

Tactical Business Corporation

Kim

What are you trying to accomplish?  

You can trap KeyDownEvents and do things like move focus... you can fill in existing controls with edit1.text := edit1.text + 'A'; for example.

But Sending Keystrokes inside a Web Browse is probably a big security issue.  And I am pretty sure there are other way to do what you think you need to do by Sending Keystrokes....

Walter
Sun, Dec 1 2019 12:19 AMPermanent Link

KimHJ

Comca Systems, Inc

Walter Matte wrote:

>>What are you trying to accomplish?  

The application is for a Touchscreen so no keyboard and mouse is present, like a Kiosk.

I created a Dialog with a keyboard that will popup when a field is entered.

Then it looks like I have to copy the TEdit.text and add the letter that is pressed then add it back to the TEdit.text.

Thanks,
Kim
Image