Expose the mouse movement delta in PointerEvent
Feature Description
Hi! I'm writing an application where I'm making a knob widget, which you can drag on to increase / decrease the value. Currently, it does this using a manually calculated mouse delta:
TouchArea {
private property <length> prev-mouse-x;
private property <length> prev-mouse-y;
pointer-event(event) => {
let delta-x = self.mouse-x - self.prev-mouse-x;
let delta-y = self.mouse-y - self.prev-mouse-y;
// .. rest of the logic
}
}I've noticed though that this gets annoying when near an edge of the screen. When you hit the edge, you can't move further. Most platforms do still provide mouse movement events past this with proper delta values, even if the mouse cursor itself doesn't move, but Slint doesn't expose this anywhere.
Product Impact
I'm building an audio application. The same would apply to Blender-style number inputs, where you can drag on the input to quickly adjust it. Since this is almost achievable by manually working around it, it's not critical, but it would be really nice to have.
Source: slint-ui/slint