Announcement

Collapse
No announcement yet.

pyxid: two responses per button press

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Hisham
    replied
    Alas no, not when using the pyxid library.

    Leave a comment:


  • angrypanda
    started a topic pyxid: two responses per button press

    pyxid: two responses per button press

    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
Working...
X