# Issue with code component during online pilot

**URL:** <https://discourse.psychopy.org/t/issue-with-code-component-during-online-pilot/14314>\
**Category:** Online experiments\
**Created:** [June 16, 2020, 5:35pm UTC](https://discourse.psychopy.org/t/issue-with-code-component-during-online-pilot/14314 "2020-06-16T17:35:56Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![wakecarter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/wakecarter/32/5753_2.png) [@wakecarter](https://discourse.psychopy.org/u/wakecarter)\
**Post date:** [June 16, 2020, 7:31pm UTC](https://discourse.psychopy.org/t/issue-with-code-component-during-online-pilot/14314/7 "2020-06-16T19:31:56Z")

</div>

The crib sheet already contains a recommendation of **event=psychoJS.eventManager;** in **code\_JS** to avoid manual editing on each occurance. This definitely works for **event.getKeys()** and **event.clearEvents()**

This is apparently a solution for JS but I don’t know how to back translate it to working Python, which is why it isn’t in the crib sheet

> [@Code component to count mouse clicks](https://discourse.psychopy.org/t/code-component-to-count-mouse-clicks/11621/16):
>
> OK. So. I decided to actually have a look at this and have learned some things. The corsi demo no longer works because the mouse never receives the status “STARTED” (@jon, unintended behavior? see [https://github.com/psychopy/psychopy/issues/2844](https://github.com/psychopy/psychopy/issues/2844)). There is a way to make your task work. It requires much more code than it probably should, but I have tested this and know it works. Notably, this is direct JS code, we are not going to be going through python. Here’s how to do it. First, in “begin …

---

_[View the full topic](https://discourse.psychopy.org/t/issue-with-code-component-during-online-pilot/14314)._
