Open njuptzwt opened 1 year ago
Webview send scroll event.
why the point must be(0,0), when I change it to last_cursorpos, it doesn't work, and this is the reason why scroll elements in pages doesn't work??
void Webview::SendScroll(double delta, bool horizontal) { // delta * 6 gives me a multiple of WHEEL_DELTA (120) constexpr auto kScrollMultiplier = 6;
auto offset = static_cast(delta * kScrollMultiplier);
**POINT point; point.x = 0; point.y = 0;**
if (horizontal) { compositioncontroller->SendMouseInput( COREWEBVIEW2_MOUSE_EVENT_KIND_HORIZONTAL_WHEEL, virtualkeys.state(), offset, point); } else { compositioncontroller->SendMouseInput(COREWEBVIEW2_MOUSE_EVENT_KIND_WHEEL, virtualkeys.state(), offset, point); } }
Webview send scroll event.
why the point must be(0,0), when I change it to last_cursorpos, it doesn't work, and this is the reason why scroll elements in pages doesn't work??
void Webview::SendScroll(double delta, bool horizontal) { // delta * 6 gives me a multiple of WHEEL_DELTA (120) constexpr auto kScrollMultiplier = 6;
auto offset = static_cast(delta * kScrollMultiplier);
if (horizontal) { compositioncontroller->SendMouseInput( COREWEBVIEW2_MOUSE_EVENT_KIND_HORIZONTAL_WHEEL, virtualkeys.state(), offset, point); } else { compositioncontroller->SendMouseInput(COREWEBVIEW2_MOUSE_EVENT_KIND_WHEEL, virtualkeys.state(), offset, point); } }