Docs PDFiumVCL

OnKeyDown event

Esta entrada API preserva identificadores, assinaturas, blocos de código e termos PDF em sua forma original.
Component: TPdfView  ·  Unit: PDFium
Fired when a key is pressed while the control has focus.

Syntax

property OnKeyDown: TKeyEvent;

Description

Fired when a key is pressed while the control has focus. The Sender parameter references the TPdfView instance that raised the event, so a single handler can serve multiple views by inspecting Sender.

Typical uses include: intercept arrow keys / Page Up / Page Down to drive navigation, Ctrl+F to open a search dialog, or Escape to clear a selection. Because the handler runs on the VCL main thread, you can update form controls and call other VCL APIs directly.

Handlers must return quickly — PDFium rendering and form filling occur on the same thread, and any delay here postpones the next page repaint.

Remarks

Example

procedure TForm1.PdfViewOnKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
begin
  // intercept arrow keys / Page Up / Page Down to drive navigation, Ctrl+F to open a search dialog, or Escape to clear a selection
  Caption := Format('OnKeyDown on page %d', [PdfView1.PageNumber]);
end;

See Also

OnClick, OnPageChange, OnMouseDown, PageNumber