pyasge.MOUSE

pyasge.MOUSE = <module 'pyasge.MOUSE'>

The mouse submodule is a collection of easy to use constants that describe the various codes for mouse buttons and the types of actions supported. These can be used to create input handlers that are easier to read and maintain.

Example

>>> import pyasge
>>> def click_event(self, event: pyasge.ClickEvent) -> None:
>>>   if event.button is pyasge.MOUSE.MOUSE_BTN1:
>>>     if event.action is pyasge.MOUSE.BUTTON_PRESSED:
>>>       print("MOUSE BUTTON 1 PRESSED")
>>>     else:
>>>       print("MOUSE BUTTON 1 RELEASED")

Actions

MOUSE.BUTTON_PRESSED = 1
MOUSE.BUTTON_RELEASED = 0

Buttons

MOUSE.MOUSE_BTN1 = 0
MOUSE.MOUSE_BTN2 = 1
MOUSE.MOUSE_BTN3 = 2
MOUSE.MOUSE_BTN4 = 3
MOUSE.MOUSE_BTN5 = 4