Class for more control over the mouse, including the pointer graphic and bounding box.
Seems to work with pyglet or pygame. Not completely tested.
Known limitations: - only norm units are working - getRel() always returns [0,0] - mouseMoved() is always False; maybe due to self.mouse.visible == False -> held at [0,0] - no idea if clickReset() works
Author: Jeremy Gray, 2011
Class for customizing the appearance and behavior of the mouse.
Use a custom mouse for extra control over the pointer appearance and function. Its probably slower to render than the regular system mouse. Create your visual.Window before creating a CustomMouse.
Parameters: |
|
---|---|
Note: | CustomMouse is a new feature, and subject to change. setPos() does not work yet. getRel() returns [0,0] and mouseMoved() always returns False. clickReset() may not be working. |
Determines whether the stimulus should be automatically drawn on every frame flip.
Value should be: True or False. You do NOT need to set this on every frame flip!
Whether every change in this stimulus should be logged automatically
Value should be: True or False. Set to False if your stimulus is updating frequently (e.g. updating its position every frame) and you want to avoid swamping the log file with messages that aren’t likely to be useful.
Draw mouse (if its visible), show the limit box, update the click count.
Return the number of clicks since the last reset
Returns the mouse’s current position. Influenced by changes in .getRel(), constrained to be in its virtual box.
Return the mouse’s visibility state
String or None. The name of the object to be using during logged messages about this stim. If you have multiple stimuli in your experiment this really helps to make sense of log files!
If name = None your stimulus will be called “unnamed <type>”, e.g. visual.TextStim(win) will be called “unnamed TextStim” in the logs.
Set click count to zero
Sets autoDraw. Usually you can use ‘stim.attribute = value’ syntax instead, but use this method if you need to suppress the log message
Usually you can use ‘stim.attribute = value’ syntax instead, but use this method if you need to suppress the log message
Set the mouse’s bounding box by specifying the edges.
Set the visual item to be drawn as the mouse pointer.
Not implemented yet. Place the mouse at a specific position.
Make the mouse visible or not (pyglet or pygame).