A class implementing a mouse input.
Calling expyriment.control.intialize(exp) will automatically create a mouse instance and will reference it in exp.mouse for easy access.
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
|
---|
returns if cursor is visible
Getter for logging.
Getter of mouse position.
Getter for pressed buttons.
Set the cursor.
Parameters : | size : (int, int)
hotspot : (int, int)
xormask : list
andmask : list
|
---|
Set logging of this object on or off
Parameters : | onoff : bool
|
---|
Notes
See also design.experiment.set_log_level fur further information about event logging.
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
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