pdfViewerDefaultShortcuts top-level property

Map<ShortcutActivator, Intent> pdfViewerDefaultShortcuts
final

The viewer's stock key bindings (PdfViewer.shortcuts defaults to these). Every intent is listed for both ⌘ (macOS, iOS) and Ctrl. The editing ones do nothing - and let the key through - without an editing session; the tool keys (PdfViewer.toolShortcuts) are bound on top.

Copy it to rebind a key:

PdfViewer(
  shortcuts: {
    ...pdfViewerDefaultShortcuts,
    // Backspace no longer deletes; ⌘D does
    const SingleActivator(LogicalKeyboardKey.backspace):
        const DoNothingAndStopPropagationIntent(),
    const SingleActivator(LogicalKeyboardKey.keyD, meta: true):
        const PdfDeleteSelectionIntent(),
  },
)

Implementation

final Map<ShortcutActivator, Intent> pdfViewerDefaultShortcuts =
    Map.unmodifiable(<ShortcutActivator, Intent>{
  const SingleActivator(LogicalKeyboardKey.keyC, meta: true):
      const PdfCopyIntent(),
  const SingleActivator(LogicalKeyboardKey.keyC, control: true):
      const PdfCopyIntent(),
  const SingleActivator(LogicalKeyboardKey.keyA, meta: true):
      const PdfSelectAllIntent(),
  const SingleActivator(LogicalKeyboardKey.keyA, control: true):
      const PdfSelectAllIntent(),
  const SingleActivator(LogicalKeyboardKey.escape): const PdfDismissIntent(),
  const SingleActivator(LogicalKeyboardKey.keyZ, meta: true):
      const PdfUndoIntent(),
  const SingleActivator(LogicalKeyboardKey.keyZ, control: true):
      const PdfUndoIntent(),
  const SingleActivator(LogicalKeyboardKey.keyZ, alt: true):
      const PdfAutosizeTextBoxIntent(),
  const SingleActivator(LogicalKeyboardKey.keyZ, meta: true, shift: true):
      const PdfRedoIntent(),
  const SingleActivator(LogicalKeyboardKey.keyZ, control: true, shift: true):
      const PdfRedoIntent(),
  const SingleActivator(LogicalKeyboardKey.keyY, control: true):
      const PdfRedoIntent(),
  const SingleActivator(LogicalKeyboardKey.keyX, meta: true):
      const PdfCutIntent(),
  const SingleActivator(LogicalKeyboardKey.keyX, control: true):
      const PdfCutIntent(),
  const SingleActivator(LogicalKeyboardKey.keyV, meta: true):
      const PdfPasteIntent(),
  const SingleActivator(LogicalKeyboardKey.keyV, control: true):
      const PdfPasteIntent(),
  const SingleActivator(LogicalKeyboardKey.delete):
      const PdfDeleteSelectionIntent(),
  const SingleActivator(LogicalKeyboardKey.backspace):
      const PdfDeleteSelectionIntent(),
  const SingleActivator(LogicalKeyboardKey.arrowLeft):
      const PdfNudgeSelectionIntent(-_nudge, 0),
  const SingleActivator(LogicalKeyboardKey.arrowRight):
      const PdfNudgeSelectionIntent(_nudge, 0),
  const SingleActivator(LogicalKeyboardKey.arrowUp):
      const PdfNudgeSelectionIntent(0, -_nudge),
  const SingleActivator(LogicalKeyboardKey.arrowDown):
      const PdfNudgeSelectionIntent(0, _nudge),
  const SingleActivator(LogicalKeyboardKey.arrowLeft, shift: true):
      const PdfNudgeSelectionIntent(-_nudgeCoarse, 0),
  const SingleActivator(LogicalKeyboardKey.arrowRight, shift: true):
      const PdfNudgeSelectionIntent(_nudgeCoarse, 0),
  const SingleActivator(LogicalKeyboardKey.arrowUp, shift: true):
      const PdfNudgeSelectionIntent(0, -_nudgeCoarse),
  const SingleActivator(LogicalKeyboardKey.arrowDown, shift: true):
      const PdfNudgeSelectionIntent(0, _nudgeCoarse),
});