I develop on Linux. In Compose Desktop, when I use...
# compose-desktop
h
I develop on Linux. In Compose Desktop, when I use the touch pad with two fingers, it produces a "Scroll" event. I get the same behavior when I use the mouse wheel. The delta values of x and y vary between -1 and 1. On the Web browser, the behavior is different. The delta values correspond to the distance traveled on the touchpad, which is much more precise but also generates many more events. Also, it doesn't seem possible to scroll horizontally, even when using the shift key. I'd like to see the scroll event behavior standardized between Compose Desktop and JS. I'd also like to have precise scroll movement on Desktop too. It's something that would be very useful to me. What do you think?
đź‘€ 3
âž• 3
a
It would be pretty difficult. We receive the events from the underlying environment, which is JVM/AWT on the desktop and the browser for JS.
And they’re heavily preprocessed by each. We have limited access to the “raw” scroll distance.
h
Thank you. I hope one day you'll be able to get rid of AWT.
m
But if this is not fixed at the source how are developers then expected to deal with that?
h
I think I'll treat it as a click & drag event if the source of the event is a touch pad and the platform is the web.
by the way, I was wrong about the horizontal scrolling on the web platform. It works fine.
a
I'd agree with @Michael Paus here, if the same exact events are not standardised on two different platforms, unless I totally misunderstood OP, it should be taken into account as a bug. I do understand the limited access to the scroll distance, but I believe the framework could and should do some normalisation to get to the same value representation in the different platforms
âž• 3
h
unfortunately, it doesn't seem possible to distinguish a touch pad event from a mouse event. I'm stuck.
e
h
Thanks. Honestly, it's a problem I encounter everywhere, most recently in WSA. The touch pad is always underused.