There is currently no Processing-specific library for Wacom tablets. A solution for Windows is described on the Processing forums: Wacom with jWintab. The library mentioned there is JTablet. There is also an old library called JWinTab by Amit Pitaru, there was a 0090 test release, which presumably does not work with Processing 0094+.
For now, the information from the Processing Forums is just republished here. The hack as described was created by Marcello Bastea-Forte, author of JTablet. A Mac hack is still needed.
Source code
Download the JTablet software from http://www.cellosoft.com/sketchstudio/. You will need to create a “code” folder and copy the jtablet.jar and jtablet.dll files from “C:\Program Files\Cellosoft\JTablet” into it. When installing the tablet software, Wintab32.dll should automatically be installed. If it isn’t, you will most likely run into problems.
/** Example taken from http://processinghacks.com/hacks:example Originally from http://processing.org/ (search for "JTablet") @author Marcello Bastea-Forte */ import cello.tablet.*; JTablet jtablet = null; void setup() { size(200,200); try { jtablet = new JTablet(); } catch (JTabletException jte) { println("Could not load JTablet! (" + jte.toString() + ")."); } smooth(); } void draw() { try { // Get latest tablet information jtablet.poll(); } catch (JTabletException jte) { println("JTablet Error: " + jte.toString()); } ellipseMode(CENTER); if (mousePressed && jtablet.hasCursor()) { // Get the current cursor JTabletCursor cursor = jtablet.getCursor(); fill(0); noStroke(); ellipse(mouseX, mouseY, cursor.getPressureFloat() * 20, cursor.getPressureFloat() * 20); } }
Downloads
Marcello Bastea-Forte’s JTablet library:
http://www.cellosoft.com/sketchstudio/.
See the JTablet javadocs for API details.