API reference › Rendering & Viewer
rasKeyStroke
Keyboard input for the viewer — real, narrow behavior:
TPDFCursor __stdcall rasKeyStroke(IPGC CachePtr, BOOL32 Down, uint32_t CharCode, uint32_t ShiftState);
function rasKeyStroke(CachePtr: IPGC; Down: LongBool; CharCode, ShiftState: Cardinal): TPDFCursor; stdcall;
Purpose. Keyboard input for the viewer — real, narrow behavior: Esc clears the current selection; Ctrl+A marquee-selects the whole current page.
Description. Acts only on key-down (if not Down then Exit) — key-up events are accepted but always no-op. Recognizes exactly two key combinations by hardcoded virtual-key/shift-mask constants (KEY_ESC = 27, KEY_A = 65, SS_CTRL = $04): Esc clears HasSel/Dragging/the cached selected-text buffer; Ctrl+A calls SelectWholePage(C) to select the entire current page as a device rect matching the page's own on-screen placement. No other key is handled — there is no text-input, arrow-key-scroll, or page-navigation keyboard handling anywhere in this function.
Parameters.
| Parameter | Description |
|---|---|
CachePtr | Target page cache. |
Down | False (key-up) is always a no-op. |
CharCode | Only 27 (Esc) and 65 (A, with Ctrl) have any effect. |
ShiftState | Only bit $04 (Ctrl) is checked, and only in combination with CharCode = 65. |
Return value. pcrArrow1 in all cases (including the two recognized key combinations — no cursor-shape change results from either).
C# (P/Invoke)
public static extern TPDFCursor rasKeyStroke(IntPtr CachePtr, [MarshalAs(UnmanagedType.Bool)] bool Down, uint CharCode, uint ShiftState);
Rasterizer/Rendering
rasKeyStroke
The …A form takes UTF-8, …W
takes UTF-16; a bare name aliases the ANSI form.
Worked examples — complete programs in ten languages.