Skip to content

Commit 893d0b6

Browse files
authored
docs: update custom keybindings (#78)
1 parent 55faf79 commit 893d0b6

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

custom/config-shortcuts.md

+16
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,20 @@ With the setup, you can provide the custom setting for shortcuts mentioned in [N
2929

3030
The configuration function receives an object with some navigation methods, and returns an array containing some shortcut configuration. Refer to the type definitions for more details.
3131

32+
The `key` type only allows for strings, but you can still bind multiple keys by using following convention:
33+
34+
```ts
35+
import { defineShortcutsSetup, NavOperations } from '@slidev/types'
36+
37+
export default defineShortcutsSetup((nav: NavOperations) => {
38+
return [
39+
{
40+
key: 'ShiftLeft+ArrowRight',
41+
fn: () => nav.next(),
42+
autoRepeat: true,
43+
}
44+
]
45+
})
46+
```
47+
3248
Refer to [useMagicKeys | VueUse](https://vueuse.org/core/useMagicKeys/) for more details about key pressed event.

0 commit comments

Comments
 (0)