blockbench icon indicating copy to clipboard operation
blockbench copied to clipboard

Add scrolling support to NumSlider

Open Ampflower opened this issue 2 years ago • 1 comments

This PR aims to add scrolling support to NumSlider.

I am only opening this as a draft for now for some input as this isn't complete.

  • [x] Supports Chromium, Firefox, Epiphany
    • Note, some specific hackery was added for Epiphany. Someone with a MacOS machine would need to validate the following for Safari:
      • [ ] Shift + scrolling up correctly follows normally scrolling up, and vice-versa.
    • Some hackery was added for Firefox to tell it apart from a touchpad, as its deltaY isn't consistent between scrolling up & down.
  • [x] Has specific touchpad support
    • [ ] Has a way to adjust sensitivity
    • [x] This includes detecting one to allow for fine adjustments with the scroll gesture.
  • [ ] Has a way to reverse scrolling direction
    • This is necessary for natural scrolling. Safari on MacOS has a way to detect this, however no other browser and OS combination can. The best option is to give a way to flip the direction for this.

It is self-resetting to allow a device switch without feeling horrendous, unless you happen to switch to a mouse without leaving the slider.

I shall note that it does make a change to the backing data structure to coerce to an integer via |0, which I realise may break the modeller (although surprisingly doesn't?) and plugins expecting to allow non-integer input.

This does also introduce a check for bare WebKit specifically for Epiphany, as it is just detected as bare Electron otherwise.

Ampflower avatar Oct 26 '23 06:10 Ampflower

Notable that scrolling fast does cause it to switch into thinking that you're using a touchpad; that is something to filter out.

Ampflower avatar Nov 04 '23 02:11 Ampflower