Reads through the event log, removing events from the head of the log
when the corresponding true key presses are known (or as known as they
can be).

@private
@return {Boolean} Whether the default action of the latest event should
be prevented.
197663
function interpret_events() {

        // Do not prevent default if no event could be interpreted
        var handled_event = interpret_event();
        if (!handled_event)
            return false;

        // Interpret as much as possible
        var last_event;
        do {
            last_event = handled_event;
            handled_event = interpret_event();
        } while (handled_event !== null);

        return last_event.defaultPrevented;

    }
1116865
def keyReleaseEvent(self, event):
        
        if self.isReadOnly():
            return
        initial_state = event.isAccepted()
        event.ignore()
        self.key_released.emit(event)
        if not event.isAccepted():
            event.setAccepted(initial_state)
            super(CodeEdit, self).keyReleaseEvent(event)
1310819
function(){
            if(!this._boundElement){
                return false;
            }
            var el = this._boundElement;
            el.removeEventListener('mousemove', this);
            el.removeEventListener('mouseenter', this);
            el.removeEventListener('mouseleave', this);
            el.removeEventListener('click', this);
        }
380343
function(){
       var i; 
       for (i = 0; i < this._events.length; i++) {
           var evt = this._events[i];
           if (evt.eventType === "WorkflowExecutionCancelRequested") {
               return true;
           }
       }
       return false;

   }
226854
function (e) {
			this._cancelCheckSelection();
			if (this._ignoreEvent(e)) { return; }
			if (util.isFirefox < 13 && e.which === 1) {
				this._clientDiv.contentEditable = false;
				(this._overlayDiv || this._clientDiv).draggable = true;
				this._ignoreBlur = true;
			}
			
			/* Prevent clicks outside of the client div from taking focus away. */
			var topNode = this._overlayDiv || this._clientDiv;
			/* Use view div on IE 8 otherwise it is not possible to scroll. */
			if (util.isIE < 9) { topNode = this._viewDiv; }
			var temp = e.target ? e.target : e.srcElement;
			while (temp) {
				if (topNode === temp) {
					return;
				}
				if (temp.className && temp.className.indexOf("textViewFind") !== -1) { //$NON-NLS-1$
					return;
				}
				temp = temp.parentNode;
			}
			if (e.preventDefault) { e.preventDefault(); }
			if (e.stopPropagation){ e.stopPropagation(); }
			if (!this._isW3CEvents) {
				/*
				* In IE 8 is not possible to prevent the default handler from running
				* during mouse down event using usual API. The workaround is to give
				* focus back to the client div.
				*/ 
				var that = this;
				var win = this._getWindow();
				win.setTimeout(function() {
					that._clientDiv.focus();
				}, 0);
			}
		}
1216935
function () {
                this.$assert(838, this._listenersStopped !== true);
                this._listenersStopped = true;
                var bindings = this._bindings;
                if (bindings) {
                    // remove binding
                    for (var index = 0, bind; bind = bindings[index]; index++) {
                        // remove the recursive listener
                        this.__json.removeListener(bind.inside, bind.to, bind.callback, bind.recursive);
                    }
                }
            }
827091
function _isReactKeyDown( event ) {
   return event &&
    typeof event === 'object' &&
    event.nativeEvent instanceof window.KeyboardEvent &&
    event.type === 'keydown';
}
149010
public boolean dispatchKeyEvent (KeyEvent e)
    {
        // bail if we're not enabled, we haven't the focus, or we're not
        // showing on-screen
        if (!_enabled || !_focus || !_target.isShowing()) {
//             log.info("dispatchKeyEvent [enabled=" + _enabled +
//                      ", focus=" + _focus +
//                      ", showing=" + ((_target == null) ? "N/A" :
//                                      "" + _target.isShowing()) + "].");
            return false;
        }

        // handle key press and release events
        switch (e.getID()) {
        case KeyEvent.KEY_PRESSED:
            return keyPressed(e);

        case KeyEvent.KEY_RELEASED:
            return keyReleased(e);

        case KeyEvent.KEY_TYPED:
            return keyTyped(e);

        default:
            return false;
        }
    }
1133
function(event) {
    this.states.left = false;
    this.states.right = false;
    this.states.front = false;
    this.states.back = false;

    event.preventDefault();
    event.stopPropagation();
  }
176691
function( evt ) {
			var undoManager = this.undoManager,
				keyCode = evt.data.getKey(),
				totalInputs = this.keyEventsStack.getTotalInputs();

			// Remove record from stack for provided key code.
			this.keyEventsStack.remove( keyCode );

			// Second part of the workaround for IEs functional keys bug. We need to check whether something has really
			// changed because we blindly mocked the keypress event.
			// Also we need to be aware that lastKeydownImage might not be available (#12327).
			if ( UndoManager.ieFunctionalKeysBug( keyCode ) && this.lastKeydownImage &&
				this.lastKeydownImage.equalsContent( new Image( undoManager.editor, true ) ) ) {
				return;
			}

			if ( totalInputs > 0 ) {
				undoManager.type( keyCode );
			} else if ( UndoManager.isNavigationKey( keyCode ) ) {
				// Note content snapshot has been checked in keydown.
				this.onNavigationKey( true );
			}
		}
128102
function(data, hashId, key) {
        if (hashId == -1) {
            // record key
            data.inputChar = key;
            data.lastEvent = "input";
        } else if (data.inputChar && data.$lastHash == hashId && data.$lastKey == key) {
            // check for repeated keypress 
            if (data.lastEvent == "input") {
                data.lastEvent = "input1";
            } else if (data.lastEvent == "input1") {
                // simulate textinput
                return true;
            }
        } else {
            // reset
            data.$lastHash = hashId;
            data.$lastKey = key;
            data.lastEvent = "keypress";
        }
    }
623227
protected static boolean dispatchKeyEvent (KeyEvent e)
    {
        // ignore non-keypress events
        if (e.getID() != KeyEvent.KEY_PRESSED) {
            return false;
        }

        // bail here if we have no hooks registered for this key code
        ArrayList<Tuple<Integer,Hook>> list = _bindings.get(e.getKeyCode());
        if (list == null) {
            return false;
        }

        // scan the list of registered hooks checking for any that match
        // the depressed set of modifier keys
        boolean handled = false;
        int hcount = list.size();
        for (int ii = 0; ii < hcount; ii++) {
            Tuple<Integer,Hook> tup = list.get(ii);
            int mask = tup.left.intValue();
            if ((e.getModifiersEx() & mask) == mask) {
                try {
                    tup.right.invoke();
                    handled = true;
                } catch (Throwable t) {
                    log.warning("Hook failed", "event", e, "hook", tup.right, t);
                }
            }
        }

        return handled;
    }
400779
function(e) {
        if (this.enableKeys) {
            var kc = Event.getCharCode(e);

            switch (kc) {
                case 0x25: // left
                case 0x26: // up
                case 0x27: // right
                case 0x28: // down
                case 0x24: // home
                case 0x23: // end
                    Event.preventDefault(e);
                    break;
                default:
            }
        }
    }
1094315
function (e) {
        var that = this;

        // prevent moving focus out of the text field
        e.preventDefault();

        // IE doesn't prevent moving focus even with e.preventDefault()
        // so we set a flag to know when we should ignore the blur event
        that.cancelBlur = true;
        utils.delay(function () {
            delete that.cancelBlur;
        });

        // clicking on the scrollbar causes focus to shift to the body
        // but we can't detect a mouseup or a click immediately afterward
        // so we have to track the next mousedown and close the menu if
        // the user clicks somewhere outside of the autocomplete
        if ($(e.target).closest(".ui-menu-item").length == 0) {
            utils.delay(function () {
                $(document).one("mousedown", function (e) {
                    var $elements = that.el
                        .add(that.$wrapper)
                        .add(that.options.$helpers);

                    if (that.options.floating) {
                        $elements = $elements.add(that.$container);
                    }

                    $elements = $elements.filter(function () {
                        return this === e.target || $.contains(this, e.target);
                    });

                    if (!$elements.length) {
                        that.hide();
                    }
                });
            });
        }
    }
38999
function(event) {
                if(event.preventDefault && event.cancelable)
                    event.preventDefault();
                else
                    event.returnValue = false;
            }
770741
function _handleKeyEvent(e) {

            // normalize e.which for key events
            // @see http://stackoverflow.com/questions/4285627/javascript-keycode-vs-charcode-utter-confusion
            if (typeof e.which !== 'number') {
                e.which = e.keyCode;
            }

            var character = _characterFromEvent(e);

            // no character found then stop
            if (!character) {
                return;
            }

            // need to use === for the character check because the character can be 0
            if (e.type == 'keyup' && _ignoreNextKeyup === character) {
                _ignoreNextKeyup = false;
                return;
            }

            self.handleKey(character, _eventModifiers(e), e);
        }
566627
function (event) {
            // Check if left mouse button is pressed
            if (event.button === 0 && this.isClickable) {
                this.updated = true;
                this.released = false;
                if (this.isHoldable) {
                    if (this.holdTimeout !== null) {
                        me.timer.clearTimeout(this.holdTimeout);
                    }
                    this.holdTimeout = me.timer.setTimeout(this.hold.bind(this), this.holdThreshold, false);
                    this.released = false;
                }
                return this.onClick.call(this, event);
            }
        }