[Resolved] Disable ctrl+shift+i

Home Forums Support [Resolved] Disable ctrl+shift+i

Home Forums Support Disable ctrl+shift+i

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #2161791
    melvin wang

    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

    #2161875
    David
    Staff
    Customer Support

    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:

    https://stackoverflow.com/a/24764878

    #2164183
    melvin wang

    Hi David,

    It works like a charm. Thank you David.

    #2164547
    David
    Staff
    Customer Support
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.