title: Is it possible to use the TinyMCE addShortcut API to map an event to the ESC key?
body: <p>I've been working with v5 of TinyMCE. I would like to add a shortcut that binds to the ESC key and overrides any of the editors defaults to that key.</p>
  <p>Using their docs I have tried both their tinymce.editor.addShortcut and tinymce.Shortcuts.add APIs:
  <a href="https://www.tiny.cloud/docs/advanced/keyboard-shortcuts/#addcustomshortcutstotinymce" rel="nofollow noreferrer">https://www.tiny.cloud/docs/advanced/keyboard-shortcuts/#addcustomshortcutstotinymce</a></p>
  <p>For the 'pattern' parameter I tried every combination of 'esc', 'Esc', 'Escape' and using other s/o responses tried putting the keycode itself '27'. Using the keycode actually adds an element to the editor.shortcuts.shortcuts object but it doesn't fire on keypress. All the other patterns don't even get added to the object.</p>
  <p>It seems if I set a 'keydown' event I can accomplish the same thing but ideally I would like to use their API for this.</p>
  <p>Does anyone know if I am missing something? Below is a codepen that is supposed to change the highlight color to yellow when you press the escape key. (Taken from the tiny docs and modified for my scenario)</p>
  <p><a href="https://codepen.io/jprice360/pen/YzWBZWm?editable=true%3Dhttps%3A%2F%2Fwww.tiny.cloud%2F" rel="nofollow noreferrer">Code Pen</a></p>
  <p>JS</p>
  <pre><code>tinymce.init({
    selector: 'textarea#custom-shortcut',
    height: 300,
    setup: function (editor) {
      editor.addShortcut(
        '27', 'Add yellow highlight to selected text.', function () {
        editor.execCommand('hilitecolor', false , '#FFFF00');
      });
    },
    content_style: 'body { font-family:Helvetica,Arial,sans-serif; font-size:14px }'
  });
  </code></pre>
  <p>HTML</p>
  <pre><code>&lt;textarea id=&quot;custom-shortcut&quot;&gt;
    &lt;p&gt;To add a yellow highlight to this text:&lt;/p&gt;
    &lt;ul&gt;
      &lt;li&gt;Select some text
       &lt;ul&gt;
         &lt;li&gt;On PC, press: Ctrl+Alt+Y&lt;/li&gt;
          &lt;li&gt;On MacOS, press: Command+Option+Y&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/textarea&gt;
  </code></pre>