# Response input from Matlab

**URL:** <https://discourse.psychopy.org/t/response-input-from-matlab/31406>\
**Category:** Builder\
**Created:** [October 17, 2022, 10:34pm UTC](https://discourse.psychopy.org/t/response-input-from-matlab/31406 "2022-10-17T22:34:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yu\_Zhi](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/yu_zhi/32/35781_2.png) [@Yu\_Zhi](https://discourse.psychopy.org/u/Yu_Zhi)\
**Post date:** [October 17, 2022, 10:34pm UTC](https://discourse.psychopy.org/t/response-input-from-matlab/31406/1 "2022-10-17T22:34:25Z")

</div>

Hi,

I am using keyboard responses in Psychopy. I use Matlab to simulate a keyboard press “enter” which sends signals to Psychopy as if I pressed “enter” on keyboard.  
Psychopy didn’t get the input from Matlab. Please advise what is wrong.

thanks.

---

<div class="post-metadata">

**Author:** ![Kimberley\_Dundas](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/kimberley_dundas/32/32322_2.png) [@Kimberley\_Dundas](https://discourse.psychopy.org/u/Kimberley_Dundas)\
**Post date:** [October 19, 2022, 9:11am UTC](https://discourse.psychopy.org/t/response-input-from-matlab/31406/2 "2022-10-19T09:11:24Z")

</div>

Hi @Yu_Zhi,

Could you please share more about how things are connected here? Without more detail it’s difficult to advise what is going on.

Thanks,

Kim

---

<div class="post-metadata">

**Author:** ![Yu\_Zhi](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/yu_zhi/32/35781_2.png) [@Yu\_Zhi](https://discourse.psychopy.org/u/Yu_Zhi)\
**Post date:** [October 19, 2022, 4:36pm UTC](https://discourse.psychopy.org/t/response-input-from-matlab/31406/3 "2022-10-19T16:36:55Z")

</div>

Hi Kimberley,

Thanks for response. Psychopy has mouse click and keypress response so we would like to make use of it to start a new trial in behavior task. I am using Matlab to simulate both mouse click and keypress to trigger the next trial on Psychopy.

currently, I used a new window instead of fullscreen on Psychopy and let Psychopy receive mouse click and keypress simulated from Matlab. As I need multiple trials to be triggered, I used loop in Matlab, but only the first loop could trigger Psychopy to move to a new trial but not the remaining loops.  
could you please suggest if there is another solution? thanks. Please let me know if you need more info.

Best,  
Yu Zhi
