From 342f2946d02fab28e7ebdc9f892b65e17fb79739 Mon Sep 17 00:00:00 2001 From: Nico Jeske Date: Mon, 26 Feb 2024 21:41:54 +0100 Subject: [PATCH] feat: :sparkles: Allow horizontal scrolling when Shift is the trigger key. Works both for left shift and right shift. --- main.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/main.ts b/main.ts index a6f3e57..4c33c3b 100644 --- a/main.ts +++ b/main.ts @@ -60,7 +60,11 @@ export default class MouseWheelZoomPlugin extends Plugin { this.registerDomEvent(doc, "keydown", (evt) => { if (evt.code === this.settings.modifierKey.toString()) { this.isKeyHeldDown = true; - this.disableScroll(currentWindow); + + if (this.settings.modifierKey !== ModifierKey.SHIFT && this.settings.modifierKey !== ModifierKey.SHIFT_RIGHT) { // Ignore shift to allow horizontal scrolling + // Disable the normal scrolling behavior when the key is held down + this.disableScroll(currentWindow); + } } }); this.registerDomEvent(doc, "keyup", (evt) => {