Logo Search packages:      
Sourcecode: gnome-mousetrap version File versions  Download package

def holdProfile::Profile::_moveHoldMode (   self,
  args,
  kwds 
) [private]

Perform the movements using the 'HOLD' mode.

The 'HOLD' mode methods are:
switch-hold-const: Will move the mouse with a constant speed.
switch-hold-acc: Will move the mouse with a constant acceleration. 
                   Each second the speed will be increased.

Arguments:
- self: The main object pointer.

Definition at line 129 of file holdProfile.py.

00129                                             :
        """
        Perform the movements using the 'HOLD' mode.
        
        The 'HOLD' mode methods are:
        switch-hold-const: Will move the mouse with a constant speed.
        switch-hold-acc: Will move the mouse with a constant acceleration. 
                                   Each second the speed will be increased.
        
        Arguments:
        - self: The main object pointer.
        """
        
        forehead     = mouseTrap.getModVar("cam", "forehead")
        foreheadOrig = mouseTrap.getModVar("cam", "foreheadOrig")
 
        if not forehead or not foreheadOrig:
            return False

        poss = mouseTrap.mice( "position" )
        
        newPoss = poss[:]
        
        var = dict( [ ( i, self.step*(v/abs(v))) 
                        for i,v in enumerate( [ forehead.x - foreheadOrig.x,
                                                forehead.y - foreheadOrig.y] )  
                        if abs(v) >= self.settings.getint( "access", "reqMovement" ) ] )

        for i in var:
            if i > 0: newPoss[i] += var[i]; continue
            newPoss[i] -= var[i]
            
        newX, newY = newPoss
        
                  
        if self.settings.get( "cam", "mouseMode").endswith("|acc") and self.startMove > self.stopMove:
            self.step += ( abs( time.time() - self.startMove) * 3 )
            
        if newPoss != poss:
            if self.stopMove > self.startMove: 
                self.startMove = time.time()
            self.isMoving = True
            mouseTrap.mice( "move", newX, newY )
        else:
            self.isMoving = False
            self.stopMove = time.time()
            self.step     = self.settings.getint( "mouse", "stepSpeed" )

    def _clickDialog( self, *args, **kwds ):


Generated by  Doxygen 1.6.0   Back to index