Block right mouse

Ok so you were looking for a way to disable the right mouse button, lock down a pc, protect your website from people trying to steal your pictures or code? You have come to the right place!

There are several reasons why you should want to block the right mouse ability:

  • Flexible 'on demand' when you're kid is on the computer and you don't want them messing up your pc or get distracted when he / she accidentally clicks the right mouse button or one of the keyboard keys --> download BasicMouse
  • Protect / Kiosk your pc or client because it's in a public place --> download BasicMouse
  • It helps people with Parkinson's disease to prevent accidental / unintentional right mouse clicks
  • If you want to disable it semi-permanent use a registry hack:
  1. Click Start - Run (or Windows key + R), type Regedit and click OK
  2. Create a back-up of your registry first (file - export)
  3. Navigate to: [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer]
  4. Find / select the value NoViewContextMenu
  5. If there is none, right click and choose 'New DWORD'
  6. NoViewContextMenu for name and 1 for value (reset to 0 if you want to re-enable right click)
  • If you want to protect your web pages, copy and paste this code:
<script language=JavaScript>

//Disable the right mouse clicks script

var nmessage="Not permitted!";

function clickIE4(){
if (event.button==2){
return false;

function clickNS4(e){
if (document.layers||document.getElementById&&!document.all){
if (e.which==2||e.which==3){
return false;

if (document.layers){
else if (document.all&&!document.getElementById){

document.oncontextmenu=new Function("alert(nmessage);return false")

// -->

Make sure you paste it after the <HEAD> tag in your page, for instance:

after your <HEAD> tag e.g.

<HEAD>.... Paste code ...</HEAD>