Disable Shortcuts for Web Browsers

By . Category: javascript, Web Tags: ,

irnanto.comShortcut key is widely used to facilitate activity in the use of computers. Shortcut Key function is one or more combinations of the keyboard to bring up or activate certain features on the device or the software used.

Shortcuts are also frequently used in operating the web browser and word processing applications. The use of a web browser shortcut to the application there that can give rise to negative actions as acts of plagiarism in web content. This course will be very detrimental to the web content writer, because he wrote the content or publish using all his strength can be easily taken (copy and paste) without prior approval. Therefore, to prevent acts of plagiarism in web content, or more commonly known as copy and paste (copy and paste) then we must create a system that can prevent acts of plagiarism.

For owners of the website or blog that will secure the content of the public from acts of plagiarism then there are some things that should be used to secure your blog content including disable text selection, disable right-click, and securing techniques other content. This time we will try to secure Web content of the web particularly negative actions such as abuse of shortcuts in a web browser. We can not disable certain keyboard keys on a web browser client directly, but we can adjust the website or blog in order to disable shortcuts in the browser that is displaying website or blog.

illustrations disable shortcut

illustrations disable shortcut

There are some shortcuts that could have a negative impact indirectly on the reputation of our web content. Handling shortcut-shortcut can be done by inserting the javascript code on our web pages. How to disable the shortcut keys using javascript source code can be seen below.

Disable Shortcut to Copy 

How to disable a shortcut to the copy (Ctrl + C) a web content can use javascript source code as below.

<script type=”text/javascript”>
    window.addEventListener(“keydown”,function(e){
        if(e.ctrlKey && (e.which==67)){
            e.preventDefault();
        }
    });
</script>

Disable Shortcut to Paste

How to disable a shortcut to the paste (Ctrl + V) or duplicate the copy can use javascript source code as below.

<script type=”text/javascript”>
    window.addEventListener(“keydown”,function(e){
        if(e.ctrlKey && (e.which==86)){
            e.preventDefault();
        }
    });
</script>

Disable Shortcut to Save

How to disable a shortcut to the storage process (Ctrl + S) web page can use JavaScript source code as below.

<script type=”text/javascript”>
    window.addEventListener(“keydown”,function(e){
        if(e.ctrlKey && (e.which==83)){
            e.preventDefault();
        }
    });
</script>

Disable Shortcut to Print

How to disable a shortcut to perform print setting process (Ctrl + P) or can print web pages using javascript source code as below.

<script type=”text/javascript”>
    window.addEventListener(“keydown”,function(e){
        if(e.ctrlKey && (e.which==80)){
            e.preventDefault();
        }
    });
</script>

Disable Shortcut to Select All

How to disable a shortcut to the selection process overall web content (Ctrl + A) can use javascript source code as below.

<script type=”text/javascript”>
    window.addEventListener(“keydown”,function(e){
        if(e.ctrlKey && (e.which==65)){
            e.preventDefault();
        }
    });
</script>

Disable Shortcut to Cut

How to disable a shortcut to the process of moving certain web content (Ctrl + X) can use javascript source code as below.

<script type=”text/javascript”>
    window.addEventListener(“keydown”,function(e){
        if(e.ctrlKey && (e.which==88)){
            e.preventDefault();
        }
    });
</script>

Disable Shortcut to Underline Text / View Page Source

How to disable a shortcut to the process of making the text becomes underlined (Ctrl + U) or underline text can use javascript source code as below.

<script type=”text/javascript”>
    window.addEventListener(“keydown”,function(e){
        if(e.ctrlKey && (e.which==85)){
            e.preventDefault();
        }
    });
</script>

Disable Shortcut to Italic Text

How to disable a shortcut to the process of making the text becomes skewed (Ctrl + I) or italic text javascript can use the source code as below.

<script type=”text/javascript”>
    window.addEventListener(“keydown”,function(e){
        if(e.ctrlKey && (e.which==73)){
            e.preventDefault();
        }
    });
</script>

Disable Shortcut to Bold Text

How to disable a shortcut to the process of making text bold (Ctrl + B) or bold text can use javascript source code as below.

<script type=”text/javascript”>
    window.addEventListener(“keydown”,function(e){
        if(e.ctrlKey && ( e.which==66)){
            e.preventDefault();
        }
    });
</script>

You can combine all the functions disable shortcuts such as source code to disable the shortcut below.

<script type=”text/javascript”>
    window.addEventListener(“keydown”,function(e){
        if(e.ctrlKey && (e.which==65 || e.which==66 || e.which==67 || e.which==73 || e.which==80 || e.which==83 || e.which==85 || e.which==86 || e.which==88)){
            e.preventDefault();
        }
    });
</script>

Very easy to apply the source code. Then we end the first to the article Disable Shortcuts to Web Browser. Another time connected again.

No comments yet untuk “Disable Shortcuts for Web Browsers”

Tinggalkan Komentar