From 45e6aa54c94c895ec8a2aa162c32eae4375cfe7e Mon Sep 17 00:00:00 2001 From: Md Sajjadur Rahaman Date: Mon, 12 Aug 2024 19:32:21 +0800 Subject: [PATCH] feat: add Meta key support for accumulation function The accumulation function now recognizes `Meta` key presses in addition to the `Control` key. This change enhances cross-platform compatibility, particularly for Mac users who use the `Meta` key for similar operations. --- src/extensions/selectable.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/extensions/selectable.ts b/src/extensions/selectable.ts index 2b55121..9e9728a 100644 --- a/src/extensions/selectable.ts +++ b/src/extensions/selectable.ts @@ -11,10 +11,10 @@ export function accumulateOnCtrl() { let pressed = false function keydown(e: KeyboardEvent) { - if (e.key === 'Control') pressed = true + if (e.key === 'Control' || e.key === 'Meta') pressed = true } function keyup(e: KeyboardEvent) { - if (e.key === 'Control') pressed = false + if (e.key === 'Control' || e.key === 'Meta') pressed = false } document.addEventListener('keydown', keydown)