Created
April 30, 2015 19:40
-
-
Save dlprows/4a13db52e2720fe2df1b to your computer and use it in GitHub Desktop.
Register a callback for all multitouch devices
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static NSArray* devices; | |
void startMT(){ | |
devices = CFBridgingRelease(MTDeviceCreateList()); | |
for(int i = 0; i < devices.count; i++) | |
{ | |
MTDeviceRef device = (__bridge MTDeviceRef)devices[i]; | |
MTRegisterContactFrameCallback(device, mtcallback); | |
MTDeviceStart(device, 0); | |
} | |
} | |
void stopMT(){ | |
for(int i = 0; i < devices.count; i++) | |
{ | |
MTDeviceRef device = (__bridge MTDeviceRef)devices[i]; | |
MTDeviceStop(device); | |
} | |
devices = nil; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment