Difference between revisions of "User Reference:Logging Input"

From BCI2000 Wiki
Jump to: navigation, search
(See also)
(See also)
Line 38: Line 38:
  
 
==See also==
 
==See also==
[[User Reference:KeystrokeFilter]], [[Programming Tutorial:Adding your own Input Logger]]
+
[[User Reference:KeystrokeFilter]], [[Programming Tutorial:Creating your own Input Logger]]
  
 
[[Category:Human Interface Devices]]
 
[[Category:Human Interface Devices]]

Revision as of 11:43, 3 September 2008

BCI2000 allows you to record input from keyboard, mouse, and joystick at sample resolution. This information is recorded into state variables, and recording is enabled by specifying appropriate command line options when starting a source module.

Input from keyboard, mouse, or joystick will occur asynchronously with respect to BCI2000's data processing. To account for this, input events are associated with time stamps, stored in a BCI2000 event queue, and assigned sample positions once data samples have been acquired.

When BCI2000 is distributed across multiple machines in a network, input devices must be attached to the machine that runs the data acquisition module. This is because time stamps of data acquisition and input events must refer to a common physical time base to allow associating input events with sample positions.

In Microsoft Windows, keyboard, mouse and joystick devices attached via USB are limited to a polling rate of 125Hz, corresponding to a temporal resolution of 8ms. When better timing resolution is required, you might consider recording into an additional analog channel, or using the amplifier's trigger input when available.

Parameters

LogKeyboard

--LogKeyboard=1

When set to 1 from the command line, this parameter enables recording of keyboard events into the KeyDown and KeyUp state variables.

LogMouse

--LogMouse=1

When set to 1 from the command line, this parameter enables recording of mouse events.

LogJoystick

--LogJoystick=1

When set to 1 from the command line, this parameter enables recording of joystick state.

States

KeyDown, KeyUp

Key events. When a key is pressed, "KeyDown" will assume the key's virtual key code at the corresponding sample position. When a key is released, the key code will be written into the "KeyUp" state variable.

MouseKeys

Mouse key state, with the left mouse button corresponding to bit 0, and the right mouse button corresponding to bit 1.

MousePosX, MousePosY

Mouse position in screen pixel coordinates.

JoystickXpos, JoystickYpos, JoystickZpos

Position is recorded from Joystick #1. Each position state is ranging from 0 to 32767 with a resting position at 16384.

JoystickButtons1, JoystickButtons2, JoystickButtons3, JoystickButtons4

Joystick button information. Each button state is either 1 when pressed or 0 when not pressed.

See also

User Reference:KeystrokeFilter, Programming Tutorial:Creating your own Input Logger