As a frequent user of various IT applications you are no doubt familiar with shortcut keys. And while these are common among stand alone applications they are rarely useful or necessary on individual websites. This however, may not apply for your web applications, such as intranets, and other client orientated programs.
The key to this code is the object event, which can be called upon whenever an event takes place inside an HTML document. Events are caused through user interaction with the interface, such as mouse movements, clicks, or in this case even through the keyboard.
If the CTRL key is indeed pressed, true will be returned from this object extension. If not we will receive false, or 0, meaning the CTRL signal could not be detected. Here is an example to help further illustrate this:
var status = document.getElementById("status");
status.innerHTML = "The CTRL key was pressed!";
status.innerHTML = "The CTRL key was NOT pressed!";