Archived topic
Disable ctrl+shift+i
3 replies · Started by melvin on March 21, 2022
Hi,
It's been awhile i didnt find Generatepress Support and i do miss the support team.
This is not plugin related but i still wish to drop you a question to see how to achieve that, given i tried Google few days still cant get it.
Sample website: https://abeco.io/
What i've tried is to hook the below code to wp-footer and admin footer
<script>
document.addEventListener('contextmenu', event => event.preventDefault());
</script>
What i wish to achieve :
1. disable ctrl+shift+i (frontend, backend, booknetic backend panel )
2. disable copy and paste
Can you point me to the right direction to achieve that?
Very much appreciated
Hi there,
not really sure on this, its not something i confess to ever using or feel the need to.
But you could try this:
document.addEventListener("keydown", function (event) {
if (event.ctrlKey) {
event.preventDefault();
}
});
Which should prevent the ctrl keys default event.
If you wanted to disable very specific key presses then maybe this stackoverflow will provide some pointers:
Hi David,
It works like a charm. Thank you David.
Glad to hear that