def buttonDown(self, button=mouse.LEFT): """ Holds down the specified mouse button. Use Mouse.LEFT, Mouse.MIDDLE, Mouse.RIGHT """ self._lock.acquire() mouse.press(button) self._lock.release()
def test_buttons(self): mouse.press() self.assertEqual(self.flush_events(), [(DOWN, LEFT)]) mouse.release() self.assertEqual(self.flush_events(), [(UP, LEFT)]) mouse.click() self.assertEqual(self.flush_events(), [(DOWN, LEFT), (UP, LEFT)]) mouse.double_click() self.assertEqual(self.flush_events(), [(DOWN, LEFT), (UP, LEFT), (DOWN, LEFT), (UP, LEFT)]) mouse.right_click() self.assertEqual(self.flush_events(), [(DOWN, RIGHT), (UP, RIGHT)]) mouse.click(RIGHT) self.assertEqual(self.flush_events(), [(DOWN, RIGHT), (UP, RIGHT)]) mouse.press(X2) self.assertEqual(self.flush_events(), [(DOWN, X2)])
def buttonDown(self, button=mouse.LEFT): """ Holds down the specified mouse button. Use Mouse.LEFT, Mouse.MIDDLE, Mouse.RIGHT """ mouse.press(button)