Previous topic

psychopy.hardware - hardware interfaces

Next topic

Cambridge Research Systems Ltd.

Quick links

Cedrus

Cedrus make a variety of input devices. See http://www.cedrus.com/


class psychopy.hardware.cedrus.RB730(port, baudrate=115200, mode='XID')

Class to control/read a Cedrus RB-series response box

class KeyEvent(XID)

Info about a keypress from Cedrus keypad XID string

XID should contain a “k”<info><rt> where info is a byte and rt is 4 bytes (=int)

RB730.clearBuffer()
Empty the input buffer of all characters. Call this to clear any keypresses that haven’t yet been handled.
RB730.getBaseTimer()
Retrieve the current time on the base timer
RB730.getInfo()
Get the name of this device
RB730.getKeyEvents(allowedKeys=[, 1, 2, 3, 4, 5, 6, 7], downOnly=True)

Return a list of keyEvents Each event has the following attributes:

keyEvt.key is the button pressed (or released) (an int) keyEvt.rt [=float] is the time (in secs) since the rt clock was last reset (a float) keyEvt.direction is the direction the button was goin (‘up’ or ‘down’)

allowedKeys will limit the set of keys that are returned (WARNING: info about other keys is discarded) downOnly limits the function to report only the downward stroke of the key

RB730.readMessage()
Read and return an unformatted string from the device (and delete this from the buffer)
RB730.waitKeyEvents(allowedKeys=[, 1, 2, 3, 4, 5, 6, 7], downOnly=True)
Like getKeyEvents, but waits until a key is pressed