Custom event in javascript
<p>I know that there is a lot of questions like mine, but I don't think it's a duplicate.</p>

<p>I want to create my own custom event, for exemple onresize or onshake.</p>

<p>And I would like to make a library, then the user of my library would just write that :</p>

<pre><code>&lt;script src="theLib.js" &gt;&lt;/script&gt;
&lt;script&gt;
window.addEventListener("shake",myFunc,false);
&lt;/script&gt;
</code></pre>

<p>I saw a lot of tutoriels and questions on stackoverflow but either they are using jQuery(I want the most simple exemple to make a custom event) or the user must not just write <code>window.addEventListener</code>.</p>

<p>Can you please explain me the most basic way to add a custom event?</p>
