Holding shift while scrolling should scroll horizontally

Presently, if you have a mouse with an ordinary one-dimension (up/down) scrollwheel, you can't use it to scroll horizontally. You have to drag the workspace, or use the horizontal scroll bar at the bottom of the screen. While these are perfectly natural ways to scroll to some, I think holding shift to scroll horizontally is probably the most well-understood way, so it should be added.

This sounds to me like an OS thing, no?

I’m not opposed to that idea but it seems like that’s a feature that should be consistent across the OS - AFAIK, Snap! Is just interpreting a horizontal scroll command. Though if this is another case of something that works in default web / system apps that we need to specifically account for, we should do it and do what each OS does.

It's something that works in default apps on basically every OS I know of. Technically, it's up to the browser to set the appropriate deltaX value on scroll events, but IIRC, at least in the case of Firefox, that doesn't necessarily happen. It's still something we ought to replicate, because basically every other program does, though.

FWIW, Snap! is relying on obsolete/deprecated events - both mousewheel and DOMMouseScroll, depending on the browser. We ought to be watching for the wheel event, which, yes, is supported by basically every browser.

1 Like

:+1: no argument there.

I was just hoping we could use a native API, but yeah, I suppose we should do this one.

Make a PR! I’ll review it. :face_with_monocle:

Sure, got it made! :tada: https://github.com/jmoenig/Snap/pull/2432

1 Like