mouseAdjuster

 element objects

An adjuster and response handler element that lets the subject adjust properties of other elements by clicking and dragging the mouse cursor on screen like a slider. Or you can use property move to adjust the position of another element by clicking and dragging the element. One mouse button adjusts, and clicking any other mouse button records a response (done adjusting). Or optionally the subject can click a "Done" button on screen to respond done. Response value generated is the adjusted property value.

▸ Object ends automatically?

By default yes, when it records one "done adjusting" response. You can change number of responses to wait for in property maxNumResponses. If you set maxNumResponses = <cd>inf<cd>, it records responses indefinitely until a condition you set in property end.

If an element will end automatically, you don't need to set an end time or condition in property end. However, you can if you want to add other end conditions that could occur earlier.

No—you must set an end time or condition in property end.

Input properties
Record properties
mouseAdjuster
elements (see below)

drag_x
drag_y
drag_xy
deltaRate
deltaIncrement
clickAreaSize
move
showButton
buttonText
buttonFontSize
buttonTextColor
buttonColor
buttonPosition
n_dragButton

All visual elements
position

All adjuster elements have
adjust

All response handler elements
translateResponse
scoreResponse
correctResponse
scoreResponseForStaircase

maxNumResponses
recordDefaultResponse
registerTrigger
autoResponse
autoResponseLatency

All elements
start
end

startBuffer
endBuffer

syncExperiment
preload
vary
staircase

All objects
info
report

drag_x
drag_y
drag_xy

No defaults

Properties = <cd>true<cd>/<cd>false<cd> setting adjustment mode. Set ONE of these = <cd>true<cd>:

drag_x = <cd>true<cd>: Subject adjusts by dragging the mouse cursor horizontally. Adjustment value is a number per distance dragged—see deltaRate below.

drag_y = <cd>true<cd>: Same but vertically.

drag_xy = <cd>true<cd>: Subject adjusts by dragging the mouse cursor in both dimensions. Adjustment value is a 1×2 vector per distance dragged (so typically the target you set in adjust.target must be a 1×2 vector).

deltaRate

No default

A number that is adjustment to apply per distance dragged on screen. By default distance on screen is in deg, as usual. Magnitude of adjustment is magnitude of deltaRate × distance dragged. Positive deltaRate = positive adjustment when dragging right/up, negative adjustment when dragging left/down. And negative deltaRate means the opposite. (Note since this is for the subject, it follows the general convention up = +, not standard screen coordinate convention down = +.)

e.g.
drag_x
= <cd>true<cd>
deltaRate = +0.5
→ +0.5/deg dragging right, −0.5/deg dragging left

If drag_xy = <cd>true<cd> then deltaRate can also be a 1×2 vector for different rates for [x y].

Use adjust to set where and how adjustments are applied.

deltaIncrement

Default: apply adjustments of any magnitude

By default drag applies adjustments of any magnitude. However, some element properties can only receive adjustments that are multiples of some increment. e.g. a property that must be an integer can only receive adjustments that are integers (multiples of 1). If so, you can set increment here (a number > 0). The adjuster will apply adjustments in multiples of that. If drag_xy = <cd>true<cd> then deltaIncrement can also be a 1×2 vector for different increments for [x y]. 0 = apply adjustments of any magnitude.

clickAreaSize

Default: click anywhere to drag

Size of the area on screen that the subject can click in to start a drag. This is a number that is side length for a square, or a vector [width height] for a rectangle (deg). Or the number <cd>inf<cd> = click anywhere. Click area is centered at element position, which you can set in property position (default window center).

move

Default: <cd>false<cd>

<cd>true<cd>/<cd>false<cd>: special mode to adjust target element position on screen by clicking & dragging the element. If = <cd>true<cd>:
  • adjust.target must point to property position (e.g. <cds>"<element>.position"<cds>, or <cds>"<element>.position{1}"<cds> if you use a distance unit other than deg), or at least part of position.
  • drag_x/drag_y/drag_xy above apply as usual. drag_x and drag_y send adjustments that are single numbers, so if using one of them, typically set target to the corresponding position dimension (e.g. drag_y = <cd>true<cd> → target = <cds>"<element>.position(2)"<cds>). drag_xy sends adjustments that are 1×2 vectors, so if using it, typically set target to the whole position, i.e. move in both dimensions.
  • deltaRate, deltaIncrement, clickAreaSize above are ignored.

showButton
buttonText
buttonFontSize
buttonTextColor
buttonColor
buttonPosition

Default: showButton = no
Default:
buttonText = <cds>"Done"<cds>
Default: buttonFontSize = 0.5 deg
Default: buttonTextColor = white
Default: buttonColor = blue RGB [32 88 161]/255
Default: buttonPosition = <cd>[0 −4]<cd> → 4 deg above origin, centered
Default: buttonPositionOrigin = <cds>"b"<cds> → bottom center of experiment window

showButton = <cd>true<cd>/<cd>false<cd>: show a "Done" button which the subject clicks on to record response (done adjusting). If = <cd>false<cd> one mouse button adjusts and clicking any other mouse button records done (see n_dragButton below). If = <cd>true<cd> all mouse buttons can adjust and/or click the done button, and you can use further properties below to customize the button. Note the Done button automatically shows in front of all other elements.

buttonText is a string that is text for the button.

buttonFontSize is button text font height (deg). Specifically it sets height of the "em box" for the font. Typically upper case characters are a little smaller than this. If you need more information, see Wikipedia https://en.wikipedia.org/wiki/Point_(typography) for a starting point.

buttonTextColor is a 1×3 RGB or 1×4 RGBA vector with numbers between 0–1.

buttonColor is same but for color of the button itself.

buttonPosition is a 1×2 vector [x y] (deg), + = right/down, that is center of the button relative to an origin which you can specify in buttonPositionOrigin (default origin = bottom center of experiment window).

buttonPositionOrigin is a string:

<cds>"tl"<cds> – top left of experiment window
<cds>"t "<cds> – top center
<cds>"tr"<cds> – top right
<cds>"l "<cds> – center left
<cds>"c "<cds> – center
<cds>"r "<cds> – center right
<cds>"bl"<cds> – bottom left
<cds>"b "<cds> – bottom center
<cds>"br "<cds> – bottom right

n_dragButton

Default: mouse button 1 drags, all other buttons record response

If showButton above = <cd>false<cd>, this is a number or vector that is mouse button number(s) to click to adjust. For all other buttons a click means record response (done adjusting). If showButton = <cd>true<cd> then all mouse buttons work the same.

Adjustable properties

You can vary or allow the subject to adjust the following properties of an object of this type when it's running. If you need to make other properties adjustable, you can edit the element type code—see Element Type Programming Manual.

Adjustable properties

Adjustable properties

position
nn_eyes
rotation
colorMask
alpha
intensity
contrastMult
drawCodeVars

(None)

(None)

Input properties
Record properties

PsychBench uses record properties to record information during experiments. You can't set record properties but you can see them in experiment results using input property report.

mouseAdjuster
elements (see below)

All response handler elements
response
responseScore
responseTime
responseLatency
d_responseTime
numResponses

All elements
startTime
endTime
duration
n_startFrame
n_endFrame
startLatencyBufferable
endLatencyBufferable

trigger
triggerTime
d_triggerTime
numTriggers

syncTime