From Philipp Machler, "We have extended the support for Wacom Tablet devices:

- Mac OS X
  - not only pressure, but tilt and z-rotation is supported now
"
This commit is contained in:
Robert Osfield
2008-04-11 13:28:09 +00:00
parent 6fed4022a6
commit 76e0198007
5 changed files with 74 additions and 6 deletions

View File

@@ -864,6 +864,20 @@ bool GraphicsWindowCarbon::handleMouseEvent(EventRef theEvent)
getEventQueue()->penProximity(pointerType, (theTabletRecord.enterProximity != 0));
}
// get tilt and rotation from the pen
TabletPointRec theTabletPointRecord;
if(noErr == GetEventParameter(theEvent, kEventParamTabletPointRec, typeTabletPointRec, NULL,
sizeof(TabletPointRec), NULL, (void *)&theTabletPointRecord))
{
int penRotation = (int)theTabletPointRecord.rotation * 9 / 575; //to get angle between 0 to 360 grad
penRotation = -(((penRotation + 180) % 360) - 180) ; //for same range on all plattforms we need -180 to 180
getEventQueue()->penOrientation (
theTabletPointRecord.tiltX * 60 / 32767.0f, //multiply with 60 to get angle between -60 to 60 grad
-theTabletPointRecord.tiltY * 60 / 32767.0f, //multiply with 60 to get angle between -60 to 60 grad
penRotation
);
}
switch(GetEventKind(theEvent))
{
case kEventMouseDown: