예제 #1
0
    def wait_for_click(self, button, timeOut=10.0):
        """
        Wait for a mouse click
        
        Usage: C{mouse.wait_for_click(self, button, timeOut=10.0)}

        @param button: they mouse button click to wait for as a button number, 1-9
        @param timeOut: maximum time, in seconds, to wait for the keypress to occur
        """
        button = int(button)
        w = iomediator.Waiter(None, None, button, timeOut)
        w.wait()
예제 #2
0
    def wait_for_keypress(self, key, modifiers=[], timeOut=10.0):
        """
        Wait for a keypress or key combination
        
        Usage: C{keyboard.wait_for_keypress(self, key, modifiers=[], timeOut=10.0)}
        
        Note: this function cannot be used to wait for modifier keys on their own

        @param key: they key to wait for
        @param modifiers: list of modifiers that should be pressed with the key
        @param timeOut: maximum time, in seconds, to wait for the keypress to occur
        """
        w = iomediator.Waiter(key, modifiers, None, timeOut)
        w.wait()