Hi,

I need to capture the mouse wheel scroll event in my extension, and one user reports that it does not work with the trackpad. I have written a small sample file in HTML to see how it works and the same in XUL. It seems that the XUL implementation of the DOMMouseScroll does not capture the scroll from the trackpad. Does anybody knows how to capture the scroll from the trackpad ?
Thanks !

Didier

HTML

<html>
  <body>

    <form>
      <input type="text" id="box" value="move scroll wheel here">
    </form>

    <script>
document.getElementById("box").addEventListener("DOMMouseScroll", mouseScroll, false);

function mouseScroll(event)
{
  document.getElementById("box").value = event.detail;
}

    </script>
  </body>
</html>

In XUL

<?xml version="1.0" encoding="utf-8"?>
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
        xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
        xmlns:html="http://www.w3.org/1999/xhtml">

<textbox id="box" value="move scroll wheel here"/>


<script type="application/x-_javascript_">
       
document.getElementById("box").addEventListener("DOMMouseScroll", mouseScroll, true);

function mouseScroll(event)
{
  document.getElementById("box").value = event.detail;
}

</script>

</window>

_______________________________________________
Project_owners mailing list
[email protected]
http://mozdev.org/mailman/listinfo/project_owners

Reply via email to