IE8 does not implement getModifierState so we simply map it to the only modifier keys exposed by the event itself, does not support Lock-keys. Currently, all major browsers except Chrome seems to support Lock-keys.
184430
function modifierStateGetter(keyArg) {
  var syntheticEvent = this;
  var nativeEvent = syntheticEvent.nativeEvent;
  if (nativeEvent.getModifierState) {
    return nativeEvent.getModifierState(keyArg);
  }
  var keyProp = modifierKeyToProp[keyArg];
  return keyProp ? !!nativeEvent[keyProp] : false;
}
747176
function isModifierEnabled(modifiers, modifierName) {
  return modifiers.some(({ name, enabled }) => enabled && name === modifierName);
}
1272734
function assignKey(key, scope, method){
    var keys, mods;
    keys = getKeys(key);
    if (method === undefined) {
      method = scope;
      scope = 'all';
    }

    // for each shortcut
    for (var i = 0; i < keys.length; i++) {
      // set modifier keys if any
      mods = [];
      key = keys[i].split('+');
      if (key.length > 1){
        mods = getMods(key);
        key = [key[key.length-1]];
      }
      // convert to keycode and...
      key = key[0]
      key = code(key);
      // ...store handler
      if (!(key in _handlers)) _handlers[key] = [];
      _handlers[key].push({ shortcut: keys[i], scope: scope, method: method, key: keys[i], mods: mods });
    }
  }
856315
public int getModifiers() {
        MetaMethod getter = getGetter();
        MetaMethod setter = getSetter();
        if (setter != null && getter == null) return setter.getModifiers();
        if (getter != null && setter == null) return getter.getModifiers();
        int modifiers = getter.getModifiers() | setter.getModifiers();
        int visibility = 0;
        if (Modifier.isPublic(modifiers)) visibility = Modifier.PUBLIC;
        if (Modifier.isProtected(modifiers)) visibility = Modifier.PROTECTED;
        if (Modifier.isPrivate(modifiers)) visibility = Modifier.PRIVATE;
        int states = getter.getModifiers() & setter.getModifiers();
        states &= ~(Modifier.PUBLIC | Modifier.PROTECTED | Modifier.PRIVATE);
        states |= visibility;
        return states;
    }
1104758
function(e) {

                    if (!self.originalElem.disabled) {
                        // Sets the current key to the `keyCode` value if `charCode` does not exist.  Used for cross
                        // browser support since IE uses `keyCode` instead of `charCode`.
                        var currentKey = e.charCode || e.keyCode,

                            key = self._keyMappings[e.charCode || e.keyCode],

                            // Converts unicode values to characters
                            alphaNumericKey = String.fromCharCode(currentKey);

                        // If the plugin options allow text searches
                        if (self.search && (!key || (key && key === "space"))) {

                            // Calls `search` and passes the character value of the user's text search
                            self.search(alphaNumericKey, true, true);

                        }

                        if(key === "space") {

                            e.preventDefault();

                        }
                    }
                }
609228
function getMods(key) {
    var mods = key.slice(0, key.length - 1);
    for (var mi = 0; mi < mods.length; mi++)
    mods[mi] = _MODIFIERS[mods[mi]];
    return mods;
  }
589386
function getOverrides (eventType, options) {
  if (eventType === 'KeyboardEvent' && options) {
    return {
      keyCode: options.keyCode || 0,
      key: options.key || 0,
      which: options.which || options.keyCode || 0
    }
  }
}
697073
function onKeyEventTargetKeyDown(e) {
      var macroModeState = vimGlobalState.macroModeState;
      var lastChange = macroModeState.lastInsertModeChanges;
      var keyName = CodeMirror.keyName(e);
      function onKeyFound() {
        lastChange.changes.push(new InsertModeKey(keyName));
        return true;
      }
      if (keyName.indexOf('Delete') != -1 || keyName.indexOf('Backspace') != -1) {
        CodeMirror.lookupKey(keyName, ['vim-insert'], onKeyFound);
      }
    }
679924
function() {
            // If lockup is already locked don't try to disable inputs again
            if (this.$pinny.lockup('isLocked')) {
                return;
            }

            var $focusableElements = $(FOCUSABLE_ELEMENTS).not(function() {
                return $(this).isChildOf('.' + classes.PINNY);
            });

            $focusableElements.each(function(_, el) {
                var $el = $(el);
                var currentTabIndex = $el.attr('tabindex') || 0;

                $el
                    .attr('data-orig-tabindex', currentTabIndex)
                    .attr('tabindex', '-1');
            });
        }
492905
def tabModificationStateChanged(self, tab):
		'''
		
		'''
		if tab == self.currentTab:
			changed = tab.editBox.document().isModified()
			if self.autoSaveActive(tab):
				changed = False
			self.actionSave.setEnabled(changed)
			self.setWindowModified(changed)
736601
def getkeypress(self):
        '''
        ck = System.ConsoleKey
        while 1:
            e = System.Console.ReadKey(True)
            if e.Key == System.ConsoleKey.PageDown: #PageDown
                self.scroll_window(12)
            elif e.Key == System.ConsoleKey.PageUp:#PageUp
                self.scroll_window(-12)
            elif str(e.KeyChar) == u"\000":#Drop deadkeys
                log(u"Deadkey: %s"%e)
                return event(self, e)
            else:
                return event(self, e)
1049406
function onKeydown(event)
{
  // Gets the keycode, then stores it
  var keyCode = event.which;

  // Checks which action matches with the current keycode
  switch (keyCode)
  {
    case 65: keyA();
    break;

    case 66: keyB();
    break;

    case 67: keyC();
    break;

    case 68: keyD();
    break;

    case 69: keyE();
    break;

    case 70: keyF();
    break;

    case 71: keyG();
    break;

    case 72: keyH();
    break;

    case 73: keyI();
    break;

    case 74: keyJ();
    break;

    case 75: keyK();
    break;

    case 76: keyL();
    break;

    case 77: keyM();
    break;

    case 78: keyN();
    break;

    case 79: keyO();
    break;

    case 80: keyP();
    break;

    case 81: keyQ();
    break;

    case 82: keyR();
    break;

    case 83: keyS();
    break;

    case 84: keyT();
    break;

    case 85: keyU();
    break;

    case 86: keyV();
    break;

    case 87: keyW();
    break;

    case 88: keyX();
    break;

    case 89: keyY();
    break;

    case 90: keyZ();
    break;

    case 96: key0();
    break;

    case 97: key1();
    break;

    case 98: key2();
    break;

    case 99: key3();
    break;

    case 100: key4();
    break;

    case 101: key5();
    break;

    case 102: key6();
    break;

    case 103: key7();
    break;

    case 104: key8();
    break;

    case 105: key9();
    break;

    // Gets the jim help element to toggle the none class
    default:
    document.getElementById('jim-help').classList.toggle('none');
  }
}
481199
function keyEventEnum() {
  let modifiers = [
    '', 'CTRL_', 'ALT_', 'SHIFT_', 'CTRL_ALT_', 'CTRL_SHIFT_', 'ALT_SHIFT_',
    'CTRL_ALT_SHIFT_',
  ];
  let charKeys = [
    'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O',
    'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
    '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
  ];
  let specialKeys = [
    'SPACE', 'RETURN', 'TAB', 'BACKSPACE', 'ESCAPE',
    'INSERT', 'DELETE', 'HOME', 'END', 'PAGEUP', 'PAGEDOWN',
    'F1', 'F2', 'F3', 'F4', 'F5', 'F6', 'F7', 'F8', 'F9', 'F10', 'F11', 'F12',
  ];
  let symbolKeys = [
    'AMPERSAND', 'ASTERISK', 'AT', 'BACKSLASH', 'CARET', 'COLON', 'DOLLAR',
    'EQUALS', 'EXCLAIM', 'GREATER', 'HASH', 'LESS', 'PERCENT', 'PLUS',
    'SEMICOLON', 'SLASH', 'QUESTION', 'QUOTE',
    'QUOTEDBL', 'UNDERSCORE', 'LEFTPAREN', 'RIGHTPAREN',
    'LEFTBRACKET', 'RIGHTBRACKET', 'LEFTBRACE', 'RIGHTBRACE',
  ];
  let arrowKeys = [
    'LEFT', 'RIGHT', 'UP', 'DOWN',
  ];
  let keys = charKeys.concat(specialKeys).concat(symbolKeys).concat(arrowKeys);

  let eventNames = [];
  for (let modifier of modifiers) {
    for (let key of keys) {
      eventNames.push('K_' + modifier + key);
    }
  }
  return eventNames;
}
1992
function () {
        var self = this, id = self._id, settings = self.settings, prefix = self.classPrefix;
        var value = self.state.get('value') || '';
        var icon, text, openBtnHtml = '', extraAttrs = '', statusHtml = '';

        if ("spellcheck" in settings) {
          extraAttrs += ' spellcheck="' + settings.spellcheck + '"';
        }

        if (settings.maxLength) {
          extraAttrs += ' maxlength="' + settings.maxLength + '"';
        }

        if (settings.size) {
          extraAttrs += ' size="' + settings.size + '"';
        }

        if (settings.subtype) {
          extraAttrs += ' type="' + settings.subtype + '"';
        }

        statusHtml = '<i id="' + id + '-status" class="mce-status mce-ico" style="display: none"></i>';

        if (self.disabled()) {
          extraAttrs += ' disabled="disabled"';
        }

        icon = settings.icon;
        if (icon && icon != 'caret') {
          icon = prefix + 'ico ' + prefix + 'i-' + settings.icon;
        }

        text = self.state.get('text');

        if (icon || text) {
          openBtnHtml = (
            '<div id="' + id + '-open" class="' + prefix + 'btn ' + prefix + 'open" tabIndex="-1" role="button">' +
            '<button id="' + id + '-action" type="button" hidefocus="1" tabindex="-1">' +
            (icon != 'caret' ? '<i class="' + icon + '"></i>' : '<i class="' + prefix + 'caret"></i>') +
            (text ? (icon ? ' ' : '') + text : '') +
            '</button>' +
            '</div>'
          );

          self.classes.add('has-open');
        }

        return (
          '<div id="' + id + '" class="' + self.classes + '">' +
          '<input id="' + id + '-inp" class="' + prefix + 'textbox" value="' +
          self.encode(value, false) + '" hidefocus="1"' + extraAttrs + ' placeholder="' +
          self.encode(settings.placeholder) + '" />' +
          statusHtml +
          openBtnHtml +
          '</div>'
        );
      }
471652
def isExpandKeyEvent(self, keyEvent):
        """"""
        return keyEvent.modifiers() & Qt.ShiftModifier and \
               keyEvent.modifiers() & Qt.AltModifier and \
               keyEvent.key() in (Qt.Key_Left, Qt.Key_Right, Qt.Key_Down, Qt.Key_Up,
                                  Qt.Key_PageUp, Qt.Key_PageDown, Qt.Key_Home, Qt.Key_End)
120586
function( eventName, keyCode ) {
			// No keyboard, can't simulate...
			if( typeof window.onkeydown === 'undefined' ) return false;
			var oEvent = document.createEvent('KeyboardEvent');

			// Chromium Hack
			if( navigator.userAgent.toLowerCase().indexOf( 'chrome' ) !== -1 ) {
				Object.defineProperty( oEvent, 'keyCode', {
					get: function() { return this.keyCodeVal; }
				});
				Object.defineProperty( oEvent, 'which', {
					get: function() { return this.keyCodeVal; }
				});
			}

			var initKeyEvent = oEvent.initKeyboardEvent || oEvent.initKeyEvent;
			initKeyEvent.call(oEvent,
				'key' + eventName,
				true,
				true,
				document.defaultView,
				false,
				false,
				false,
				false,
				keyCode,
				keyCode
			);

			oEvent.keyCodeVal = keyCode;
		}
947298
function() {

      var x, arr, el, configs, model, value, attr, parts, style;

      // setup config events
      arr = document.querySelectorAll('.hashedit-config, .hashedit-modal');

      for (x = 0; x < arr.length; x += 1) {

        // delegate on .hashedit-config
        ['propertychange', 'change', 'click', 'keyup', 'input', 'paste'].forEach
          (function(e) {

            arr[x].addEventListener(e, function(e) {

              el = e.target;

              if (el.hasAttribute('hashedit-cancel-modal')) {

                // hide .hashedit-config, .hashedit-modal
                configs = document.querySelectorAll(
                  '.hashedit-modal');

                for (x = 0; x < configs.length; x += 1) {
                  configs[x].removeAttribute('visible');
                }

              }

              // look for [data-model]
              if (el.hasAttribute('data-model')) {

                model = el.getAttribute('data-model');
                value = '';
                attr = '';

                value = el.value;

                if (model.indexOf('node.') != -1) {
                  parts = model.split('.');

                  // converts camelcase to hyphens, sets attribute
                  if (parts.length > 1) {

                    // get property
                    attr = parts[1].replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();

                    if(attr === 'html') {
                      hashedit.current.node.innerHTML = value;

                      hashedit.setupElementMenu(hashedit.current.node);
                    }
                    else { // other elements

                      // get currentValue
                      var old = hashedit.current.node.getAttribute(attr);

                      // set attribute
                      hashedit.current.node.setAttribute(attr, value);

                      if(hashedit.debug === true) {
                        console.log('setattribute on [data-model]');
                        console.log('attr=' + attr + 'value=' + value);
                      }

                      // create text style
                      style = hashedit.createTextStyle(hashedit.current.node);

                      hashedit.current.node.setAttribute('style', style);

                      // call change event
                      for (x = 0; x < hashedit.menu.length; x += 1) {

                        if(hashedit.current.node.matches(hashedit.menu[x].selector)) {
                          if(hashedit.menu[x].change) {
                            hashedit.menu[x].change(attr, value, old);
                          }

                        }

                      }

                    }


                  }
                }

                if (model.indexOf('link.') != -1) {
                  parts = model.split('.');

                  // converts camelcase to hyphens, sets attribute
                  if (parts.length > 1) {

                    // get property
                    attr = parts[1].replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();

                    // set attribute
                    hashedit.currLink.setAttribute(attr, value);

                    // get current node
                    if(hashedit.current.node == null){
                      hashedit.current.node = hashedit.findParentBySelector(hashedit.currLink, '[hashedit-element]');
                    }

                    // fire event
                    hashedit.current.node.dispatchEvent(new Event(
                      'input', {
                        'bubbles': true
                      }));

                  }
                }

                if (model.indexOf('image.') != -1) {
                  parts = model.split('.');

                  // converts camelcase to hyphens, sets attribute
                  if (parts.length > 1) {

                    // get property
                    attr = parts[1].replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();

                    // set attribute
                    hashedit.current.image.setAttribute(attr, value);

                    hashedit.current.node = hashedit.findParentBySelector(hashedit.current.image, '[hashedit-element]');

                    // fire event
                    if (hashedit.current.node !== null) {

                      hashedit.current.node.dispatchEvent(new Event(
                        'input', {
                          'bubbles': true
                        }));
                    }

                  }
                }

              }

            }, false);

          });

      }

    }