Events¶
-
class
macpy.event.Event¶ Base class for all macpy events.
Pointer¶
-
class
macpy.event.PointerEventMotion(x, y, modifiers)¶ Event representing pointer movement on screen.
-
class
macpy.event.PointerEventButton(x, y, button, state, modifiers)¶ Event representing button events on connected pointing devices.
Button that was pressed/released.
Type: Key
-
__init__(x, y, button, state, modifiers)¶ Event representing button press/release.
Parameters:
-
class
macpy.event.PointerEventAxis(x, y, value, axis, modifiers)¶ Event representing scrolling.
-
axis¶ The axis along which scrolling ocured.
Type: PointerAxis
-
__init__(x, y, value, axis, modifiers)¶ Event representing scrolling.
Parameters: - x (int) – Pointer position on x axis in pixels.
- y (int) – Pointer position on y axis in pixels.
- value (int) – The amount scrolled, exact interpretation of this value is platform-specific.
- axis (PointerAxis) – The axis along which to scroll.
- modifiers (dict) – Modifier key state at the time of this event.
-
Keyboard¶
-
class
macpy.event.KeyboardEvent(key, state, char, modifiers, locks)¶ Event representing key press/release on connected keyboards.
-
__init__(key, state, char, modifiers, locks)¶ Event representing key press/release.
Parameters: - key (Key) – The key that will be pressed/released.
- state (KeyState) – Whether the key will be pressed or released.
- char (str) – The character that will be typed. Currently this is
ignored, you can set it to
None. - modifiers (dict) – Modifier key state at the time of this event.
- locks (dict) – Lock key state at the time of this event.
-
-
class
macpy.event.HotKey(key, modifiers)¶ A hotkey object.
Hotkey object are hashable and compare equal regardless of timestamps.