triorare.blogg.se

Mouse status iohub psychopy
Mouse status iohub psychopy







mouse status iohub psychopy

También se mantiene ( la versión actual es 5 ) y tienen un ejemplo que mide la duración de la pulsación de teclas. Si la precisión es importante, tal vez pruebe el TScope de GPL, que es una biblioteca de C hay un artículo al respecto (lamentablemente la versión anterior) con un número moderado de citas. Writer = csv.writer(datafile, delimiter=" ") Msg = visual.TextStim(win, text='press a key\n to quit')ĭatafile = open("touch duration.csv", "wb") #$not overwriting but longer from _future_ import divisionįrom psychopy import visual, event, core, data, iohubįrom psychopy.iohub import launchHubServerĭate = data.getDateStr(format='%Y_%b_%d_%H%M')#(format="%Y_%m_%d %H:%M (Year_Month_Day Hour:Min)") It might not be very good written I a python beginner, but it is useful. Thanks to Jonas Londelov, I've been able to rewrite the script for measuring multiple keys until esc is pressed and writing the key duration, the key and the info into an excel sheet.

#Mouse status iohub psychopy full

If measuring key strokes is the only thing you need, psychopy may be a bit heavy since it is meant for running full experiments, but it will do the job! Print 'key lasted', clock.getTime(), 'seconds' Key, time = event.waitKeys(timeStamped=True)

mouse status iohub psychopy

Win = visual.Window() # Disadvantage: you need to have a window open to record it. Using pyglet: from psychopy import visual, event, core

mouse status iohub psychopy

and BTW, all key event info was', key_info Print 'Press time was', key_info.duration Key_info = keyboard.waitForReleases() # Just grab first release, even if there are multiple Keyboard = io.devices.keyboard # handy name from psychopy.iohub import launchHubServer You can see the documentation for keyboard here. Iohub is a crazy powerful way to get any information about any kind of input to your system, from keyboard, mouse, eye-trackers, etc.









Mouse status iohub psychopy