[How To] Get the pressed key

To get the pressed key, you should follow the next steps:
If you need to run the event in a certain key, you should use the Condition property.
This will prevent that on each key pressed, will call the event on server.
Example for "Enter":
delphi code
Best Regards.
- Add new BrowserParam to event:
Example:
delphi codeprocedure TIWForm1.IWAppFormCreate(Sender: TObject);
begin
with IWCGJQEdit1.JQEvents.OnKeyPress.BrowserParams.Add do
begin
ServerName:= 'keypressed';
BrowserScript:= 'e.keyCode || e.which';
end;
end;
Note: You can add the new BrowserParam in design-time or run-time. - On KeyPress event, get the passed parameter:
Example:
delphi codeprocedure TIWForm1.IWCGJQEdit1JQEventsKeyPress(Sender: TObject; AParams: TStringList);
begin
WebApplication.ShowMessage(AParams.Values['keypressed']);
end;
If you need to run the event in a certain key, you should use the Condition property.
This will prevent that on each key pressed, will call the event on server.
Example for "Enter":
delphi code
procedure TIWForm1.IWAppFormCreate(Sender: TObject);
begin
with IWCGJQEdit1.JQEvents.OnKeyPress do
begin
Condition:= '((e.keyCode==13) || (e.which==13))'
end;
end;
Best Regards.