Search code examples
javamouselwjglmousewheel

LWJGL Mouse Scroll wheel input


I would like to know how do I get the following actions using LWJGL's Mouse class:

  • When the mouse scroll wheel is scrolled down
  • When the mouse scroll wheel is scrolled up
  • When the mouse scroll wheel is pressed

Thanks for the help!


Solution

  • As specified on the lwjgl javadoc, try calling

        Mouse.getDWheel(); // Scroll amount
        Mouse.isButtonDown(2); // Scroll wheel pressed?