Moon-0xff / gnome-mpris-label

A music related GNOME extension.
GNU General Public License v3.0
50 stars 9 forks source link

Add change track functionality to scroll #91

Closed RozeFound closed 5 months ago

RozeFound commented 5 months ago

While side buttons is pretty comfortable to use in this scenario, I myself is more used to quick changing tracks by simply scrolling through. I can work on this feature myself if you're willing to accept my PR.

Batwam commented 5 months ago

Thanks for the suggestion. Yes, you can give it a go. I'd suggest adding it to the drop down in pref.js let [scrollDropDown] = addDropDown(settings,group,'scroll-action','Scroll up/down',{'volume control':'volume-controls','none':'none'},undefined,140);

On thing to note, the scroll event from the mouse isn't (usually) a single event but rather a burst of 5,10 or even more steps of various amplitude depending on how long the use it scrolling and how quickly. This means that if you implement scroll positive = next song, you could easily be skipping 5 to 10 songs at a time. You would therefore to make sure you separate individual scrolls (either a minimum time between separate actions and/or detect when a scroll has ended). Laptop trackpads may also behave slightly differently than mouse scroll wheels.

Hopefully that makes sense? If you log the values and do some tests I'm sure it will become obvious.

Batwam commented 5 months ago

Thanks for your contribution, keep them coming if you find anything else!