Skip navigation

Category Archives: Code, Schematics, Design Samples

/**
using-the-mousewheel-scrollwheel-in-processing taken from http://processinghacks.com/hacks:using-the-mousewheel-scrollwheel-in-processing
@author Rick Companje
*/

void setup() {
addMouseWheelListener(new java.awt.event.MouseWheelListener() {
public void mouseWheelMoved(java.awt.event.MouseWheelEvent evt) {
mouseWheel(evt.getWheelRotation());
}});
}
// returns 1 or -1 depending on direction
void mouseWheel(int delta) {
println(delta);
}

void draw() {
}

Advertisements