Welcome Guest, you are in: Login

EventIDE Wiki

RSSRSS

Navigation




Search the wiki


PoweredBy

Page History: Button Element

Compare Page Revisions



« Older Revision - Back to Page History - Newer Revision »


Page Revision: 2015/01/14 05:38




Element Icon 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

EpochActions
After OnsetThe element starts monitoring key presses and releases
Control Loop stepTriggered snippet is invoked if the button state changes according to the the selected triggering mode.
Before OffsetThe element stops monitoring key presses and releases

Properties

Generic properties

NameDescriptionConstraintsValue TypeUpon Change
Control
Input DeviceSelect one of the input devices currently connected to the computer. E.g Mouse, Keyboard etc.. enum
Monitored ButtonDefines a button monitored by the element. If 'Any Button' selected, the element monitors all buttons on the selected input device. In this case, a name of the pressed button is indicated by the Triggering Button property at runtime.String
Triggering ModeDefines the triggering mode for button. First Press Only mode is recommended for response time measurements. enum
Runtime status
Triggered buttonReturns 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 DownIndicates whether the monitored button is currently in the down stateBoolean
Triggered ButtonReturns a system name of the triggered button. The keyboard symbol buttons are always shows by the capital letters, whereas the mouse and gamepad buttons are shown by names like 'Button 1'.String
Triggering TimeReturns a local event time (in ms) of the last button triggering. The value can be used an accurate measure of the response timeclTime
Is TriggeredIndicates 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
NameDescriptionConstraintsValue TypeUpon Change
Control
Is EnabledIf set to false the element is completely omitted when the experiment is run.Boolean
TitleTitle of the element.String



Button element detects button presses/releases on standard input devices recognized by DirectInput API. The DirectInput devices include the system keyboard, mouse and some joysticks and gamepads. If you need to record keys on supplementary input devices, e.g. the secondary keyboard, use the HID input element. The Button element collects accurate timing statistics of key presses and releases, hence, it is a recommended choice for recording reaction time of participant responses, when an experiment in run on a standard PC. Multiple button elements can be used to record for one or several input devices in the same time. The button element monitors button presses only within a scope of it's parent event and return local timing statistics, e.g. a press time as the number of milliseconds since the onset of the parent event.


Snapshots

Event with two buttons elements  detecting presses of 'Z' and '/' keys

Event with two buttons elements
detecting presses of 'Z' and '/' keys


Selection of the monitored button

Button element can monitor either one specific button, or all buttons in the same time (when Any button is selected in the Monitored Button property). In many experimental tasks, e.g.2AFC, there are two response buttons for a participant. For that tasks you canuse different design patterns:

  1. Create two button elements, each monitoring one of the response buttons
  2. Create one button element monitoring 'Any' button and write a code that checks, what button is pressed. The name of the pressed button is returned by the Triggered Button property

The first pattern allows to automatically ignore pressed of irrelevant buttons. The second pattern is more convenient for collecting a reaction time in trial, because you can get from a single proxy variable link to the Triggering Time property of the button element.

Triggering modes

The button element is not limited to registering a single key press. There are 5 'triggering' modes, in which the Button element can operate. You need to select the triggering mode in advance, according to your requirements:

  • First Press Only
  • First Release Only
  • Multiple Presses
  • Multiple Releases
  • Holding Down

Depending on the working mode, the element becomes 'triggered' when input pattern is detected. The First Press Only mode is a default choice for registering the fastest reaction time, because in this mode the element ignores all successive presses. Other modes are self-explanatory, save for the holding down mode, which detects continuously presses, common in the game-like activities.

Practical Use

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.


  1. On an event, click on "new element", under the category: "BEHAVIOURAL INPUT", select the "Button" element.
  2. Navigate to the properties of the button element that you've just added.
  3. Triggering mode can be changed if desired. (E.g when you first press the button, or when you press and hold the button etc...).
  4. 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.
  5. Find the "Is Triggered" property and create a proxy variable such as "ButtonToContinue". (See Proxy variables if unsure how to create them).
  6. 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).

Image








Notes

  • The Triggering Time, Is Triggered and Triggered Button properties are nullified on the onset of the parent event.
  • Is Down property can be used a button state flag, independently of the selected triggering mode

ScrewTurn Wiki version 5.2.0.8. Some of the icons created by FamFamFam.