Python Quartz.CGEventSetIntegerValueField() Examples
The following are 8
code examples of Quartz.CGEventSetIntegerValueField().
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: _darwin.py From MIA-Dictionary-Addon with GNU General Public License v3.0 | 6 votes |
def _press(self, button): (press, _, _), mouse_button = button.value event = Quartz.CGEventCreateMouseEvent( None, press, self.position, mouse_button) # If we are performing a click, we need to set this state flag if self._click is not None: self._click += 1 Quartz.CGEventSetIntegerValueField( event, Quartz.kCGMouseEventClickState, self._click) Quartz.CGEventPost(Quartz.kCGHIDEventTap, event) # Store the button to enable dragging self._drag_button = button
Example #2
Source File: _darwin.py From MIA-Dictionary-Addon with GNU General Public License v3.0 | 6 votes |
def _release(self, button): (_, release, _), mouse_button = button.value event = Quartz.CGEventCreateMouseEvent( None, release, self.position, mouse_button) # If we are performing a click, we need to set this state flag if self._click is not None: Quartz.CGEventSetIntegerValueField( event, Quartz.kCGMouseEventClickState, self._click) Quartz.CGEventPost(Quartz.kCGHIDEventTap, event) if button == self._drag_button: self._drag_button = None
Example #3
Source File: eye_detection.py From Mousely with MIT License | 5 votes |
def doubleClick(self, x, y, clickCount, button=0): print("Double click event") theEvent = Quartz.CGEventCreateMouseEvent(None, Mouse.down[button], (x, y), button) Quartz.CGEventSetIntegerValueField(theEvent, Quartz.kCGMouseEventClickState, clickCount) Quartz.CGEventPost(Quartz.kCGHIDEventTap, theEvent) Quartz.CGEventSetType(theEvent, Quartz.kCGEventLeftMouseUp) Quartz.CGEventPost(Quartz.kCGHIDEventTap, theEvent) Quartz.CGEventPost(Quartz.kCGHIDEventTap, theEvent) Quartz.CGEventSetType(theEvent, Quartz.kCGEventLeftMouseDown) Quartz.CGEventPost(Quartz.kCGHIDEventTap, theEvent) Quartz.CGEventSetType(theEvent, Quartz.kCGEventLeftMouseUp) Quartz.CGEventPost(Quartz.kCGHIDEventTap, theEvent) print("Double click event ended")
Example #4
Source File: mouse.py From Mousely with MIT License | 5 votes |
def doubleClick(self, x, y, clickCount, button=0): print("Double click event") theEvent = Quartz.CGEventCreateMouseEvent(None, Mouse.down[button], (x, y), button) Quartz.CGEventSetIntegerValueField(theEvent, Quartz.kCGMouseEventClickState, clickCount) Quartz.CGEventPost(Quartz.kCGHIDEventTap, theEvent) Quartz.CGEventSetType(theEvent, Quartz.kCGEventLeftMouseUp) Quartz.CGEventPost(Quartz.kCGHIDEventTap, theEvent) Quartz.CGEventPost(Quartz.kCGHIDEventTap, theEvent) Quartz.CGEventSetType(theEvent, Quartz.kCGEventLeftMouseDown) Quartz.CGEventPost(Quartz.kCGHIDEventTap, theEvent) Quartz.CGEventSetType(theEvent, Quartz.kCGEventLeftMouseUp) Quartz.CGEventPost(Quartz.kCGHIDEventTap, theEvent) print("Double click event ended")
Example #5
Source File: _pyautogui_osx.py From pyautogui with BSD 3-Clause "New" or "Revised" License | 5 votes |
def _multiClick(x, y, button, num): btn = None down = None up = None if button == LEFT: btn = Quartz.kCGMouseButtonLeft down = Quartz.kCGEventLeftMouseDown up = Quartz.kCGEventLeftMouseUp elif button == MIDDLE: btn = Quartz.kCGMouseButtonCenter down = Quartz.kCGEventOtherMouseDown up = Quartz.kCGEventOtherMouseUp elif button == RIGHT: btn = Quartz.kCGMouseButtonRight down = Quartz.kCGEventRightMouseDown up = Quartz.kCGEventRightMouseUp else: assert False, "button argument not in ('left', 'middle', 'right')" return mouseEvent = Quartz.CGEventCreateMouseEvent(None, down, (x, y), btn) Quartz.CGEventSetIntegerValueField(mouseEvent, Quartz.kCGMouseEventClickState, num) Quartz.CGEventPost(Quartz.kCGHIDEventTap, mouseEvent) Quartz.CGEventSetType(mouseEvent, up) Quartz.CGEventPost(Quartz.kCGHIDEventTap, mouseEvent) for i in range(0, num-1): Quartz.CGEventSetType(mouseEvent, down) Quartz.CGEventPost(Quartz.kCGHIDEventTap, mouseEvent) Quartz.CGEventSetType(mouseEvent, up) Quartz.CGEventPost(Quartz.kCGHIDEventTap, mouseEvent)
Example #6
Source File: _pyautogui_osx.py From Dindo-Bot with MIT License | 5 votes |
def _multiClick(x, y, button, num): btn = None down = None up = None if button == LEFT: btn = Quartz.kCGMouseButtonLeft down = Quartz.kCGEventLeftMouseDown up = Quartz.kCGEventLeftMouseUp elif button == MIDDLE: btn = Quartz.kCGMouseButtonCenter down = Quartz.kCGEventOtherMouseDown up = Quartz.kCGEventOtherMouseUp elif button == RIGHT: btn = Quartz.kCGMouseButtonRight down = Quartz.kCGEventRightMouseDown up = Quartz.kCGEventRightMouseUp else: assert False, "button argument not in ('left', 'middle', 'right')" return mouseEvent = Quartz.CGEventCreateMouseEvent(None, down, (x, y), btn) Quartz.CGEventSetIntegerValueField(mouseEvent, Quartz.kCGMouseEventClickState, num) Quartz.CGEventPost(Quartz.kCGHIDEventTap, mouseEvent) Quartz.CGEventSetType(mouseEvent, up) Quartz.CGEventPost(Quartz.kCGHIDEventTap, mouseEvent) for i in range(0, num-1): Quartz.CGEventSetType(mouseEvent, down) Quartz.CGEventPost(Quartz.kCGHIDEventTap, mouseEvent) Quartz.CGEventSetType(mouseEvent, up) Quartz.CGEventPost(Quartz.kCGHIDEventTap, mouseEvent)
Example #7
Source File: OSXUIFunc.py From Poco with Apache License 2.0 | 5 votes |
def doubleclick(x, y, button=1): theEvent = Quartz.CGEventCreateMouseEvent(None, pressID[button], (x, y), button - 1) Quartz.CGEventSetIntegerValueField(theEvent, Quartz.kCGMouseEventClickState, 2) Quartz.CGEventPost(Quartz.kCGHIDEventTap, theEvent) Quartz.CGEventSetType(theEvent, Quartz.kCGEventLeftMouseUp) Quartz.CGEventPost(Quartz.kCGHIDEventTap, theEvent) Quartz.CGEventSetType(theEvent, Quartz.kCGEventLeftMouseDown) Quartz.CGEventPost(Quartz.kCGHIDEventTap, theEvent) Quartz.CGEventSetType(theEvent, Quartz.kCGEventLeftMouseUp) Quartz.CGEventPost(Quartz.kCGHIDEventTap, theEvent)
Example #8
Source File: _pyautogui_osx.py From xbmc with GNU General Public License v3.0 | 5 votes |
def _multiClick(x, y, button, num): btn = None down = None up = None if button == LEFT: btn = Quartz.kCGMouseButtonLeft down = Quartz.kCGEventLeftMouseDown up = Quartz.kCGEventLeftMouseUp elif button == MIDDLE: btn = Quartz.kCGMouseButtonCenter down = Quartz.kCGEventOtherMouseDown up = Quartz.kCGEventOtherMouseUp elif button == RIGHT: btn = Quartz.kCGMouseButtonRight down = Quartz.kCGEventRightMouseDown up = Quartz.kCGEventRightMouseUp else: assert False, "button argument not in ('left', 'middle', 'right')" return mouseEvent = Quartz.CGEventCreateMouseEvent(None, down, (x, y), btn) Quartz.CGEventSetIntegerValueField(mouseEvent, Quartz.kCGMouseEventClickState, num) Quartz.CGEventPost(Quartz.kCGHIDEventTap, mouseEvent) Quartz.CGEventSetType(mouseEvent, up) Quartz.CGEventPost(Quartz.kCGHIDEventTap, mouseEvent) for i in range(0, num-1): Quartz.CGEventSetType(mouseEvent, down) Quartz.CGEventPost(Quartz.kCGHIDEventTap, mouseEvent) Quartz.CGEventSetType(mouseEvent, up) Quartz.CGEventPost(Quartz.kCGHIDEventTap, mouseEvent)