Skip to content

Mouse Position Response

A mouse-position response records the XY coordinates of the mouse at regular intervals during the trial. This is a background response, meaning that it is invisible to participants and records data passively.

Required Properties

type

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

Optional Properties

proportional

  • Definition: Reports the X and Y coordinates as a proportion of the size of the browser window, which is equivalent to the full screen size except in the case of MTurk studies where full-screen mode is not possible. The proportion will be a decimal number between either 0 and 1, -1 and 0, or -0.5 and 0.5, depending on how you define the reference_point (see below).
  • Possible values: true, false
  • Default: false (proportional coordinates will not be collected)
  • See also: reference_point

1
2
3
4
5
6
{
  "type": "mouse_position",
  "sampling_rate": 10,
  "reference_point": "center"
  "proportional": true
}
The above code will provide proportional coordinates between -0.5 and 0.5 because the reference_point is set to "center", which is half of the browser window's width or height (i.e., -0.5 and 0.5 is the maximum distance for the mouse to travel in all directions relative to the reference point). - If reference point was set to "topleft" coordinates will be between 0 and 1 becasue the mouse can travel the full distance of the window to the right of or below the top left corner. - If reference_point was set to "topright", X coordinates will be from 0 to -1 and Y coordinates will be from 0 to 1 because the mouse can travel the full distance of the window to the left of or elow the top right corner.

reference_point

  • Definition: This property indicates where in the pariticpant's browser window counts as the (0,0) position. All X and Y coordinates will be relative to this reference point, with a negative number indicating left of (or above) the point, and a positive number indicating right of (or below) the point.
  • Possible values: "topleft", "topright","center","bottomleft","bottomright"
  • Default: "topleft"
1
2
3
4
5
{
    "type": "mouse_position",
    "sampling_rate": 10,
    "reference_point": "center"
}

sampling_rate

  • Definition: The number of coordinates recorded per second at equal intervals. For instance, a value of 10 will result in 10 mouse coordinates per second, recorded 100ms apart.
1
2
3
4
{
    "type": "mouse_position",
    "sampling_rate": 10
}

Recorded Data

  • value: the X and Y coordinates of the mouse position in the format of "X|Y" (e.g., "-.0034|.4402")
  • rt: the time at which the coordinates are recorded, in miliseconds, relative to the onset of the trial