IOHIDQueueInterface** queue;
NSMutableArray* allCookies;
NSMutableDictionary* cookieToButtonMapping;
+ CFRunLoopSourceRef eventSource;
BOOL openInExclusiveMode;
BOOL simulatePlusMinusHold;
}
- (IBAction) stopListening: (id) sender {
+ if (eventSource != NULL) {
+ CFRunLoopRemoveSource(CFRunLoopGetCurrent(), eventSource, kCFRunLoopDefaultMode);
+ CFRelease(eventSource);
+ eventSource = NULL;
+ }
if (queue != NULL) {
(*queue)->stop(queue);
}
// add callback for async events
- CFRunLoopSourceRef eventSource;
ioReturnValue = (*queue)->createAsyncEventSource(queue, &eventSource);
if (ioReturnValue == KERN_SUCCESS) {
ioReturnValue = (*queue)->setEventCallout(queue,QueueCallbackFunction, self, NULL);