
Collecting Clicks, Button Presses and Touch Responses
To collect a response in Labvanced, add an event with a trigger for what the participant does, such as clicking a button, tapping an image or pressing a key. The event's actions then record the response or move the study forward.
Which method to use
| You want participants to... | Use this trigger |
|---|---|
| Choose between labeled on-screen buttons | Button-Click Trigger |
| Click or tap an image, text or other object | Mouse Trigger |
Press a key, such as D or J | Keyboard Trigger |
Set it up
For each method, open the Events panel in the task editor, click Frame Event (this frame only) and pick the trigger under User Input.
Button responses
- Open the
Buttons & Navigationgroup in the toolbar and add aButtonobject to your frame. To offer more than one choice in the same object, clickAdd Buttonin its properties. - Create an event with the
Button-Click Trigger. - Click
Set Targetand select the button object. - In the
Button:dropdown, choose which button fires the event.
Clicks and taps on objects
- Create an event with the
Mouse Trigger. - Set
Action:toClickandButton:toLeft. - Under
Targets:, clickAdd Targetand choose the objects participants can select. To accept a click on any object, checkAny element.instead.
Key presses
- Create an event with the
Keyboard Trigger. - Set
Action:toPress Key. - Next to
Keys:, clickAddand select each key participants can use.
Record the response
When you continue to the actions step of an event that has no actions yet, a setup dialog opens for these triggers. Check the options you need and click Auto Create Events:
Record reaction time: saves the reaction time, measured from frame onset, in a variable.Record click target(Mouse Trigger): saves the name of the selected object.Record pressed key(Keyboard Trigger): saves which key was pressed.Jump to next frame: moves the participant on after the response. To send participants elsewhere based on their response, see branching and skip logic.
The Button-Click Trigger dialog has no click target option. To save which choice was made, add a Set / Record Variable Action.
If you skip the dialog, set up recording yourself, as in this reaction time example. To view and export results, see the Dataview and Export Tab.
Good to know
- Reaction time starts at frame onset. The recorded response time is counted from when the frame starts, even if your stimulus appears later. In that case, record the stimulus onset time with the Set Object Property Action, then calculate: response time minus stimulus onset time. For example, if the stimulus appears at 500 ms and the participant responds at 1,200 ms, the reaction time to the stimulus is 700 ms.
- Plan for phones and tablets. Participants on these devices usually have no physical keyboard, so give them on-screen buttons or objects to tap.
- Test on real devices. Before launch, take part in your study on each type of device you will allow, then check that each response appears once and as expected in your data.
Examples in published studies
These Labvanced studies collect responses in different ways, and one also uses mouse tracking. Each page describes the task and links to the study, so you can import it and inspect its events.
Stroop Test
Key presses: on desktop, participants name the ink color with four assigned keys.
Delay Discounting Task
Button clicks: participants choose between an immediate and a delayed reward.
Tower of London Test
Clicks and mouse tracking: on desktop, participants move balls between pegs by clicking, while the study records cursor movement.
2D Mental Rotation Task
Taps: in the mobile version, participants respond with on-screen buttons.