def hook_events ( self, ui, control, events = None, handler = None ):
        if events is None:
            # FIXME: Implement drag and drop events ala toolkit.py for wx
            return

        elif events == 'keys':
            class KeyEventHook(QtCore.QObject):
                def eventFilter(self, object, event):
                    if event.type() == QtCore.QEvent.KeyPress:
                        return handler(event)
                    else:
                        return QtCore.QObject.eventFilter(self, object, event)

            # It's unsafe to parent the event filter with the object it's
            # filtering, so we store a reference to it here to ensure that it's
            # not garbage collected prematurely.
            ui._key_event_hook = KeyEventHook()
            control.installEventFilter(ui._key_event_hook)

    #---------------------------------------------------------------------------
    #  Indicates that an event should continue to be processed by the toolkit
    #---------------------------------------------------------------------------
Entry point for running job from the command-line.
dataset/ETHPy150Open enthought/traitsui/traitsui/qt4/toolkit.py/GUIToolkit.hook_events--crossover with--dataset/ETHPy150Open Yelp/mrjob/mrjob/job.py/MRJob.run