Skip to content

Commit

Permalink
feat: ✨ Allow horizontal scrolling when Shift is the trigger key.
Browse files Browse the repository at this point in the history
Works both for left shift and right shift.
  • Loading branch information
nicojeske committed Feb 26, 2024
1 parent 9442495 commit 342f294
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down

0 comments on commit 342f294

Please sign in to comment.