模拟按键'ESC',解决韩语等输入法对输入框(codemirror)的支持

  on(div, "compositionend", function (e) {
      if (this$1.composing) {
          if (e.data != this$1.composing.data) { this$1.readFromDOMSoon() }
          this$1.composing.done = true
          //simulate 'ESC',  ex.Korean
          var keyboardEventInit = { key: "Escape", code: "Escape", keyCode: 27, which: 27, composed: true, bubbles:true };
              var evtObj = new KeyboardEvent('keydown', keyboardEventInit);
              e.target.dispatchEvent(evtObj);
      }
  })
上一篇:杂七杂八的一些板子


下一篇:POJ2559/HDU1506 Largest Rectangle in a Histogram (cartesian tree)