Thread: pyxid: two responses per button press View Single Post
Junior Member
Join Date: Nov 2016
angrypanda is on a distinguished road Posts: 4
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!
devices = pyxid.get_xid_devices()
buttonBox = devices[0]
break # found a device so can break the loop
except Exception:
if not buttonBox:
logging.error('could not find a Cedrus device.')

print devices


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

while True:
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