Message
MouseEvent
Bases: AttrEnum
Mouse event message type enumerator
to use as MouseMsg type attribute
MOVE = 'MOVE'
LEFT_CLICK = 'LEFT_CLICK'
MIDDLE_CLICK = 'MIDDLE_CLICK'
RIGHT_CLICK = 'RIGHT_CLICK'
LEFT_PRESS = 'LEFT_PRESS'
MIDDLE_PRESS = 'MIDDLE_PRESS'
RIGHT_PRESS = 'RIGHT_PRESS'
LEFT_RELEASE = 'LEFT_RELEASE'
MIDDLE_RELEASE = 'MIDDLE_RELEASE'
RIGHT_RELEASE = 'RIGHT_RELEASE'
SCROLL_UP = 'SCROLL_UP'
SCROLL_DOWN = 'SCROLL_DOWN'
SCROLL_LEFT = 'SCROLL_LEFT'
SCROLL_RIGHT = 'SCROLL_RIGHT'
MouseMsg
Bases: Msg
Keyboard event message
Parameters:
-
type(MouseEvent) –Mouse event type
-
x(int) –Event horizontal axis coordinates
-
y(int) –Event vertical axis coordinates
-
source(None | MouseIn, default:None) –The
MouseIninstance that generated the message
Tip
Run GUI and Enable mouse input. Use log to get mouse events you need.
matches
matches(
type: None | Container[MouseEvent] | MouseEvent = None,
x: None | Container[int] | int = None,
y: None | Container[int] | int = None,
) -> bool
Checks if message's attributes match all provided attribute conditions:
-
If condition is
Noneor omitted, it matches anything. -
If condition equals attribute, it matches the attribute.
-
If condition is a container (list, tuple) and contains the attribute, it matches the attribute.
Use Not(condition) to invert condition matching.
Returns:
-
bool–Trueif all attributes match,Falseif any does not match