ofxMultiTouchPad::ofxMultiTouchPad() { _guard++; if (_guard==1) { printf("Creating Multitouch device\n"); CFMutableArrayRef* deviceList = MTDeviceCreateList(); numDevices = min((int)CFArrayGetCount((CFArrayRef)deviceList),_MAX_DEVICES); for(int i=0;i<numDevices;i++){ _mt_device[i] = (MTDeviceRef)CFArrayGetValueAtIndex( (CFArrayRef) deviceList, i);//MTDeviceCreateDefault(); MTRegisterContactFrameCallback(_mt_device[i], _mt_callback); MTDeviceStart(_mt_device[i], 0); } } else { printf("there's another instance already created," "we must not init the device\n"); } ofAddListener(MTUpdateBlock, this, &ofxMultiTouchPad::callBackTriggered); MTUpdateBlock.enable(); this->fingers = &_touches; this->_fingerCount = &fingerCount; }
void AppleTrackpadInputDevice::start() { MultitouchInputDevice::start(); m_Device = MTDeviceCreateDefault(); MTRegisterContactFrameCallback(m_Device, callback); MTDeviceStart(m_Device, 0); AVG_TRACE(Logger::CONFIG, "Apple Trackpad Multitouch event source created."); }
JNIEXPORT void JNICALL Java_mtouch_MultiTouch_startMultiTouch(JNIEnv *env, jclass obj) { if (mtouch_started) { printf("mtouch already started\n"); return; } mtouch_dev = MTDeviceCreateDefault(); MTRegisterContactFrameCallback(mtouch_dev, callback); MTDeviceStart(mtouch_dev, 0); mtouch_started = true; }
void MultiTouch_Initialize() { if (mt != 0) return; mt = MTDeviceCreateDefault(); if (mt != 0) { MTRegisterContactFrameCallback(mt, ContactCallbackFunction); MTDeviceStart(mt); } }
ofxMultiTouchPad::ofxMultiTouchPad() { _guard++; if (_guard==1) { printf("Creating Multitouch device\n"); _mt_device = MTDeviceCreateDefault(); MTRegisterContactFrameCallback(_mt_device, _mt_callback); MTDeviceStart(_mt_device, 0); } else { printf("there's another instance already created," "we must not init the device\n"); } ofAddListener(MTUpdateBlock, this, &ofxMultiTouchPad::callBackTriggered); MTUpdateBlock.enable(); this->fingers = &_touches; this->_fingerCount = &fingerCount; }