Thread Tools  
angrypanda
Junior Member
 
Join Date: Nov 2016
angrypanda is on a distinguished road Posts: 3
pyxid: two responses per button press, Posted November 25th, 2016 #1
Dear All,

I finally managed to get pyxid working (it turns out that the standalone version of Psychopy 1.84.1 had older versions of pyserial and pyxid, without some necessary bug fixes). In the end I had to follow the instructions to install Python and Psychopy manually (which wasn't that straightforward), but at least it now works. Kinda.

When I use the cedrus suggested python code and report (using print) the content of "response" i.e.

from __future__ import division
import pyxid
from psychopy import visual, core

# get a list of all attached XID devices
#devices = pyxid.get_xid_devices()

buttonBox = None
for n in range(10): # doesn't always work first time!
try:
devices = pyxid.get_xid_devices()
core.wait(0.1)
buttonBox = devices[0]
break # found a device so can break the loop
except Exception:
pass
if not buttonBox:
logging.error('could not find a Cedrus device.')
core.quit()

print devices

core.wait(10.0)

dev = devices[0] # get the first device to use
if dev.is_response_device():
dev.reset_base_timer()
dev.reset_rt_timer()

while True:
dev.poll_for_response()
if dev.response_queue_size() > 0:
response = dev.get_next_response()
print response['key']
# do something with the response

Then for each trigger or button press on the Lumina I get two lines of response - presumably for the button down and up. Is there any way to limit the response to solely the button down?

Cheers, Jon
Reply With Quote
Hisham
Founder
 
Join Date: Aug 2006
Location: San Pedro, CA
Hisham is on a distinguished road Posts: 1,162
Posted January 10th, 2017 #2
Alas no, not when using the pyxid library.
Reply With Quote
Thread Tools
Posting Rules
Forum Jump:
Copyright Cedrus Corporation, 1991-2014.
All times are GMT -7. The time now is 12:17 AM.