Skip to content

Keypress Response

A keypress response records all keys that a participant presses during a trial.

Keypress is a background response, meaning that it is invisible to participants. It can be used to record background keypresses passively.

Required Properties

type

  • Definition: The type of response
  • Possible values: For a keypress response, type must be specified as "keypress".
1
2
3
{
  "type": "keypress"
}

Optional Properties

blacklist

  • Definition: A list of characters to indicate which keys FindingFive should not monitor. Key presses outside the blacklist are recorded.
  • Possible values: A list of keys (i.e. ["d", " ", "k"]).
  • Default value: None
  • See Also: whitelist
1
2
3
4
{
  "type": "keypress",
  "blacklist": ["d", " ", "k"]
}

delay

  • Definition: Delay the displaying of a response (relative to the latest onset of all stimuli on a given trial) by a certain number of seconds. This setting can be useful for forcing participants to read some text before making a response.
  • Possible values: A number of seconds. Decimals are supported.
  • Default value: 0
  • This property is useful for forcing participants to read some text stimulus before responding.
1
2
3
4
{
  "type": "keypress",
  "delay": 1.2
}

multiple

  • Definition: If true, then record all key presses during a trial; if false, only the first key press will be recorded.

    Note

    When there is only a keypress response on a trial, and multiple is set to false, the trial will terminate once the key press is recorded.

  • Possible values: true, false

  • Default value: true

1
2
3
4
{
  "type": "keypress",
  "multiple": false
}
In this example code, only the first keypress will be recorded, and the trial will move on automatically.

parent

  • Definition: If specified, this response will inherit all properties from another defined response (aka, the parent), unless the same property is explicitly defined in this response.
  • Possible values: The name of another defined response.

Given a response named "response1" defined as follows:

1
2
3
4
5
{
  "type": "keypress",
  "delay": 1.2,
  "multiple": false
}

We can create a child response "response2" that inherits the delay and multiple properties of "response1".

1
2
3
4
{
  "type": "keypress",
  "parent": "response1"
}

whitelist

  • Definition: a list of characters, such as ["d", " ", "k"], to indicate which keys FindingFive should monitor. Key presses outside the whitelist are ignored and not recorded.
  • Possible values: A list of keys (i.e. ["d", " ", "k"]).
  • Default value: none
  • See Also: blacklist
1
2
3
4
{
  "type": "keypress",
  "whitelist": ["d", " ", "k"]
}

Recorded Data

  • value: the text typed in by the participant
  • rt: the duration in milliseconds between the last key press and the current one; for the first key press, rt is the duration between the activation of this response and the first key press.