def _input_callback(fdref, flags, info):
 _triggered.set()
 CFFileDescriptorInvalidate(fdref)
 CFRelease(fdref)
 NSApp = _NSApp()
 msg(NSApp, n('stop:'), NSApp)
 _wake(NSApp)

def _input_callback ( fdref , flags , info ) : _triggered . set ( ) CFFileDescriptorInvalidate ( fdref ) CFRelease ( fdref ) NSApp = _NSApp ( ) msg ( NSApp , n ( 'stop:' ) , NSApp ) _wake ( NSApp )
callback to fire when theres input to be read .