(JQuery) Moving an element with key presses?
<pre><code>$("html").keydown(function(event){

        if(event.which == "37")
            $("#hero").animate({"left" : "-=30px"});

        if(event.which == "39")
            $("#hero").animate({"left" : "+=30px"});

        if(event.which == "38")
            $("#hero").animate({"top" : "-=30px"});

        if(event.which == "40")
            $("#hero").animate({"top" : "+=30px"});
});
</code></pre>

<p>There seems to be a queue of all the keys that has been pressed,
and I need this queue to be empty when the direction is changed.
Because if I keep the left key pressed for a few seconds and then press right, 
the "#hero" will go left for a long time and then go right.</p>
