I started a new thread as the original topic no longer matched.
I installed 8.1.0.2 x64 CS and enabled logging in gen-wheels. Matt was 
right: wheel-steps-mode is indeed set to 'integer while gen-wheels runs in 
DrRacket's editor. The only two changes required to get smooth/accurate 
scrolling on touchpad gestures and trackpoint are therefore:

In share\pkgs\gui-lib\mred\private\wx\win32\window.rkt's gen-wheels private 
method:

(let loop ([amt (* wheel-scale amt)])
to
(let loop ([amt amt])

and reduce WHEEL_DELTA by a factor of 4, such as gen-wheels looks like:

  (define/private (gen-wheels w msg lParam amt down up)
    (define WHEEL_DELTA_S (/ WHEEL_DELTA 4))
    (let loop ([amt amt])
      (cond
        [((abs amt) . < . WHEEL_DELTA_S)
         (case wheel-steps-mode
           [(one integer) amt]
           [(fraction)
            (unless (zero? amt)
              (do-key w msg down lParam #f #f void (/ amt (exact->inexact 
WHEEL_DELTA_S))))
            0.0])]
        [(negative? amt)
         (case wheel-steps-mode
           [(one)
            (do-key w msg down lParam #f #f void 1.0)
            (loop (+ amt WHEEL_DELTA_S))]
           [(integer)
            (define steps (quotient (- amt) WHEEL_DELTA_S))
            (do-key w msg down lParam #f #f void (exact->inexact steps))
            (loop (+ amt (* steps WHEEL_DELTA_S)))]
           [else
            (do-key w msg down lParam #f #f void (/ (- amt) (exact->inexact 
WHEEL_DELTA_S)))
            0.0])]
        [else
         (case wheel-steps-mode
           [(one)
            (do-key w msg up lParam #f #f void 1.0)
            (loop (- amt WHEEL_DELTA_S))]
           [(integer)
            (define steps (quotient amt WHEEL_DELTA_S))
            (do-key w msg up lParam #f #f void (exact->inexact steps))
            (loop (- amt (* steps WHEEL_DELTA_S)))]
           [else
            (do-key w msg up lParam #f #f void (/ amt (exact->inexact 
WHEEL_DELTA_S)))
            0.0])])))

Happy Monday,

Dex

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/28e13460-c86d-4967-aa25-5527d672e711n%40googlegroups.com.

Reply via email to