How to check if a user is holding a key down while he pushes another key?
<p>I have a function that directs a user to another page if the user pushes the right or left key on the keyboard. I need it to check if the user is holding down the CTRL key at the same time, while he pushes left or right, to redirect him. How can i do this?</p>

<p>My code:</p>

<pre><code>$(document).keydown(function (e) {
    var code = (e.keyCode ? e.keyCode : e.which);

    var currentPage = $("#CurrentPage").val();
    var numberOfPges = $("#NumberOfPages").val();

    if (code == 39) {

        if (currentPage &lt; numberOfPges) {
            // Næste side
            changePage(parseInt(currentPage) + 1);
            $(document).focus();
        }
        else {            
        // Send user to the next category 
        // $("#nextCategory")
        }

    }
    else if (code == 37) {
        // Tilbage
        if ((parseInt(currentPage) - 1) != 0) {
            changePage(parseInt(currentPage) - 1);
            $(document).focus();
        }
        else {
        // Send user to the previous category
        // $("#previousCategory")
        }

    }
});
</code></pre>

<p>Thanks!</p>
