Juned Ansari
Juned Ansari

Reputation: 5283

want to disable whole keyboard using javascript start key not disabled not even ctrl+d

i have tried to disable whole keyboard using javascript but windows start key is not disabled same way enter key is also not disabled using my script

<script type='text/javascript'>
  document.onkeydown = function (e) {
    e.preventDefault();
  }
</script>

Upvotes: 1

Views: 854

Answers (2)

Shubham Agrawal
Shubham Agrawal

Reputation: 308

I think you cannot prevent windows key action because after pressing the window key browser doesn't detect it. The reason is that windows key doesn't affect the browser.

Upvotes: 4

Mike Meijer
Mike Meijer

Reputation: 9

Try this:

document.onkeydown = function (e) {
        return false;
}

Upvotes: 0

Related Questions