To import ExampleResponseDevice, you can either use:
from psychopy_plugin_template.hardware.exampleResponseDevice import ExampleResponseDevice
from psychopy.hardware import ExampleResponseDevice
Blank hardware object to showcase how to make a new type of hardware object for a response device.
Should be deleted before publishing your plugin.
List of listeners to send responses to
list[psychopy.hardware.listeners.BaseListener]
List of responses received by this device object
list[ExampleResponse]
If True, then mute any responses gathered when the PsychoPy window is not in focus
bool
Add a listener, which will receive all the same messages as this device.
listener (str or psychopy.hardware.listener.BaseListener) – Either a Listener object, or use one of the following strings to create one: - “liaison”: Create a LiaisonListener with DeviceManager.liaison as the server - “print”: Create a PrintListener with default settings - “log”: Create a LoggingListener with default settings
startLoop (bool) – If True, then upon adding the listener, start up an asynchronous loop to dispatch messages.
Remove any listeners from this device.
True if completed successfully
bool
Clear any responses stored on this Device.
True if completed successfully
bool
Method to dispatch messages from the device to any nodes or listeners attached.
Get all available devices of this type.
List of dictionaries containing the parameters needed to initialise each device.
list[dict]
Generate a dictionary describing this device by finding the profile from getAvailableDevices which represents the same physical device as this object.
Dictionary representing this device
dict
Convert the output of getDeviceProfile to a JSON string.
asString (bool) – If True, then the output will be converted to a string, otherwise will simply be a JSON-friendly dict.
JSON string (or JSON friendly dict) of getDeviceProfile.
str or dict
Determine whether this object represents the same physical device as a given other object.
other (BaseDevice, dict) – Other device object to compare against, or a dict of params.
True if the two objects represent the same physical device
bool
Programatically make a response on this device. The device won’t necessarily physically register the response, but it will be stored in this object same as an actual response.
example (Function takes the same inputs as the response class for this device. For)
KeyboardDevice (in)
inputs
code (are)
name. (tDown and)
The response object created
BaseResponse
Method called when a parsed message is received. Includes code to send to any listeners and store the response.
message – Parsed message, should be an instance of this Device’s responseClass
True if completed successfully
bool
alias of ExampleResponse