cocoa: enqueue events only if input context is present