def on_widget__motion_notify_event(self, widget, event):
        '''
        Called when mouse pointer is moved within drawing area.


        .. versionchanged:: 0.11
            Do not trigger `route-electrode-added` event if `ALT` key is
            pressed.
        '''
        if self.canvas is None:
            # Canvas has not been initialized.  Nothing to do.
            return
        elif event.is_hint:
            pointer = event.window.get_pointer()
            x, y, mod_type = pointer
        else:
            x = event.x
            y = event.y
        shape = self.canvas.find_shape(x, y)

        # Grab focus to [enable notification on key press/release events][1].
        #
        # [1]: http://mailman.daa.com.au/cgi-bin/pipermail/pygtk/2003-August/005770.html
        self.widget.grab_focus()

        if shape != self.last_hovered:
            if self.last_hovered is not None:
                # Leaving shape
                self.emit('electrode-mouseout', {'electrode_id':
                                                 self.last_hovered,
                                                 'event': event.copy()})
                self.last_hovered = None
            elif shape is not None:
                # Entering shape
                self.last_hovered = shape

                if self._route is not None:
                    if self._route.append(shape) and not (event.get_state() &
                                                          gtk.gdk.MOD1_MASK):
                        # `<Alt>` key was not held down.
                        self.emit('route-electrode-added', shape)

                self.emit('electrode-mouseover', {'electrode_id':
                                                  self.last_hovered,
                                                  'event': event.copy()})
def on_widget__motion_notify_event ( self , widget , event ) : if self . canvas is None : return elif event . is_hint : pointer = event . window . get_pointer ( ) x , y , mod_type = pointer else : x = event . x y = event . y shape = self . canvas . find_shape ( x , y ) self . widget . grab_focus ( ) if shape != self . last_hovered : if self . last_hovered is not None : self . emit ( 'electrode-mouseout' , { 'electrode_id' : self . last_hovered , 'event' : event . copy ( ) } ) self . last_hovered = None elif shape is not None : self . last_hovered = shape if self . _route is not None : if self . _route . append ( shape ) and not ( event . get_state ( ) & gtk . gdk . MOD1_MASK ) : self . emit ( 'route-electrode-added' , shape ) self . emit ( 'electrode-mouseover' , { 'electrode_id' : self . last_hovered , 'event' : event . copy ( ) } )
Called when mouse pointer is moved within drawing area.


        .. versionchanged:: 0.11
            Do not trigger `route-electrode-added` event if `ALT` key is
            pressed.