Right now, I've got it so that you can press the left arrow key to perform an event (event 1). If you press the right arrow key after that event, it will perform another event (event 2). 

How can I restrict it so that if the left arrow key is pressed twice, it won't repeat event 1?

Right now, I've got:

```
        $(document).keydown(function(f){
         if (f.keyCode == 39) { 
           // do event 1 here with the left arrow key
          }

      $(this).keydown(function(f){
         if (f.keyCode == 39) { 
        // do event 2 with the right arrow key
       window.location.href = "index.php";
        }

       });

```

Do I need to set a variable set to false and then true after event 1 has completed?