From: Kevin W. <kw...@co...> - 2014-09-27 12:41:23
|
Michiel, On 9/27/14, 5:05 AM, Michiel de Hoon wrote: > > I think there is a misunderstanding here. I was referring > to Cocoa events, not to Tcl events or procedures. In the > current design, tkProcessEvent is processing Cocoa events > in the event loop rather than in the callback. It's just a filter that listens for mouse and keyboard events. That's all. See below: ------ @implementation TKApplication(TKEvent) /* TODO: replace by +[addLocalMonitorForEventsMatchingMask ? */ - (NSEvent *)tkProcessEvent:(NSEvent *)theEvent { #ifdef TK_MAC_DEBUG_EVENTS TKLog(@"-[%@(%p) %s] %@", [self class], self, _cmd, theEvent); #endif NSEvent *processedEvent = theEvent; NSEventType type = [theEvent type]; NSInteger subtype; NSUInteger flags; switch ((NSInteger)type) { case NSAppKitDefined: subtype = [theEvent subtype]; switch (subtype) { case NSApplicationActivatedEventType: break; case NSApplicationDeactivatedEventType: break; case NSWindowExposedEventType: case NSScreenChangedEventType: break; case NSWindowMovedEventType: break; case NSWindowWillMoveEventType: break; default: break; } break; case NSKeyUp: case NSKeyDown: case NSFlagsChanged: flags = [theEvent modifierFlags]; processedEvent = [self tkProcessKeyEvent:theEvent]; break; case NSLeftMouseDown: case NSLeftMouseUp: case NSRightMouseDown: case NSRightMouseUp: case NSLeftMouseDragged: case NSRightMouseDragged: case NSMouseMoved: case NSMouseEntered: case NSMouseExited: case NSScrollWheel: case NSOtherMouseDown: case NSOtherMouseUp: case NSOtherMouseDragged: case NSTabletPoint: case NSTabletProximity: processedEvent = [self tkProcessMouseEvent:theEvent]; break; #if 0 case NSSystemDefined: subtype = [theEvent subtype]; break; case NSApplicationDefined: { id win; win = [theEvent window]; break; } case NSCursorUpdate: break; #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1060 case NSEventTypeGesture: case NSEventTypeMagnify: case NSEventTypeRotate: case NSEventTypeSwipe: case NSEventTypeBeginGesture: case NSEventTypeEndGesture: break; #endif #endif default: break; } return processedEvent; } @end --- > In the meantime, are there any volunteers to test any > new event loop code? In addition to the Tcl/Tk test suite, > it would be good to test the code in the real world. Yes, I would. Test your patch against the sample script submitted with the bug report I referenced--it reliably causes the Tcl/Tk event loop to hang. That's what I'm looking to address. Let me know when you have something to look at. Thank you, Kevin -- Kevin Walzer Code by Kevin/Mobile Code by Kevin http://www.codebykevin.com http://www.wtmobilesoftware.com |