Capturing Ctrl-Alt-Del in JavaScript / jQuery

While I was playing with jQuery / JavaScript, I ran into this problem. I could write down the keys Altand Ctrl, but NOT Deland, of course, not all of them together.

$(document).ready(function() {
    $("#target").keydown(function(event) {
        if (event.ctrlKey && event.altKey && event.keyCode == '46') {
            alter("Ctrl-Alt-Del combination");
        }
    });
});

Is it possible to capture all these three keys together?

+3
source share
4 answers

I'm not sure on other operating systems, but I know that the Windows Ctrl+ Alt+ Del- is a system keystroke that is intercepted at the top level, always Windows. As far as I know, it does not go further from there, allowing you to KNOW that everything that comes out of it is official.

, Gnome ( KDE), , , , .

, Mac , , - .

EDIT: -, , alter not alert . , .

+10

, .

, , -, Windows . , , Windows. Ctrl + Alt + Del - . Windows .

+2

After searching, I found this, http://www.quirksmode.org/js/keys.html Basically, this means that different browsers and different OSs will get different behavior for the del key. If Windows is Alt+ Ctrl+ Del, Windows Task Manager shows before finding that loses focus, C ++ A + D is not found.

+1
source

Source: https://habr.com/ru/post/1744876/


All Articles