WindowsKeystrokeCommand
Extends: KeystrokeCommand
Object representing a Windows keystroke command.
For example, use when performing a NVDA command:
import { nvda, WindowsModifiers } from "@guidepup/guidepup";
const exclamationMarkSymbolKeystrokeCommand = {
characters: "1",
modifiers: [WindowsModifiers.SHIFT],
description: "A pound symbol",
representation: "!",
};
(async () => {
// Start NVDA.
await nvda.start();
// Send a '!' keystroke.
await nvda.perform(exclamationMarkSymbolKeystrokeCommand);
// Stop NVDA.
await nvda.stop();
})();
Note: the above is slightly contrived as we could just type a
!
character using:await nvda.type("!");
Contents:
- windowsKeystrokeCommand.characters
- windowsKeystrokeCommand.description
- windowsKeystrokeCommand.modifiers
- windowsKeystrokeCommand.representation
windowsKeystrokeCommand.characters
The character(s) to send.
Type: string
windowsKeystrokeCommand.description
Optional: Description of the action the keystroke performs.
Type: string
windowsKeystrokeCommand.modifiers
Optional: List of modifier keys to press while sending the character(s).
Type: Array<WindowsModifiers>
windowsKeystrokeCommand.representation
Optional: Symbolic representation of the character(s) and modifier keys this command uses.
Type: string