1
0
Fork 0
mirror of https://github.com/codex-team/codex.docs.git synced 2025-08-10 07:55:24 +02:00

metakey added

This commit is contained in:
Umang G. Patel 2022-07-25 21:27:13 +05:30
parent f0225b8c8d
commit 46669dcfef

View file

@ -214,8 +214,8 @@ export default class Sidebar {
* @param {KeyboardEvent} e - keyboard event. * @param {KeyboardEvent} e - keyboard event.
*/ */
keyboardListener(e) { keyboardListener(e) {
// If Ctrl + P is pressed, focus search input. // If Ctrl+P or ⌘+P is pressed, focus search input.
if (e.ctrlKey && e.code === 'KeyP') { if ((e.ctrlKey || e.metaKey) && e.code === 'KeyP') {
this.nodes.search.focus(); this.nodes.search.focus();
e.preventDefault(); e.preventDefault();
} }