2
我正在嘗試psychopy的鼠標追蹤功能。對於初學者,我只想記錄是否發生鼠標點擊。即使我不點擊鼠標,它正在打印「被按下」。我正在使用v1.84.2。無論鼠標點擊如何,psychopy鼠標追蹤都會返回true
from psychopy import core, visual, gui, data, misc, event, sound
import time, random, math, os
import numpy as np
import copy
from pygame import mouse, locals, display
screenSize =[1280, 800]
win = visual.Window(size = screenSize, fullscr = True, allowGUI=False, monitor='testMonitor', units='deg')
mouse = event.Mouse(visible=True, newPos=[0,0])
mouse.clickReset()
if mouse.getPressed():
print ("got pressed")
要記錄鼠標點擊,使用'如果任何(mouse.getPressed())'這將註冊向左,向右和滾動點擊。 –