Skip to content

Commit 01a3567

Browse files
committed
doc: keyboardActions
1 parent 4373c4c commit 01a3567

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

docs/guide/config.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -330,9 +330,15 @@ keyboardActions: {
330330
}
331331
```
332332

333-
Configure keyboard actions. It is a map defining key code->action. (all the available actions are listed above)
333+
Configure keyboard actions. It is a map defining key code->action. The key can include modifiers like `Ctrl`, `Shift`, `Alt` or `Meta` separated with a `+` symbol.
334334

335-
You can also configure an arbitrary callback to any key (including modifiers `Ctrl`,`Shift`,`Alt`,`Meta`), it receives the viewer itself and the original keyboard event as parameters.
335+
::: tip
336+
Use [Key.js](https://keyjs.dev/) wbesite to determine exact combination of a keystroke.
337+
338+
_Note:_ Use `Plus` instead of `+` when configuring the plus key with a modifier, for example `Shift+Plus`.
339+
:::
340+
341+
You can also configure an arbitrary callback to any key, it receives the viewer itself and the original keyboard event as parameters.
336342

337343
```js:line-numbers
338344
import { DEFAULTS } from '@photo-sphere-viewer/core';

packages/core/src/utils/browser.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,9 @@ export function keyPressMatch(e: KeyboardEvent, pattern: string) {
217217
case 'Meta':
218218
meta = true;
219219
break;
220+
case 'Space':
221+
key = ' ';
222+
break;
220223
case 'Plus':
221224
key = '+';
222225
break;

0 commit comments

Comments
 (0)