title: Why does the event fire more than once?
body: <p>For the true boolean on eventListeners I read <a href="https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener" rel="nofollow noreferrer">here</a>:</p>
  
  <blockquote>
    <p>once: A Boolean indicating that the listener should be invoked at most once after being added. If true, the listener would be automatically removed when invoked.</p>
  </blockquote>
  
  <pre class="lang-js prettyprint-override"><code>window.addEventListener("keydown", function(event){
      switch(event.code){
          case 'Digit1': 
              shoot('Ball1');
              break;
  
          case 'Digit2':
              shoot('Ball2');
              break;
      }
  }, true);
  </code></pre>
  
  <p>In my code the function shoot is called endless. Why?</p>
  
  <p>And how can I fix it? The function shoot() may start only once.</p>
  
  <p>As recommended I changed 'true' into '{once: true}'. It still call shoot() endless. Do you have an idea, why?</p>
  
  <p>Thanks to @CertainPerformance. </p>
  
  <p>If you should have the same problem be aware, that the internet explorer doesn't know event.code.</p>