Disabling Right Click and F12 Key

Hi, i want to disable the right click and the F12 Key on my wix website, i tried with the “Right click protect” app but that app does not block the F12 Key so it’s useless…

I Don’t really know how to code with wix and i need help :frowning:
i tried with this code that i found on internet:

export function keyPress(event, $w) {
 if (event.key === 123) { 

but it seems to not work…

Can someone please help me?

Which error do you get?
Already tried to find out of which type the result is?

console.log(event . key)
console.log(typeof event . key)

You can also try this…
export function keyPress ( event , $w ){
console.log(typeof event.key)
if ( event . key == 123 ){
console . log ( “HELLO”)
else{console.log(“You did not press F-12”)}

Key-code → 123 should normaly be the right one.

Did you connected the code with the property-panel?

Edit: My suggestion will probably not help you.
On my opinion it is not possible to disable button for whole site.
You can disable buttons on a INPUT or a TEXT-FIELD, but not on the whole site.

Perhaps it is possible with a custom element.

Hi, thank you! i tried the code but it seems to not work, i don’t get any console logs, and i don’t get any errors…

However, what does “Did you connected the code with the property-panel” means?

Forget it, it will not work.

The —> keyPress ( event , $w ) —> only works on some specific elements like…

  1. https://www.wix.com/velo/reference/$w/textbox
  2. https://www.wix.com/velo/reference/$w/textinput
  3. https://www.wix.com/velo/reference/$w/richtextbox

But what you would need is to have this functionality for the whole website and wix/velo do not offer this possibility (yet), but perhaps will do it one day in the future, who knows.

As i already said, perhaps it can be done by using an HTML-Component, or a Custom-Element!

BTW: Here the property-Panel!
Here you can see a button called → BTNstart and its related properties in the property-panel on the right-bottom side of the pic.

@russian-dima Ooh okay! Thank you a lot!

Hi @dragonfx1234 , did you find a solution for this? i’m also looking into disabling the keyboard f12. Btw, you can also use Saledish Content Protection app for your wix website. pretty much safe from download but it’s still accessible via f12. developer tools could also be accessed via browser “:” but yeah, disabling f12 would pretty much enough help to create panic for the non-tech savvy users haha. anyway… was there a solution for this?