Python Quartz.kCGEventLeftMouseDragged() Examples

The following are 6 code examples of Quartz.kCGEventLeftMouseDragged(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module Quartz , or try the search function .
Example #1
Source File: eye_detection.py    From Mousely with MIT License 5 votes vote down vote up
def mousedrag(self, posx, posy):
        self.mouseEvent(Quartz.kCGEventLeftMouseDragged, posx,posy)



# Detecting Blinking of eyes 
Example #2
Source File: mouse.py    From Mousely with MIT License 5 votes vote down vote up
def mousedrag(self, posx, posy):
        self.mouseEvent(Quartz.kCGEventLeftMouseDragged, posx,posy) 
Example #3
Source File: _pyautogui_osx.py    From pyautogui with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def _dragTo(x, y, button):
    if button == LEFT:
        _sendMouseEvent(Quartz.kCGEventLeftMouseDragged , x, y, Quartz.kCGMouseButtonLeft)
    elif button == MIDDLE:
        _sendMouseEvent(Quartz.kCGEventOtherMouseDragged , x, y, Quartz.kCGMouseButtonCenter)
    elif button == RIGHT:
        _sendMouseEvent(Quartz.kCGEventRightMouseDragged , x, y, Quartz.kCGMouseButtonRight)
    else:
        assert False, "button argument not in ('left', 'middle', 'right')"
    time.sleep(0.01) # needed to allow OS time to catch up. 
Example #4
Source File: _pyautogui_osx.py    From Dindo-Bot with MIT License 5 votes vote down vote up
def _dragTo(x, y, button):
    if button == LEFT:
        _sendMouseEvent(Quartz.kCGEventLeftMouseDragged , x, y, Quartz.kCGMouseButtonLeft)
    elif button == MIDDLE:
        _sendMouseEvent(Quartz.kCGEventOtherMouseDragged , x, y, Quartz.kCGMouseButtonCenter)
    elif button == RIGHT:
        _sendMouseEvent(Quartz.kCGEventRightMouseDragged , x, y, Quartz.kCGMouseButtonRight)
    else:
        assert False, "button argument not in ('left', 'middle', 'right')"
    time.sleep(0.01) # needed to allow OS time to catch up. 
Example #5
Source File: OSXUIFunc.py    From Poco with Apache License 2.0 5 votes vote down vote up
def drag(x, y):
        drag = Quartz.CGEventCreateMouseEvent(None, Quartz.kCGEventLeftMouseDragged, (x, y), 0)
        Quartz.CGEventPost(Quartz.kCGHIDEventTap, drag) 
Example #6
Source File: _pyautogui_osx.py    From xbmc with GNU General Public License v3.0 5 votes vote down vote up
def _dragTo(x, y, button):
    if button == LEFT:
        _sendMouseEvent(Quartz.kCGEventLeftMouseDragged , x, y, Quartz.kCGMouseButtonLeft)
    elif button == MIDDLE:
        _sendMouseEvent(Quartz.kCGEventOtherMouseDragged , x, y, Quartz.kCGMouseButtonCenter)
    elif button == RIGHT:
        _sendMouseEvent(Quartz.kCGEventRightMouseDragged , x, y, Quartz.kCGMouseButtonRight)
    else:
        assert False, "button argument not in ('left', 'middle', 'right')"
    time.sleep(0.01) # needed to allow OS time to catch up.