Skip to content

PressKeyParams

Parameters for CommonArguments.pressKey.

Import:

import type { PressKeyParams } from 'obsidian-integration-testing';

Signature:

export interface PressKeyParams

Properties

PropertyTypeDescription
keystringThe key to press, given as an Electron Accelerator key name — e.g. 'Enter', 'Escape', 'Tab', 'Backspace', 'Delete', an arrow key ('Up' / 'Down' / 'Left' / 'Right'), or a printable character ('a', '1'). The produced character (when the key inserts text) is the literal key value; case-correct text belongs to CommonArguments.typeIntoEditor, not a key-press primitive.
modifiers?readonly Modifier[]The modifier keys to hold while the key is pressed, using Obsidian's Modifier names (the same values as an Obsidian Hotkey). 'Mod' resolves per-platform (Cmd on macOS, Ctrl elsewhere); each is mapped to Electron's lowercase sendInputEvent modifier name.