2

I am using the following plugin : Link

I believe this is the most used one from the JQuery community:

I am having problem trying to make ctrl+N work, see the code below:

    $(document).bind('keydown', 'ctrl+N', function () {
        alert("");
        return false;
    });

when I run it on chrome it opens a new window which is the common shortcut from the browser

RollRoll
  • 8,133
  • 20
  • 76
  • 135

1 Answers1

3

The keys Ctrl N, Ctrl T, Ctrl W and the shifted variants of these cannot be captured in Google Chrome.

Work is in progress to create an API allowing these keys to be captured without the issues associated with overriding browser-reserved shortcut keys. See http://code.google.com/p/chromium/issues/detail?id=119881 .

Plynx
  • 11,341
  • 3
  • 32
  • 33
  • ctrl+1(for choosing tabs) or ctrl+o for example works fine, those was also suppose to fail as well according to your answer, but it works fine – RollRoll Feb 08 '13 at 01:52
  • 1
    @ThePoet What do you mean? I listed the specific keys that can't be captured in Chrome. These specific keys (and these keys only) are specifically prevented from being overridden by Javascript in Chrome. If you don't believe me, see http://code.google.com/p/chromium/issues/detail?can=2&q=84332%20&colspec=ID%20Pri%20Mstone%20ReleaseBlock%20OS%20Area%20Feature%20Status%20Owner%20Summary&id=84332 – Plynx Feb 08 '13 at 18:47