TODO can we just declare the keydowhHandler once? using `this`?
187631
function makeKeyDefinition ( code ) {
	return ( node, fire ) => {
		function keydownHandler ( event ) {
			var which = event.which || event.keyCode;

			if ( which === code ) {
				event.preventDefault();

				fire({
					node,
					original: event
				});
			}
		}

		node.addEventListener( 'keydown', keydownHandler, false );

		return {
			teardown () {
				node.removeEventListener( 'keydown', keydownHandler, false );
			}
		};
	};
}
143407
function(key) {
			this._keyMap[key] = this.length;
			this._keys.push(key);
			this.length = this._keys.length;
		}
65233
function(callback, ctx){
      var k = 0;

      // 1. Let O be the result of calling ToObject passing the |this| value as the argument.
      var O = Object(this);

      var len = O.length >>> 0; 

      if ( typeof callback !== "function" ) {
        throw new TypeError( callback + " is not a function" );
      }

      // 7. Repeat, while k < len
      while( k < len ) {

        var kValue;

        if ( k in O ) {

          kValue = O[ k ];

          callback.call( ctx, kValue, k, O );
        }
        k++;
      }
    }
1264287
function keyboardNavigation() {
        var _this3 = this;

        if (this.events.hasOwnProperty('keyboard')) {
            return false;
        }
        this.events['keyboard'] = addEvent('keydown', {
            onElement: window,
            withCallback: function withCallback(event, target) {
                event = event || window.event;
                var key = event.keyCode;
                if (key == 39) _this3.nextSlide();
                if (key == 37) _this3.prevSlide();
                if (key == 27) _this3.close();
            }
        });
    }
455266
function onKey( event ) {
			if ( editor.mode != 'wysiwyg' )
				return;

			switch ( event.data.keyCode ) {
				// Paste
				case CKEDITOR.CTRL + 86: // CTRL+V
				case CKEDITOR.SHIFT + 45: // SHIFT+INS
					var editable = editor.editable();

					// Cancel 'paste' event because ctrl+v is for IE handled
					// by 'beforepaste'.
					preventPasteEventNow();

					// Simulate 'beforepaste' event for all none-IEs.
					!CKEDITOR.env.ie && editable.fire( 'beforepaste' );

					return;

					// Cut
				case CKEDITOR.CTRL + 88: // CTRL+X
				case CKEDITOR.SHIFT + 46: // SHIFT+DEL
					// Save Undo snapshot.
					editor.fire( 'saveSnapshot' ); // Save before cut
					setTimeout( function() {
						editor.fire( 'saveSnapshot' ); // Save after cut
					}, 50 ); // OSX is slow (#11416).
			}
		}
1111694
public final void this_key() throws RecognitionException {
		Token id=null;

		try {
			// src/main/resources/org/drools/compiler/lang/DRL6Expressions.g:796:5: ({...}? =>id= ID )
			// src/main/resources/org/drools/compiler/lang/DRL6Expressions.g:796:12: {...}? =>id= ID
			{
			if ( !(((helper.validateIdentifierKey(DroolsSoftKeywords.THIS)))) ) {
				if (state.backtracking>0) {state.failed=true; return;}
				throw new FailedPredicateException(input, "this_key", "(helper.validateIdentifierKey(DroolsSoftKeywords.THIS))");
			}
			id=(Token)match(input,ID,FOLLOW_ID_in_this_key5085); if (state.failed) return;
			if ( state.backtracking==0 ) { helper.emit(id, DroolsEditorType.KEYWORD); }
			}

		}

		catch (RecognitionException re) {
		    throw re;
		}

		finally {
			// do for sure before leaving
		}
	}
1300423
function registerInputEnterKeyHandler(inputEl, fileId) {
        inheritedInternalApi.getDisposeSupport().attach(inputEl, "keyup", function(event) {

            var code = event.keyCode || event.which;

            if (code === 13) {
                handleNameUpdate(inputEl, fileId);
            }
        });
    }
306349
function createKeyboardEvent(type, options) {
  options = clean(type, options);
  var e = document.createEvent('KeyboardEvent');
  (e.initKeyEvent || e.initKeyboardEvent).call(
    e,
    type,
    options.bubbles,
    options.cancelable,
    options.view,
    options.ctrl,
    options.alt,
    options.shift,
    options.meta,
    options.key,
    options.key
  );

  // http://stackoverflow.com/a/10520017
  if (e.keyCode !== options.key) {
    Object.defineProperty(e, 'keyCode', {
      get: function() { return options.key; }
    });
    Object.defineProperty(e, 'charCode', {
      get: function() { return options.key; }
    });
    Object.defineProperty(e, 'which', {
      get: function() { return options.key; }
    });
    Object.defineProperty(e, 'shiftKey', {
      get: function() { return options.shift; }
    });
  }

  return e;
}
1012238
function (source, keyS, target, keyT) {
      var desc = Object.getOwnPropertyDescriptor(source, keyS);
      if (desc) {
        desc.enumerable = false;
        target[keyT] = desc;
      }
    }
175623
function addBindings() {
		function clickHandler(e) {
			// ignore non-left-mouse-clicks and clicks modified with ctrl / command, shift, or alt.
			// See: http://jacklmoore.com/notes/click-events/
			if (!(e.which > 1 || e.shiftKey || e.altKey || e.metaKey || e.ctrlKey)) {
				e.preventDefault();
				launch(this);
			}
		}

		if ($box) {
			if (!init) {
				init = true;

				// Anonymous functions here keep the public method from being cached, thereby allowing them to be redefined on the fly.
				$next.click(function () {
					publicMethod.next();
				});
				$prev.click(function () {
					publicMethod.prev();
				});
				$close.click(function () {
					publicMethod.close();
				});
				$overlay.click(function () {
					if (settings.overlayClose) {
						publicMethod.close();
					}
				});
				
				// Key Bindings
				$(document).bind('keydown.' + prefix, function (e) {
					var key = e.keyCode;
					if (open && settings.escKey && key === 27) {
						e.preventDefault();
						publicMethod.close();
					}
					if (open && settings.arrowKey && $related[1] && !e.altKey) {
						if (key === 37) {
							e.preventDefault();
							$prev.click();
						} else if (key === 39) {
							e.preventDefault();
							$next.click();
						}
					}
				});

				if ($.isFunction($.fn.on)) {
					// For jQuery 1.7+
					$(document).on('click.'+prefix, '.'+boxElement, clickHandler);
				} else {
					// For jQuery 1.3.x -> 1.6.x
					// This code is never reached in jQuery 1.9, so do not contact me about 'live' being removed.
					// This is not here for jQuery 1.9, it's here for legacy users.
					$('.'+boxElement).live('click.'+prefix, clickHandler);
				}
			}
			return true;
		}
		return false;
	}
827942
function keydownHook(event) {
        var keyHandled = false;

        switch (event.keyCode) {
        case KeyEvent.DOM_VK_UP:
            selectNextItem(-1);
            keyHandled = true;
            break;
        case KeyEvent.DOM_VK_DOWN:
            selectNextItem(+1);
            keyHandled = true;
            break;
        case KeyEvent.DOM_VK_ENTER:
        case KeyEvent.DOM_VK_RETURN:
            if ($dropdownItem) {
                $dropdownItem.trigger("click");
            }
            keyHandled = true;
            break;
        case KeyEvent.DOM_VK_BACK_SPACE:
        case KeyEvent.DOM_VK_DELETE:
            if ($dropdownItem) {
                removeSelectedItem(event);
                keyHandled = true;
            }
            break;
        }

        if (keyHandled) {
            event.stopImmediatePropagation();
            event.preventDefault();
        }
        return keyHandled;
    }
886090
function (key, value) {
        var accessor = getAccessors(this)[key],
            oldVal = this.get(key);


        this.triggerBeforeChanged(key, oldVal);

        if (accessor) {
            accessor.target.set(accessor.key, value);
        } else {

            if (this['set_' + key]) {
                this['set_' + key](value);
            } else {
                this[key] = value;
            }
        }
        this.triggerChanged(key, oldVal);
    }
474634
function handleHeadingKeydown(e) {
    eventUtils.handleLeftRightArrowsKeydown(e, () => {
        e.preventDefault();
        let index = getElementIndex(getHeadingEl(e, this.state.fake));
        const maxIndex = this.headingsEl.children.length - 1;
        const keyCode = e.charCode || e.keyCode;
        if (keyCode === 37) index = index === 0 ? maxIndex : index - 1;
        if (keyCode === 39) index = index === maxIndex ? 0 : index + 1;

        this.headingsEl.children[index].focus();
        if (this.state.activation === 'auto') this.processStateChange(index);
    });
    eventUtils.handleActionKeydown(e, () => {
        e.preventDefault();
        this.handleHeadingClick(e);
    });
}
112266
function onKey(key, event, target, callback, options) {
    return on(event, target, e => {
        if (!key) {
            // We call back for every key if there's no specific key
            callback(e);
        } else if (key === e.key || key === e.keyCode) {
            // Otherwise we call back only if the key matches
            callback(e);
        }
    }, options);
}
1151466
function() {
			var editor = this.undoManager.editor,
				editable = editor.editable(),
				that = this;

			// We'll create a snapshot here (before DOM modification), because we'll
			// need unmodified content when we got keygroup toggled in keyup.
			editable.attachListener( editable, 'keydown', function( evt ) {
				that.onKeydown( evt );

				// On IE keypress isn't fired for functional (backspace/delete) keys.
				// Let's pretend that something's changed.
				if ( UndoManager.ieFunctionalKeysBug( evt.data.getKey() ) ) {
					that.onInput();
				}
			}, null, null, 999 );

			// Only IE can't use input event, because it's not fired in contenteditable.
			editable.attachListener( editable, ( CKEDITOR.env.ie ? 'keypress' : 'input' ), that.onInput, that, null, 999 );

			// Keyup executes main snapshot logic.
			editable.attachListener( editable, 'keyup', that.onKeyup, that, null, 999 );

			// On paste and drop we need to ignore input event.
			// It would result with calling undoManager.type() on any following key.
			editable.attachListener( editable, 'paste', that.ignoreInputEventListener, that, null, 999 );
			editable.attachListener( editable, 'drop', that.ignoreInputEventListener, that, null, 999 );

			// Click should create a snapshot if needed, but shouldn't cause change event.
			// Don't pass onNavigationKey directly as a listener because it accepts one argument which
			// will conflict with evt passed to listener.
			// #12324 comment:4
			editable.attachListener( editable.isInline() ? editable : editor.document.getDocumentElement(), 'click', function() {
				that.onNavigationKey();
			}, null, null, 999 );

			// When pressing `Tab` key while editable is focused, `keyup` event is not fired.
			// Which means that record for `tab` key stays in key events stack.
			// We assume that when editor is blurred `tab` key is already up.
			editable.attachListener( this.undoManager.editor, 'blur', function() {
				that.keyEventsStack.remove( 9 /*Tab*/ );
			}, null, null, 999 );
		}
510013
function eventKeyUp(e) {
  var keycode = ('which' in e) ? e.which : e.keyCode;
  keyUp(keycode);
}
395028
function(keyname) {
  const _ = Struct.PriProp(keyname);
  if (_.__proto__) {
    _.__proto__ = Struct.prototype;
  }
  else {
    Object.keys(Struct.prototype).forEach(function(p) {
      Object.defineProperty(_, p, {
        value    : Struct.prototype[p],
        writable : false
      });
    }, this);
  }
  var classFunction;
  Object.defineProperties(_, {
    requires : {
      value: {},
      writable: false
    },

    defaults : {
      value: {},
      writable: false
    },

    defaultFuncs : {
      value: {},
      writable: false
    },

    views: {
      value: {},
      writable: false
    },

    parentProps: {
      value: [],
      writable: false
    },

    enumerableDescs: {
      value: {},
      writable: false
    },

    classFunction : {
      get: function() {
        return classFunction;
      },
      set: function(v) {
        if (classFunction === undefined) {
          classFunction = v;
        }
        else if (classFunction !== v) {
          throw new Error('cannot change classFunction.');
        }
      }
    },

    Modifiers : {
      value    : Struct.Modifiers,
      writable : false
    }
  });
  return _;
}