1
0
Fork 0
forked from wry/wry

it: test natural scrolling

This commit is contained in:
Julian Orth 2024-04-02 10:26:42 +02:00
parent f562f887f0
commit adf6d2ae2b
12 changed files with 149 additions and 2 deletions

View file

@ -319,13 +319,17 @@ impl TestBackendMouse {
}
pub fn scroll_px(&self, dy: i32) {
self.scroll_px2(dy, false);
}
pub fn scroll_px2(&self, dy: i32, inverted: bool) {
self.common.event(InputEvent::AxisSource {
source: AxisSource::Finger,
});
self.common.event(InputEvent::AxisPx {
dist: Fixed::from_int(dy),
axis: ScrollAxis::Vertical,
inverted: false,
inverted,
});
self.common.event(InputEvent::AxisFrame {
time_usec: now_usec(),