# Forced click Response before proceed

**URL:** <https://discourse.psychopy.org/t/forced-click-response-before-proceed/28231>\
**Category:** Builder\
**Created:** [March 27, 2022, 7:39am UTC](https://discourse.psychopy.org/t/forced-click-response-before-proceed/28231 "2022-03-27T07:39:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![joeybaby](https://avatars.discourse-cdn.com/v4/letter/j/73ab20/32.png) [@joeybaby](https://discourse.psychopy.org/u/joeybaby)\
**Post date:** [March 27, 2022, 7:39am UTC](https://discourse.psychopy.org/t/forced-click-response-before-proceed/28231/1 "2022-03-27T07:39:37Z")

</div>

**OS** (e.g. Win10): MacOS 10.14.6  
**PsychoPy version** (e.g. 1.84.x): v.2022.1.1  
**What are you trying to achieve?:**

For my experiment, participants will see three choices and I want them to choose one before they can click “exit” to proceed. They can change their choice before they click on “exit”.

**What did you try to make it work?:**

I read several post and now my design is as follows:

 ![design](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/5/f/5f807ef9ec22a2f5ae788c9e7b6a5f18aeb1bbb7.png)

The mouse component:

 ![mouse](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/e/7/e71a906e8b9858b72d629f585afdef81666ea57c.png)

The codes I have:

 ![codes](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/e/f/ef991d3e763751492a44e2092073bbba28bbc413.png)

**What specifically went wrong when you tried that?:**  
The click did not work when I clicked “exit” to end the routine. I think the problem may be in the mouse component, in which I set “End routine on press = never” . But later I tried to set up two mouse, one for choices and the other for “exit” (End routine on press = valid click), but this time I end the routine once I clicked on the choices.

Is there any problem with these codes? Do you have an idea on how to solve this problem? Thank you in advance!

---

<div class="post-metadata">

**Author:** ![joeybaby](https://avatars.discourse-cdn.com/v4/letter/j/73ab20/32.png) [@joeybaby](https://discourse.psychopy.org/u/joeybaby)\
**Post date:** [March 28, 2022, 7:33am UTC](https://discourse.psychopy.org/t/forced-click-response-before-proceed/28231/2 "2022-03-28T07:33:01Z")

</div>

I solved this problem with a different design!

In general, I have a code component, a mouse component, 2 button components (“exit” and “fake”) and three polygons for choices. The mouse properties are the same as the screenshoot above.

In the code component, I wrote “start = False” at the begin routine, and “if mouse.isPressedIn(choice\_1), start = True”…in each frame. Then I set the start condition of “exit” button to be “$start==True”. And it works well!

---

<div class="post-metadata">

**Author:** ![Michael](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/michael/32/16_2.png) [@Michael](https://discourse.psychopy.org/u/Michael)\
**Post date:** [March 28, 2022, 7:45am UTC](https://discourse.psychopy.org/t/forced-click-response-before-proceed/28231/3 "2022-03-28T07:45:37Z")

</div>

A simple mistake that would have been stopping your original code from having any effect was the misspelling of the variable name `continueRoutine`.
