def _tablet_event(self, ev):
        '''Process tablet event and return True if some event was processed.
        Return True if no tablet event found.
        '''
        event_type = ctypes.c_uint32()
        r = carbon.GetEventParameter(ev, kEventParamTabletEventType,
            typeUInt32, None,
            ctypes.sizeof(event_type), None,
            ctypes.byref(event_type))
        if r != noErr:
            return False

        if event_type.value == kEventTabletProximity:
            proximity_rec = TabletProximityRec()
            _oscheck(
            carbon.GetEventParameter(ev, kEventParamTabletProximityRec,
                typeTabletProximityRec, None, 
                ctypes.sizeof(proximity_rec), None, 
                ctypes.byref(proximity_rec))
            )
            print (proximity_rec.vendorID,
                proximity_rec.tabletID, proximity_rec.pointerID,
                proximity_rec.deviceID, proximity_rec.systemTabletID,
                proximity_rec.vendorPointerType,
                proximity_rec.pointerSerialNumber,
                proximity_rec.uniqueID,
                proximity_rec.capabilityMask,
                't', proximity_rec.pointerType,
                proximity_rec.enterProximity,
            )

        if event_type.value == kEventTabletPoint:
            point_rec = TabletPointRec()
            _oscheck(
            carbon.GetEventParameter(ev, kEventParamTabletPointRec,
                typeTabletPointRec, None,
                ctypes.sizeof(point_rec), None,
                ctypes.byref(point_rec))
            )
            print (point_rec.absX, 
                   point_rec.absY,
                   point_rec.absZ,
                   point_rec.buttons,
                   point_rec.pressure,
                   point_rec.tiltX,
                   point_rec.tiltY,
                   point_rec.rotation,
                   point_rec.tangentialPressure,
                   point_rec.deviceID,
                   point_rec.vendor1,
                   point_rec.vendor2,
                   point_rec.vendor3,
               )

        return True
dataset/ETHPy150Open ardekantur/pyglet/experimental/input/osx_tablet.py/TabletWindow._tablet_event/original