PDFium Component Docs

OnKeyPress event

Composant: TPdfView  ·  Module: PDFium
Fired for each character generated by the keyboard.

Syntax

property OnKeyPress: TKeyPressEvent;

Description

Fired for each character generated by the keyboard. The Sender parameter references the TPdfView instance à l’origine de l’événement, afin qu’un seul gestionnaire puisse servir plusieurs vues en inspectant Sender.

Typical uses include: filter or transform typed characters before they reach text-selection or form-field handlers. Because the handler runs on the VCL main thread, you can update form controls and call other VCL APIs directly.

Les gestionnaires doivent répondre rapidement — le rendu PDFium et le remplissage de formulaires s’exécutent sur le même thread, et tout délai ici retarde le prochain rafraîchissement de la page

Remarks

Example

procedure TForm1.PdfViewOnKeyPress(Sender: TObject; var Key: Char);
begin
  // filter or transform typed characters before they reach text-selection or form-field handlers
  Caption := Format('OnKeyPress on page %d', [PdfView1.PageNumber]);
end;

See Also

OnClick, OnPageChange, OnMouseDown, PageNumber