Wheel Button event recognition

edited August 2017 in Programming Questions

How can wheel button events be recognized in a library? The mouseEvent(MouseEvent e) method does not trigger when the wheel button is pressed! Any workarounds for this?

Thanks in advance, Alex

Answers

  • @jeremydouglass thanks for the reply! I did not try that since it cannot be written within the library. I did solve my problem however. The mouse wheel button can be recognized through the expression e.getButton() == 3 or e.getButton() == CENTER.

    Also, for future uses, note that when the mouse wheel button is pressed, the method e.isAltPressed() returns true (for some unknown reason), so be careful how you combine those expressions... (may cause a lot of frustration!!!)

Sign In or Register to comment.