---
title: "keyboardShortcut command"
description: "Use the keyboardShortcut command in Tiptap to trigger a ShortcutEvent with a given name. Learn more in our docs!"
canonical_url: "https://tiptap.dev/docs/editor/api/commands/selection/keyboard-shortcut"
---

# keyboardShortcut command

Use the keyboardShortcut command in Tiptap to trigger a ShortcutEvent with a given name. Learn more in our docs!

The `keyboardShortcut` command will try to trigger a ShortcutEvent with a given name.

## Parameters

`name: String`

The name of the shortcut to trigger.

## Use the keyboardShortcut command

```js
editor.commands.keyboardShortcut('undo')
```
