Detail
Adds the ability to create a Joystick device from Experiment object's Devices tab so that responses can be made through the joystick without using port communications. USB joysticks and gamepads are fully supported. Note that the device must be recognized in Windows as a Human Interface Device, Joystick, or Gamepad. This device currently supports four separate button responses as well as polling for X/Y coordinates in E-Prime 2.0. This device currently supports 8 separate button responses, polling for X/Y coordinates, and access to POV and slider controls in E-Prime 2.0 Professional.
The device will appear in the "Add Devices" dialog. To access it, double-click the Experiment object at the top of the Structure window, navigate to the Devices tab, and click the "Add" button.

The Joystick device can be added as an input mask in E-Prime 2.0 Professional to any RteRunnableInputObject (e.g., Wait, TextDisplay, ImageDisplay, Slide, SoundOut, MovieDisplay) in the same manner as any other response collection device. Open the RteRunnableInputObject's Property Pages, navigate to the Duration/Input tab, and click the "Add" button immediately below the list of Input Mask Devices. In the Add Input Device dialog box, select the Joystick and click "OK".

The Joystick device will be "attached" to the mouse cursor and can be controlled by the joystick/gamepad.
In E-Prime 2.0 Professional, once the Joystick device has been added to the Experiment object, you can add it as an input mask on any response object (see the above section Adding the Joystick Device as an Input Mask). You can then specify the allowable buttons (1-8). Note, however, that only button responses can be accessed directly through the graphical interface. If you want to gain access to the joystick/gampepad X/Y coordinates or POV/slider controls, you will need to use the JoystickResponseData object, which has the following properties:
Below is an example of the script used to access and log the various properties available from a Joystick device response. Note that this script assumes that the object collecting the response is named Stimulus.
As an example, say you will present a stimulus to the subject using a TextDisplay, and you only want this stimulus to be removed from the screen when the subject presses joystick button 1. You want to log the response time, their RT relative to the onset of the TextDisplay object, and the joystick cursor's X and Y coordinates. First, you must set up the TextDisplay object to have a Duration of 0. Then, you must place an InLine immediately following the TextDisplay. This InLine will consist only of a loop that runs until a response is detected (this script assumes the TextDisplay object used is named Stimulus):
Note that the joystick is essentially linked to the mouse cursor (see Controlling the Mouse Cursor with the Joystick for more information), and thus Mouse.GetCursorPos is used.
This topic applies to:
E-Prime 2.0
E-Prime 2.0 Professional
This item has been introduced in E-Prime 2.0 (2.0.1.14)
Adds the ability to create a Joystick device from Experiment object's Devices tab so that responses can be made through the joystick without using port communications. USB joysticks and gamepads are fully supported. Note that the device must be recognized in Windows as a Human Interface Device, Joystick, or Gamepad. This device currently supports four separate button responses as well as polling for X/Y coordinates in E-Prime 2.0. This device currently supports 8 separate button responses, polling for X/Y coordinates, and access to POV and slider controls in E-Prime 2.0 Professional.
The device will appear in the "Add Devices" dialog. To access it, double-click the Experiment object at the top of the Structure window, navigate to the Devices tab, and click the "Add" button.

Adding the Joystick device as an Input Mask
NOTE: The following applies to E-Prime 2.0 Professional only.The Joystick device can be added as an input mask in E-Prime 2.0 Professional to any RteRunnableInputObject (e.g., Wait, TextDisplay, ImageDisplay, Slide, SoundOut, MovieDisplay) in the same manner as any other response collection device. Open the RteRunnableInputObject's Property Pages, navigate to the Duration/Input tab, and click the "Add" button immediately below the list of Input Mask Devices. In the Add Input Device dialog box, select the Joystick and click "OK".

Controlling the Mouse cursor with the Joystick
The Joystick device can be used to control the system mouse cursor. To do this, first ensure that the Mouse device is enabled in the experiment (it is by default) via the Devices tab in the Experiment object Property Pages. Open the Mouse device properties and set Show Cursor to "Yes" (alternatively, you can use Mouse.ShowCursor in an InLine during the experiment if you only want the cursor to be visible at certain parts of the experiment - see Mouse.ShowCursor in the E-Basic Online Help for more information). Then, in an InLine at the start of the experiment, enter the following script:Joystick.AttachToMouseCursor = True |
The Joystick device will be "attached" to the mouse cursor and can be controlled by the joystick/gamepad.
Using the JoystickResponseData Object
NOTE: The following applies to E-Prime 2.0 Professional only.In E-Prime 2.0 Professional, once the Joystick device has been added to the Experiment object, you can add it as an input mask on any response object (see the above section Adding the Joystick Device as an Input Mask). You can then specify the allowable buttons (1-8). Note, however, that only button responses can be accessed directly through the graphical interface. If you want to gain access to the joystick/gampepad X/Y coordinates or POV/slider controls, you will need to use the JoystickResponseData object, which has the following properties:
Property | Description |
---|---|
RESP | The number corresponding to the button pressed for this particular response. |
RT | The reaction time value of the response in relation to the onset time of the object collecting the response. |
RTTime | The reaction time value of the response in relation to the start of the experiment.</td |
IsButton1-8 | Returns a Boolean value (i.e. True or False) in regards to whether the specified button was pressed at the time of the response. For example, JoystickResopnseData.IsButton2 will return True if button 2 is pressed at the time of the response. While a JoystickResponseData object corresponds to only a single response, these properties can return True for multiple buttons if they are all depressed at the time of the response. For example, if button 2 is depressed at the start of the experiment and held until the Stimulus object appears, and then button 3 is also pressed, IsButton2 and IsButton3 will both return True, even through the RESP property will report only 3. |
CursorX | Returns the X joystick position as it relates to a pixel on the screen. If you are using a 640 x 480 resolution, this property will return a value between 0 and 640. |
CursorY | Returns the Y joystick position as it relates to a pixel on the screen. If you are using a 640 x 480 resolution, this property will return a value between 0 and 480. |
PointOfView1-2 | Returns the position of the corresponding POV control as a degree value. For example, if the POV control designated as 1 on the joystick is held left (or west), JoystickResponseData.PointOfView1 will report 270. This property returns the following values: North - 0 North East - 45 East - 90 South East - 135 South - 180 South West - 225 West - 270 North West - 335 No Position - -1 |
Slider1-2 | Returns the value of the corresponding slider control from 1-10. For example, if the slider control designated as 1 on the joystick is held in position 7, JoystickResponseData.Slider1 will report 7. |
Below is an example of the script used to access and log the various properties available from a Joystick device response. Note that this script assumes that the object collecting the response is named Stimulus.
|
Collecting Responses Using InLine Script
Since adding the Joystick device as an input mask is available only in E-Prime 2.0 Professional, script is necessary to collect joystick responses in E-Prime 2.0 Standard (this can also be done in E-Prime 2.0 Professional, but using the JoystickResponseData type is preferred).As an example, say you will present a stimulus to the subject using a TextDisplay, and you only want this stimulus to be removed from the screen when the subject presses joystick button 1. You want to log the response time, their RT relative to the onset of the TextDisplay object, and the joystick cursor's X and Y coordinates. First, you must set up the TextDisplay object to have a Duration of 0. Then, you must place an InLine immediately following the TextDisplay. This InLine will consist only of a loop that runs until a response is detected (this script assumes the TextDisplay object used is named Stimulus):
|
Note that the joystick is essentially linked to the mouse cursor (see Controlling the Mouse Cursor with the Joystick for more information), and thus Mouse.GetCursorPos is used.
This topic applies to:
E-Prime 2.0
E-Prime 2.0 Professional
This item has been introduced in E-Prime 2.0 (2.0.1.14)
Comments
0 comments
Please sign in to leave a comment.