Ejemplo n.º 1
0
    def on_key_down(self, window, key, scancode, codepoint, modifier):
        """This method is one of the primary User Interfaces: keyboard
        shortcuts to manipulate a selected MungNode.

        :param window:
        :param key:
        :param scancode:
        :param codepoint:
        :param modifier:
        :return:
        """
        # if self.cropobject.objid < 50:
        #     logging.info('CropObjectView: Key caught by CropObjectView {0}: {1}'
        #                  ''.format(self,
        #                            (key, scancode, codepoint, modifier)))

        if not self.is_selected:
            return False

        # Get the dispatch key
        # ------------
        dispatch_key = keypress_to_dispatch_key(key, scancode, codepoint, modifier)

        #logging.info('CropObjectView: Handling key {0}, self.is_selected={1},'
        #             ' self.cropobject={2}'
        #             ''.format(dispatch_key, self.is_selected, str(self.cropobject.objid)))

        is_handled = self.handle_dispatch_key(dispatch_key)
        if is_handled:
            self.dispatch('on_key_captured')
        return False
Ejemplo n.º 2
0
    def on_key_down(self, window, key, scancode, codepoint, modifier):
        # Should control enter to confirm/escape to cancel
        dispatch_key = keypress_to_dispatch_key(key, scancode, codepoint, modifier)

        logging.info('MLClassSelectionDialog: Handling keypress: {0}'.format(dispatch_key))
        is_handled = self.handle_dispatch_key(dispatch_key)

        # Don't let the event propagate through the dialog.
        return True
Ejemplo n.º 3
0
    def on_key_down(self, window, key, scancode, codepoint, modifier):
        logging.debug('CropObjectListView.on_key_down(): trap {0}'
                      ''.format(self._trap_key))
        if self.handle_key_trap(window, key, scancode, codepoint, modifier):
            logging.debug('CropObjectListView: NOT propagating keypress')
            return True

        dispatch_key = keypress_to_dispatch_key(key, scancode, codepoint,
                                                modifier)

        is_handled = self.handle_dispatch_key(dispatch_key)
        return is_handled