You need can do it with native javascript or use a library as jQuery

PHP Code:
$(document).mousedown(function(e){
          if( 
e.button == ) {
             return 
false;
           } else {
             return 
true;
            }

        });