# code won't stay hidden

**URL:** <https://talk.code3dgames.com/t/code-wont-stay-hidden/71>\
**Category:** Uncategorized\
**Created:** [September 12, 2018, 1:25am UTC](https://talk.code3dgames.com/t/code-wont-stay-hidden/71 "2018-09-12T01:25:43Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![aquantumofgravitas](https://talk.code3dgames.com/letter_avatar_proxy/v4/letter/a/278dde/32.png) [@aquantumofgravitas](https://talk.code3dgames.com/u/aquantumofgravitas)\
**Post date:** [September 12, 2018, 1:25am UTC](https://talk.code3dgames.com/t/code-wont-stay-hidden/71/1 "2018-09-12T01:25:43Z")

</div>

I’m trying to move the avatar and so I hide my code, but it reappears as soon as I press any key.

---

<div class="post-metadata">

**Author:** ![chris](https://talk.code3dgames.com/user_avatar/talk.code3dgames.com/chris/32/5_2.png) [@chris](https://talk.code3dgames.com/u/chris)\
**Post date:** [September 12, 2018, 2:58am UTC](https://talk.code3dgames.com/t/code-wont-stay-hidden/71/2 "2018-09-12T02:58:47Z")

</div>

That’s super weird 😕

I can _kinda_ get this to happen if:

- I hit the `Tab` key, which highlights the “Show Code” button
- Then press the `Enter` key

But if I press any other key, then nothing happens.

Are you using the Google Chrome browser on Mac, Windows or Chromebook? Can you [share your code](https://talk.code3dgames.com/t/welcome-to-3d-game-programming-for-kids-read-this-first/8)? I can’t think of anyway that the code could be breaking 3DE like this, but maybe there’s something weird going on?

-Chris

---

<div class="post-metadata">

**Author:** ![aquantumofgravitas](https://talk.code3dgames.com/letter_avatar_proxy/v4/letter/a/278dde/32.png) [@aquantumofgravitas](https://talk.code3dgames.com/u/aquantumofgravitas)\
**Post date:** [September 12, 2018, 5:41pm UTC](https://talk.code3dgames.com/t/code-wont-stay-hidden/71/3 "2018-09-12T17:41:12Z")

</div>

I’m using Chrome Version 68.0.3440.106 (Official Build) (64-bit) on Windows 7 64-bit.

Here’s [a link](https://www.code3dgames.com/3de/#B/lVZRc+I2EH7nV+j8cqZnDFxL0wnJzVAgy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2WXoahSnbSzE490YfXzppt33qTcekCXUGjKm8eLo9bUD8/ScelY3tgAx1mNbg3S6VefBuc6fTjg/HTvvTzjvTzKPz3XOmGEZguIewG43y1Jenfsfp17aFR8Ob0c6hoit7K4PZQtm/pA+PJMncAHoaffZ29vcwbmeLI7bhKnFd44yaBLmxGjVvQoU3f+kigf2AHsJ8IJwCZdHuLAl1HmtGxd7+9Ni9b8CKq0OmtTPEM+EhH04x+tPiZ0g9yFpeHy3LzrZCC6M6WmAqRdtpYb57DWg7+4zwOFuYKBm89UKKw8XONNcC6bGCdtFB4+E9CZYhBbt+JjyGomtR1Qktm9d/yqXv9Pdgth2Ye///wE=) to my code.

---

<div class="post-metadata">

**Author:** ![chris](https://talk.code3dgames.com/user_avatar/talk.code3dgames.com/chris/32/5_2.png) [@chris](https://talk.code3dgames.com/u/chris)\
**Post date:** [September 12, 2018, 6:12pm UTC](https://talk.code3dgames.com/t/code-wont-stay-hidden/71/4 "2018-09-12T18:12:03Z")

</div>

Curiouser and curiouser. Your code looks great. I don’t see anything in there which might trigger the code to re-show. It works great for me with the WASD keys.

One thing you can try is adding the following line at the bottom of the `sendKeyDown()` function: `event.stopImmediatePropagation()` so that the function looks like:

```javascript
function sendKeyDown(event){
  var code = event.code;
  // WASD movement
  if(code=="KeyA")marker.position.x = marker.position.x - 5;
  if(code=="KeyD")marker.position.x = marker.position.x + 5;
  if(code=="KeyW")marker.position.z = marker.position.z - 5;
  if(code=="KeyS")marker.position.z = marker.position.z + 5;
  // cartwheeling and flipping
  if(code=="KeyQ")isFlipping = !isFlipping;
  if(code=="KeyE")isCartwheeling = !isCartwheeling;
  event.stopImmediatePropagation();
}

```

That really shouldn’t help, but 🤷‍♂️

Another possibility is that you have a Chrome extension installed that might be interacting strangely with 3DE. To test that out, you could choose `New incognito window` from the Chrome menu, then go to [code3dgames.com/3de](http://code3dgames.com/3de), and paste your code into the editor. If the keys work correctly there, then you likely have a Chrome extension installed that’s not playing nicely (`event.stopImmediatePropagation()` could also help with that).

I’ll have access to a Windows Surface tomorrow so I can try to reproduce then.

-Chris

---

<div class="post-metadata">

**Author:** ![aquantumofgravitas](https://talk.code3dgames.com/letter_avatar_proxy/v4/letter/a/278dde/32.png) [@aquantumofgravitas](https://talk.code3dgames.com/u/aquantumofgravitas)\
**Post date:** [September 13, 2018, 3:42pm UTC](https://talk.code3dgames.com/t/code-wont-stay-hidden/71/5 "2018-09-13T15:42:40Z")

</div>

“event.stopImmediatePropagation()” didn’t change anything but my code works fine in incognito mode, so it’s probably an extension like you said.  
It’s weird this isn’t a problem with the [ICE site you used for the 1st edition](https://is.gd/HdEuhG).

---

<div class="post-metadata">

**Author:** ![chris](https://talk.code3dgames.com/user_avatar/talk.code3dgames.com/chris/32/5_2.png) [@chris](https://talk.code3dgames.com/u/chris)\
**Post date:** [September 14, 2018, 12:53am UTC](https://talk.code3dgames.com/t/code-wont-stay-hidden/71/6 "2018-09-14T00:53:10Z")

</div>

That really is strange. Not much has changed in the editor between the first and second editions. If it’s not too much trouble and you don’t mind, can you share the list of extensions that you have installed?

To list your active extensions, put this in the URL bar for Chrome: `chrome://system` and then click the `Expand...` button to the right of the “extensions” row. You can either paste the list here in the forum or send it to me at [chris@code3dgames.com](mailto:chris@code3dgames.com).

-Chris

---

<div class="post-metadata">

**Author:** ![chris](https://talk.code3dgames.com/user_avatar/talk.code3dgames.com/chris/32/5_2.png) [@chris](https://talk.code3dgames.com/u/chris)\
**Post date:** [October 9, 2018, 3:48pm UTC](https://talk.code3dgames.com/t/code-wont-stay-hidden/71/7 "2018-10-09T15:48:20Z")

</div>

For any others experiencing similar problems, we tracked this issue down to the Typio Form Recovery Chrome extension. Removing that or disabling it for [www.code3dgames.com](http://www.code3dgames.com) will fix the reported problem. We’ve added an issue tracker to investigate this further.

-Chris
