Skip to content

Commit

Permalink
Merge pull request #43 from nicojeske/feat/38-ShiftScroll
Browse files Browse the repository at this point in the history
feat: ✨ Allow horizontal scrolling when Shift is the trigger key.
  • Loading branch information
nicojeske authored Feb 26, 2024
2 parents 9442495 + 342f294 commit c362de3
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 c362de3

Please sign in to comment.