Lock CTRL key in All Browsers

Asked

Viewed 3,804 times

1

I want to protect my content. Already "I Destroyed" the Right Click on my Site, But now I’d like to lock the CTRL key. Because it gives rise to copy and paste commands, and I don’t want to use this on my site. Is there any code to override the CTRL key? Thanks.

  • 5

    This kind of thing is not effective and only serves to disrupt the lives of its users.

  • 2

    I always laughed at sites that blocked the mouse click when I used Opera, it was just a matter of choosing an option not to allow the site to intercept the mouse click ready, was it working there, miss the dead Opera since now it is a copy of Chrome. But as for what you want to do, I would say don’t waste too much time on it, if you want to just do what’s simplest, because it will only stop users who have no idea what they’re doing, anyone with basic knowledge of how it works the browsers will be able to circumvent it.

  • What I want to do is to prevent conflicts. But I feel sorry for copying a copyright content. Copyright would "shred" you alive. I just don’t want any trouble, but whoever goes through those protections is intentionally, and will be deserving of a good punishment.

4 answers

11

Unable to protect your website text.

These measurements are completely artificial, they’re just an ugly trick with Javascript. Anyone with Javascript disabled can do whatever they want. There are many other ways to get the text even if it was possible to block the Ctrl, for example: download page via curl, view page source code, use browser Web Inspector.

By the way, prohibiting users from copying texts would be inelegant and goes against the open and democratic principle of the web. On the Internet, information should circulate freely.


Imagine a user wants to save a snippet for you, or simply search the definition of a word in an online dictionary. If you block the copy, it only harms this user, the layman, who does not plan malice. The experienced user, who wants steal the text of your site, would use the techniques I commented.

  • No, I don’t think so. Are Copyright, Copyright.

  • 6

    Copyright is a right that must be guaranteed by law, through the legal procedure of each country. It is not up to technology prevent that sort of thing. If you really think copyrights should be secured on the Internet, you should keep your precious intellectual property away from the Web: [http://www.go-gulf.com/blog/online-piracy/] (20% of the entire world band is used for piracy). The internet is not a suitable place for copyright, even if you consider it wrong :)

  • 1

    Young man, The Internet is not obligated to protect my content. But all sites that you usually click on Google have copyright. What I want is just to keep someone from taking my content, after all, I will share it, but it is mine. Poor guy who messes with copyright.

  • 3

    @Hugomarcelo How many 5 minutes do you think it will take before someone can circumvent it and publish somewhere else just to troll for exactly the reason that content is supposed to be protected?

  • 1

    @Hugomarcelo what he intends to do is surely 100% insane.... If some joker copies your so precious content, just you go to court with a lawsuit, now the idea of PREVENT, is impossible.... the maximum would be to HINDER......

  • 1

    http://ultimosegundo.ig.com.br/cultura/para+especialistas+internet+redefine+direito+autoral+e+dominio+publico/n1597128623872.html

  • @Hugomarcelo What you want is only to hinder, because to prevent you will not succeed. For me to get the content of your site in firefox for example, I would type in the URL view-source:http://www.seu-site.com.br and that’s it. I get the source code with the text/content I need. I don’t want to discourage you, but this will only prevent perhaps very lay users in the web issue. More experienced users have picked up their content in 5 minutes.

  • @Hugomarcelo What can you do MAYBE to hinder but it’s still minifying the code, leaving everything in one line.

Show 3 more comments

2

You can prevent them from "copying" your website using events oncopy and oncut:

<body oncopy="return false" oncut="return false">

Keep in mind that this will make it impossible to copy and paste elements as well input[type=text] and textarea.

However, in my opinion, it’s really boring when some site does this, and it’s easy to go over these restrictions.

  • 1

    Easy, But Illegal. The reason I do this is to prevent people from having plagiarism problems with me, I don’t like squabbles at all. But if necessary, and the person goes over the Copyright, this code will at least help to avoid. Got it? :)

1


Although it’s against this kind of technique, if you add this CSS rule into the element you want to block it should work

p.no-copy{
  -webkit-user-select: none;  /* Chrome Todos / Safari Todos */
  -moz-user-select: none;     /* Firefox Todos */
  -ms-user-select: none;      /* IE 10+ */
  -o-user-select: none;
  user-select: none;  
}
  • Yeah, already Sabina lock selection. I was trying to lock the CTRL key to prevent the commands CTRL+A CTRL+C. Thank you. You were one of the only ones who understood that I just want to prevent conflicts. I can’t censor my content because of that. Thanks again. :)

0

Can use oncopy="return false" or oncut="return false" but not all browsers support it. An alternative way that works at all would be:

window.onkeydown = function() {
   var key = event.keyCode || event.charCode || e.which;
   if(key==17){ alert('Proibida copia deste site.'); return false; }
}

The event is used window.onkeydown to detect the key that has been pressed, which receives the identifier methods keyCode, charCode in event and which. Both event return parameters but different in MSIE, Webkit and Genko. The alert does not allow the execution of the next key, and return cancels the execution.

  • Amigo, thank you very much!!! It worked perfectly on Chrome, internet explorer, and operates.... but in firefox it goes straight through, there is some hint?

Browser other questions tagged

You are not signed in. Login or sign up in order to post.