How does this scroll wheel test detect rotary encoder reversals?
Rolling steadily inside the pad tracks consecutive vertical wheel ticks and flags an opposite-direction jump whenever a deltaY sign flip occurs within 280 ms after at least three steady notches. Locking viewport scrolling locally lets this mouse wheel jump checker catch failing quadrature signals without uploading device data.
Why mechanical quadrature encoders jump backward
Most budget and gaming mice sense wheel rotation through a compact mechanical rotary encoder mounted beside the scroll axle. Inside that housing, metal wiper fingers sweep across a patterned contact disc to generate two offset square waves (channels A and B) whose phase order encodes clockwise or counterclockwise motion.
When dust, hair, or contact oxidation builds up inside the enclosure, one channel briefly chatters or drops a pulse edge. The microcontroller reads the inverted phase transition and sends a backwards tick mid-scroll, producing erratic page bounce. Because a noisy middle wheel axle often coexists with worn switch springs, you can also diagnose accidental microswitch double-clicks beside wheel checks on the same mouse.
Locking page scrolling with non-passive wheel listeners
Standard web pages allow wheel scrolling by default, which shoves test controls out of view during rapid flicks. This component binds a listener with { passive: false } and calls e.preventDefault() on incoming events defined by the MDN Web WheelEvent Reference.
Every incoming event ignores pure (0, 0) zero-delta noise and selects its dominant axis by checking Math.abs(deltaY) >= Math.abs(deltaX). Negative deltaY counts as Up steps, positive deltaY counts as Down steps, and rounded step magnitudes display down to 0.1 px inside Last deltaY.
Measuring scroll steps, deltaY magnitude, and peak speed
Four metric cards summarize Up steps, Down steps, Encoder reversals, and Peak speed (/s), turning the reversals card red whenever reversalFaults > 0. Beneath the Reversal detection window slider, the sidebar tracks Horizontal tilts and Last deltaY in pixels.
High-resolution timing for reversal windows and speed
Step interval timing relies on e.timeStamp or performance.now() under the W3C High Resolution Time Level 3 standard, rounding vertical intervals (dtMs) to 0.1 ms. To compute Peak speed, the state machine prunes step timestamps older than 1,000 ms from the latest event and stores the highest active 1-second count.
You can adjust Reversal detection window between 150 ms and 450 ms in 10 ms increments to suit different finger speeds. Widening the window to 400 ms catches intermittent bounce during slow single-notch reading, whereas tightening to 180 ms prevents quick intentional back-and-forth flicks from registering false faults.
Comparing notched mouse wheels vs precision trackpads
Notched mechanical encoders, optical free-spin wheels, and laptop trackpads all dispatch WheelEvent traffic with distinct cadence and pixel step sizes. Watching Last deltaY, Peak speed, and Recent notches reveals whether erratic jumps come from hardware wear or smooth-scroll driver interpolation.
| Input device type | Typical deltaY magnitude |
Expected Peak speed | Reversal diagnostic behavior |
|---|---|---|---|
| Mechanical notched wheel | 100 px to 120 px per notch |
8/s to 25/s steady |
Clean OK streak; worn wipers trigger red Reversal ticks |
| Optical free-spin wheel | 100 px per tick; bursts on flick |
40/s to 120/s |
Immune to metal oxidation; dust hair blocks IR slot uniformly |
| Horizontal tilt switch | Non-zero deltaX (±100 px) |
2/s to 10/s |
Logs left/right Horizontal tilts without resetting vertical streak |
| Precision laptop trackpad | Fractional 1.2 px to 28 px |
60/s to 180/s |
Smooth OS momentum glides smoothly without hard sign reversals |
High-speed wireless mice experiencing USB receiver interference can drop or bundle wheel packets during fast flicks. Checking wired and wireless mouse Hz consistency helps verify whether radio dropouts coincide with choppy wheel reporting.
Testing horizontal tilt wheels and isolating input devices
Tilt-wheel mice add lateral microswitches triggered by nudging the scroll wheel left or right, dispatching non-zero deltaX values. Because recordScrollStep only updates streakDir and streakCount on vertical ("up" or "down") steps, lateral nudges increment Horizontal tilts cleanly without breaking an active vertical streak.
Browser wheel diagnostics stay completely isolated from touchscreen finger gestures. Unlike touch drags governed by the MDN PointerEvent Interface Documentation, physical scroll wheels and two-finger trackpad glides emit WheelEvent objects exclusively inside the focused pad.
Tracking left and right tilts alongside vertical streaks
Pressing the wheel sideways verifies left and right switch actuation even on mice where OS horizontal scrolling is disabled in spreadsheet apps. Each lateral pulse logs "left" (deltaX < 0) or "right" (deltaX > 0) in Recent notches and sums both directions inside Horizontal tilts.
Auditing Recent notches and verifying clean resets
The Recent notches table retains the latest 60 events in memory and displays the newest 20 rows with #, Dir, deltaY, and Status (OK or Reversal). Whenever you test a laptop with both a trackpad and an external touch display, you can also isolate precision trackpad vs external digitizer gestures before blaming a mouse encoder.
Clicking Reset log clears upSteps, downSteps, leftSteps, rightSteps, reversalFaults, peakStepsPerSec, and events back to zero. Resetting between steady upward rolls and steady downward rolls keeps each directional test pass cleanly separated.
Clearing encoder dust before replacing your mouse
Operating system wheel settings (such as scrolling 3 lines vs 1 screen per notch in Windows) scale deltaY pixel magnitude but never invert scroll direction mid-roll. Repeated red Reversal rows during slow, single-direction turns point directly to physical encoder or optical sensor issues.
- Compressed air pass: Unplug the mouse, tilt the scroll wheel slightly side to side, and blow short bursts of dry compressed air into the wheel gap to clear trapped lint before clicking Reset log to re-test.
- Separate screen stutter from wheel bounce: Sometimes high-refresh display tearing or browser smooth-scroll animations feel like scroll jitter; run the Dead pixel and screen test or disable browser smooth scrolling to confirm the wheel itself is clean.
- De-oxit or encoder swap: If Encoder reversals keeps climbing past
1or2faults per20slow notches after dust clearing, electrical contact cleaner inside the encoder housing or soldering a replacement encoder usually restores clean directional steps.
Tip: Roll
15to20deliberate notches in one direction, pause500 ms, and avoid snapping backward at the end of a fast spin so normal finger rebound does not trigger a false reversal inside the280 mswindow.