Page History: Button Element
Compare Page Revisions
Page Revision: 2015/01/13 11:03
|
Button element
|
Info |
Category: |
Behaviour Control |
|
AddIn: |
Base Elements |
Creator: |
OkazoLab Team |
|
Scope: |
Parent Event |
Owns Snippets: |
no |
|
Usage: |
Runtime Screen,Snippets |
Actions aligned with epochs of the parent event
Epoch | Actions |
---|
After Onset | The element starts monitoring key presses and releases |
Control Loop step | Triggered snippet is invoked if the button state changes according to the the selected triggering mode. |
Before Offset | The element stops monitoring key presses and releases |
Properties
Generic properties
Name | Description | Constraints | Value Type | Upon Change |
---|
Control |
Input Device | Select one of the input devices currently connected to the computer. E.g Mouse, Keyboard etc.. | | String | |
Button | Defines a button which presses are registered by the element.
If 'Any Button' selected then the element registers presses of all buttons on the device. The pressed button name is indicated by the Triggered Button property. | | Int32 | |
Triggering Mode | Defines the triggering mode for button. First Press Only mode is recommended for response time measurements. | | enum | |
Runtime status |
Triggered button | Returns a system name of the triggered button. The keyboard symbol buttons are often denoted by the capital letters, like 'A', whereas the mouse and gamepad buttons are indicated by long names like 'Button 1'" | | String | |
Is Down | Indicates whether the button is currently in the down state. | | Boolean | |
Triggering Time | Returns a local event time (in ms) of the last button triggering. The value can be used an accurate measure of the response time | | clTime | |
Is Triggered | Indicates whether a button has been triggered at least once since the onset of the parent event. The property resets on each onset of the parent event. This property is commonly used for moving between events. | | Boolean | |
+=== Properties inherited from clElement ===
Inherited properties of clElement
Name | Description | Constraints | Value Type | Upon Change |
---|
Control |
Is Enabled | If set to false the element is completely omitted when the experiment is run. | | Boolean |
|
Title | Title of the element. | | String |
|
Button element detects button presses and releases on standard input devices supported by
DirectInput API. Such devices include keyboard, mouse, and a variety of joysticks and gamepads. The element collects timing statistics and, therefore is a default choice for recording of participant responses. The element allows using multiple input devices in parallel.
Snapshots
Event with two buttons elements detecting presses of 'Z' and '/' keys |
Practical use
You can use the button element for collecting participant responses during a single
event. The element records all necessary statistics, e.g. a name of the pressed key and a time of the press/release. There are 5 triggering modes, in which the Button element can operate. You need to select the triggering mode at design time, according to your requirements.
Triggering modes
Creating a button to move to the next Event
Instead of moving from one event to another by a set time interval, one may wish to move on only when a button is pressed. To do so:
Prerequisite :
One should have flow routes already defined. The flow route of the current event should be set to be triggered by condition.
- On an event, click on "new element", under the category: "BEHAVIOURAL INPUT", select the "Button" element.
- Navigate to the properties of the button element that you've just added.
- Triggering mode can be changed if desired. (E.g when you first press the button, or when you press and hold the button etc...).
- In the "Button" property, there are two ways of selecting the button. You may click on the 'Button List' and select the button that you wish to associate with this element. Alternatively you can press on the "Press Detector" tab and then press the button on the keyboard that should fire up the trigger. By default any button will cause the element to fire up.
- Find the "Is Triggered" property and create a proxy variable such as "ButtonToContinue". (See Proxy variables if unsure how to create them).
- In the bottom snippets plane, click on 'flow conditions', and paste the name of the proxy variable. e.g ButtonToContinue. Since this is a boolean, the flow will only continue when this boolean variable will be true (i.e the button was pressed).
Notes
The default settings allow detection only of the first button press. The following presses will be ignored. Change properties in the BEHAVIOUR group according to your requirements.)))