Wheel mouse

From Processing

Jump to: navigation, search
Versions: 1.0+
Contributors: companje
Started: 2008-01-11


With this snippet you can use the scroll wheel / mouse wheel in Processing.

Source Code

/**
Wheel mouse taken from http://wiki.processing.org/index.php/Wheel_mouse
@author Rick Companje
*/
 
void setup() {
  addMouseWheelListener(new java.awt.event.MouseWheelListener() { 
    public void mouseWheelMoved(java.awt.event.MouseWheelEvent evt) { 
      mouseWheel(evt.getWheelRotation());
  }}); 
}
 
void mouseWheel(int delta) {
  println(delta); 
}
 
void draw() {
 
}

Downloads

Related Links

Personal tools