mouseSlider

 element objects

A response handler element that shows a slider that the subject can click and drag with the mouse to select a value within the slider's range—for example, to implement a Likert scale. One mouse button drags and the other(s) register a response. Response value generated is value the slider is at in the range (a number). You can use any range, discrete or continuous (properties range and increment). You can also optionally show a title and/or live readout. For a readout you can use custom labels for the possible slider values.

▸ Object ends on its own?

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

("Ends on its own" means ends automatically at that point. If an element can end on its own, you don't need to set end conditions for it in property end, unless you want it to maybe end earlier.)

No—runs until a condition you set in property end.

Input properties
Record properties
mouseSlider
elements (see below)

range
increment
val1
lineLength
lineWidth
lineColor
sliderShape
sliderSize
sliderColor
title
titlePosition
titleSize
titleColor
labels
roundReadoutTo
readoutPosition
readoutSize
readoutColor
fontName
n_dragButton
cursorShape

All visual elements
position

All adjuster elements have
adjust

All elements
start
end

startBuffer
endBuffer

vary
staircase

All objects
info
report

range
increment

Defaults: 1–7 in steps of 1

These properties set the range of numbers the slider passes through. range is a 1×2 vector [a b] setting minimum value a and maximum value b. increment is step size between a and b for values in between (typically 1). Note slider values don't have to be positive or integer. You can also set increment = 0 for a continuous slider.

You can assign text labels to slider positions but that is separate—see labels below. At its base the slider always passes through numeric values.

val1

Default: middle of range

You can change initial value for the slider here. This is a number in the range which you can set in range/increment above.

lineLength
lineWidth
lineColor

Default: lineLength = 10 deg
Default: lineWidth = 0.1 deg
Default: lineColor = 60% white

You can customize the appearance of the slider line with these properties. Length and width are numbers in deg. Color is a 1×3 RGB or 1×4 RGBA vector with numbers between 0–1. The slider line is always centered at element position, which you can set in property position (default window center).

sliderShape
sliderSize
sliderColor

Default: sliderShape = circle
Default: sliderSize = 0.8 deg
Default: sliderColor = 100% white

You can customize the appearance of the slider button with these properties. Shape is a string <cds>"circle"<cds> or <cds>"square"<cds>. Size is circle diameter or square side length in deg. Color is a 1×3 RGB or 1×4 RGBA vector with numbers between 0–1.

title
titlePosition
titleSize
titleColor

Default: title = none
Default:
titlePosition = <cd>[0 -2]<cd>
Default: titleSize = 0 (no title)
Default: titleColor = 100% white

You can set titleSize > 0 to show a title for the slider, which can be useful especially if you are running multiple sliders at the same time:

title is a string that is title to show.

titlePosition is position of left bottom of the title text: a 1×2 vector [x y] (deg), + = right/down, relative to left point of the slider line. The slider line in turn is centered at element position, which you can set in property position (default window center).

titleSize is 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. 0 = no title. A typical value to set to is 0.8.

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

labels
roundReadoutTo
readoutPosition
readoutSize
readoutColor

Default: labels = no custom labels—show actual slider value
Default: roundReadoutTo = if increment = 0 (continuous slider) round to 1 decimal place, else round to integer
Default:
readoutPosition = <cd>[0 2]<cd>
Default: readoutSize = 0 (no readout)
Default: readoutColor = 100% white

You can set readoutSize > 0 to show a live readout as the subject moves the slider:

labels sets custom text to show for the various slider values. This can be a vector of numbers for custom numbers. It can also be an array of strings for custom text values. Either way length of the array corresponds to number of slider values set by range/increment above. labels is optional—if you don't set it, the readout shows the actual slider value (a number). For a continuous slider (increment = 0) a readout always shows the actual slider value and labels is ignored.

roundReadoutTo is number of decimal places to round numbers in the readout to. Ignored for text labels.

readoutPosition is position of left bottom of the readout text: a 1×2 vector [x y] (deg), + = right/down, relative to left point of the slider line. The slider line in turn is centered at element position, which you can set in property position (default window center).

readoutSize is 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. 0 = no readout. A typical value to set to is 0.8.

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

fontName

Default: Arial

A string setting font for the title and readout (if any). See Psychtoolbox Screen('TextFont') for more information on font names.

n_dragButton

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

A number or vector that is mouse button number(s) to click to drag the slider. For all other buttons a click means record response = current slider position.

cursorShape

Default: hand

A string or number setting mouse cursor shape. This goes to the type input of Psychtoolbox ShowCursor—see there for more information. Standard options are:

<cds>"Arrow"<cds>
<cds>"CrossHair"<cds>
<cds>"Hand"<cds>
<cds>"SandClock"<cds>
<cds>"TextCursor"<cds>

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.

mouseSlider
elements (see below)

All elements
startTime
endTime
duration
n_startFrame
n_endFrame
startLatencyBufferable
endLatencyBufferable