No announcement yet.
  • Filter
  • Time
Clear All
new posts

    Canvas' mouseWheel function behaves differently with touchpad

    SmartClient Version: v9.1p_2015-09-16/Pro Development Only (built 2015-09-16)
    Browser Chrome: Version 47.0.2526.111 m

    I am overriding mouseWheel function from Canvas class to execute code when the user scrolls using mouse wheel or touchpad (on laptop). I noticed that the behavior is different such that the mouse wheel will execute Canvas' mouseWheel function much less than the touch pad. You can see this difference from the web console from scrolling using the code I provided. Is this intended behavior? If so, how could I make my scrolling handler function execute once no matter how fast I swipe on the touch pad or how fast I spin the mouse wheel?

        backgroundColor: "blue",
        overflow: "auto",
        width: 500,
        height: 500,
        mouseWheel: function()
    Last edited by shresthg_des; 25 Jan 2016, 08:03.

    This is native behavior controlled by the operating system, and differs by platform.

    If you are trying to respond only after a series of mouseWheel (or equivalently, trackpad) events, you can set a timer (using Timer.setTimeout()) and clear it if it has not yet fired and you get another mouseWheel event.