Re: creating a cocoa nsapp event polling callback

  • >> I guess I'm looking something like this:
    >>
    >> - (void)
    >> publicMethodCalledBeforePollingNSApplicationsNextEventsPerFrame;
    >>
    >> Is there anything like this?
    >
    > How about overriding NSApplication's -sendEvent:?

    The problem with -sendEvent: is that it doesn't get called for mouse-
    up events if a control takes over the event queue in an event
    tracking run loop (which NSButton etc. does).

    I think Quartz Event Taps are the correct way to do this, although I
    haven't used it myself:
    http://developer.apple.com/documentation/Carbon/Reference/
    QuartzEventServicesRef/Reference/reference.html

    Before I learned about Quartz Events, I implemented something similar
    by hacking -sendEvent: and the various NSControl subclasses' -
    mouseDown: and using +poseAsClass:.  Not recommended, though you can
    get it to work...

    Daniel
previous month september 2007 next month
MTWTFSS
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
Go to today