A class implementing a mouse input.
Methods
Initialize a mouse input.
Parameters : | show_cursor : bool, optional
track_button_events : bool, optional
track_motion_events : bool, optional
|
---|
Notes
It is strongly suggest to avoid tracking of motions events, (track_motion_events=True), because it quickly causes an overflow in the Pygame event queue and you might consequently loose important events.
Return (True/False) if a specific button is currently pressed.
Returns : | btn_id : int
|
---|
Check the mouse wheel.
Returns : | direction : str
|
---|
Clear the event cue from mouse events.
Get the cursor.
Get the last button down event.
Returns : | btn_id : int
|
---|
Get the last button up event.
Returns : | btn_id : int
|
---|
Hide the cursor.
Parameters : | track_button_events : bool, optional
track_motion_events : bool, optional
|
---|
Getter of mouse position.
Getter for pressed buttons.
Set the cursor.
Parameters : | size : (int, int)
hotspot : (int, int)
xormask : list
andmask : list
|
---|
Show the cursor.
Parameters : | track_button_events : bool, optional
track_motion_events : bool, optional
|
---|
Getter for track_button_events.
Getter for track_motion_events.
Switch on/off the buffering of motion events in the Pygame event queue.
Notes
It is strongly suggest to avoid tracking of motions events, (track_motion_events=True), because it quickly causes an overflow in the Pygame event queue and you might consequently loose important events.
Wait for a mouse event (i.e., motion, button press or wheel event)
Parameters : | wait_button : bool, optional
wait_motion : bool, optional
buttons : int or list, optional
duration : int, optional
wait_for_buttonup : bool, optional
|
---|---|
Returns : | event_id : int
move : bool
pos : (int, int)
rt : int
|
Notes
button id coding - None for no mouse button event or - 0,1,2 for left. middle and right button or - 3 for wheel up or - 4 for wheel down (wheel works only for keydown events).
Wait for a mouse motion.
Parameters : | duration : int, optional
|
---|---|
Returns : | pos : (int, int)
rt : int
|
Wait for a mouse button press or mouse wheel event.
Parameters : | buttons : int or list, optional
duration : int, optional
wait_for_buttonup : bool, optional
|
---|---|
Returns : | event_id : int
pos : (int, int)
rt : int
|
Notes
button id coding - None for no mouse button event or - 0,1,2 for left. middle and right button or - 3 for wheel up or - 4 for wheel down (wheel works only for keydown events).