

‘namedtuple’: Each event is converted to a namedtuple object. ‘list’: Each event is a list of ordered attributes. Result in only events from that device being returned.Įvents can be received in one of several object types by providing the Providing a valid device name as the device_label argument will If events are only needed from one device instead of all devices, When events are retrieved from an event buffer, they are removed from With each event being represented as a namedtuple of all event Retrieve any events that have been collected by the ioHub Processįrom monitored devices since the last call to getEvents() orīy default all events for all monitored devices are returned, getEvents ( device_label = None, as_type = 'namedtuple' ) ¶ The ioHubDeviceView instance for deviceName. Or if the device is not enabled on the ioHub server None is returnedĭeviceName ( str) – Name given to the ioHub Device to be returned Returns : However the advantage of using getDevice(device_name) is that anĮxception is not created if you provide an invalid device name, To be accessed and you are sure it is actually enabled on the ioHubĪn example of accessing a device using the. devices attribute is handy if you know the name of the device None if the device name specified does not exist. getDevice(name) method can be used and will return devices attribute, providing ‘dot name’ access to enabled devices.Īlternatively, the.

These device objects can be accessed via the ioHubConnection Instances that have been created so that events from the device can be The ioHubConnection class is also used as the interface to any ioHub Device Shut down and disconnect the ioHub Server process. IoHubConnection is responsible for creating, sending requests to, and ioHubConnection ( ioHubConfig = None, ioHubConfigAbsPath = None ) ¶ The object returned from the launchHubServerįunction provides methods for controlling the iohub process andĪccessing iohub devices and events. ( of different ways to use the launchHubServer) – quit ()Įxamples ( Please see the psychopy/demos/coder/iohub/launchHub.py demo for) –įunction. format ( keys )) print ( "Exiting experiment." ) # Stop the ioHub Server io. waitForKeys ( keys = ) print ( "Key press detected: ". io = launchHubServer () print ( "Press any Key to Exit Example." ) # Wait until a keyboard event occurs keys = io. 'io' can now be used during the # experiment to access iohub devices and read iohub device events. Psychopy_monitor ( ( deprecated )) – The path to a Monitor Center config fileįrom import launchHubServer # Start the ioHub process. ( str) – Add an ioHub Device by using the device class path as the key, and the device’s configuration the ‘device_list’ section of the yaml file. Iohub_config_name ( str) – Specifies the name of the iohub_config.yaml file that contains the ioHub Device
PSYCHOPY DEMOS UPDATE
Information like display size, viewing distance,Ĭoord / color type is used to update the ioHub Display device. Window ( ) – The psychoPy experiment window being used. Session_info ( dict) – Can be used to save the following session metadata fields:Ĭode (<=256 chars), name (<=256 chars), comments (<=4096 chars), user_variables (dict)ĭatastore_name ( str) – Used to provide an ioHub HDF5 file name different than the session_code. Session_code ( str, <= 256 char) – When specified, used as the name of the ioHub HDF5 file created for the session.Įxperiment_info ( dict) – Can be used to save the following experiment metadata fields:Ĭode (<=256 chars), title (<=256 chars), description (<=4096 chars), version (<=32 chars) One or more of the following keyword arguments when calling the function: Parameters :Įxperiment_code ( str, <= 256 char) – If experiment_code is provided, an ioHub HDF5 file will be created for the session. To customize how the ioHub Server is initialized when started, use Mouse: named ‘mouse’, with runtime event reporting enabled. Keyboard: named ‘keyboard’, with runtime event reporting enabled. The following Devices are enabled by default: IoHub HDF5 file, events are available to the experiment program at runtime.

object that is used toĪccess enabled iohub device’s events, get events, and control theīy default (no kwargs specified), the ioHub server does not create an Starts the ioHub Server subprocess, and return a The easiest way to do this is by calling the launchHubServer function.

To use ioHub within your PsychoPy ® Coder experiment script, ioHub needs toīe started at the beginning of the experiment script.
