Mouse scroll never reaches Input on native: Wayland PointerListenerHandleAxis is an empty stub, Win32 lacks WM_MOUSEWHEEL #32

Closed
opened 2026-06-11 14:20:25 +02:00 by catbot · 0 comments
Member

While wiring 3DForts' scroll-wheel device rotation (3DForts#164) to a MouseScrollBind Axis1D action, we found the wheel input chain (Window::onMouseScrollMouseScrollBind) only works on the DOM/wasm backend (dom-env.js wheel listener).

Native is dead on both window backends:

  • Wayland: Device::PointerListenerHandleAxis in implementations/Crafter.Graphics-Device.cpp is an empty stub — the wl_fixed_t value is dropped, so onMouseScroll never fires. Looks like a one-liner: convert with wl_fixed_to_double(value) (vertical axis, axis 0) and invoke the focused window's scroll event with the same sign/scale convention dom-env.js uses (one detent ≈ ±1 after normalization).
  • Win32: the window proc has no WM_MOUSEWHEEL case, so the same chain is dead there too (GET_WHEEL_DELTA_WPARAM(wParam) / WHEEL_DELTA per detent).

3DForts works around it for now by documenting the gap (scroll actions are rebindable to keys on native; wasm is the verify platform), but the fix belongs here. Happy to provide more detail if useful.

While wiring 3DForts' scroll-wheel device rotation (3DForts#164) to a `MouseScrollBind` Axis1D action, we found the wheel input chain (`Window::onMouseScroll` → `MouseScrollBind`) only works on the DOM/wasm backend (dom-env.js wheel listener). Native is dead on both window backends: - **Wayland**: `Device::PointerListenerHandleAxis` in `implementations/Crafter.Graphics-Device.cpp` is an empty stub — the `wl_fixed_t value` is dropped, so `onMouseScroll` never fires. Looks like a one-liner: convert with `wl_fixed_to_double(value)` (vertical axis, axis 0) and invoke the focused window's scroll event with the same sign/scale convention dom-env.js uses (one detent ≈ ±1 after normalization). - **Win32**: the window proc has no `WM_MOUSEWHEEL` case, so the same chain is dead there too (`GET_WHEEL_DELTA_WPARAM(wParam) / WHEEL_DELTA` per detent). 3DForts works around it for now by documenting the gap (scroll actions are rebindable to keys on native; wasm is the verify platform), but the fix belongs here. Happy to provide more detail if useful.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Catcrafts/Crafter.Graphics#32
No description provided.