neoscore.core.mouse_event

class neoscore.core.mouse_event.MouseButton[source]

Bases: Enum

Enum for mouse buttons.

This currently only supports left, middle, and right buttons.

The enum integer values are arbitrary and may change in the future.

LEFT = 1
MIDDLE = 2
RIGHT = 3
class neoscore.core.mouse_event.MouseEventType[source]

Bases: Enum

Enum for mouse event types.

The enum integer values are arbitrary and may change in the future.

MOVE = 1

The mouse was moved

PRESS = 2

A mouse button was pressed

RELEASE = 3

A mouse button was released

DOUBLE_CLICK = 4

A mouse button was double clicked

class neoscore.core.mouse_event.MouseEvent[source]

Bases: object

A mouse input event.

__init__(event_type: MouseEventType, button: Optional[MouseButton], window_pos: Tuple[int, int], document_pos: Point) None
event_type: MouseEventType

The type of the event

button: Optional[MouseButton]

The button pressed, if any.

For mouse move events, this is the button pressed down while moving. For press and double click events, this is the button that caused the event. For release events, this is None.

Mouse events with multiple simultaneous button presses will somewhat arbitrarily return the first button pressed in order left, right, then middle.

window_pos: Tuple[int, int]

The mouse position on the window in x, y pixels.

document_pos: Point

The document-space position of the mouse.