Wednesday, July 30, 2014

Disable KeyDown And Ctrl key

<script>
document.onkeydown = function() {
    alert();   
    switch (event.keyCode) {
        case 116 : //F5 button
            event.returnValue = false;
            event.keyCode = 0;
            return false;
        case 82 : //R button
            if (event.ctrlKey) {
                event.returnValue = false;
                event.keyCode = 0; 
                return false;
            }
    }
}
</script>

No comments:

Post a Comment