Handle document.keyup event

@param {Event} e The DOM event to be handled
770483
function handleDocumentKeyup(e) {
  // Cancel rect if Esc is pressed
  if (e.keyCode === 27) {
    lines = null;
    path.parentNode.removeChild(path);
    document.removeEventListener('mousemove', handleDocumentMousemove);
    document.removeEventListener('mouseup', handleDocumentMouseup);
  }
}
466203
function handleMouseMove (e) {
                    if(enabled){
                        if (pushed) {
                            if(!axis || axis === 'x') {
                                $element[0].scrollLeft -= (-lastClientX + (lastClientX = e.clientX));
                            }
                            if(!axis || axis === 'y') {
                                $element[0].scrollTop -= (-lastClientY + (lastClientY = e.clientY));
                            }
                        }

                        e.preventDefault();
                    }
                }
338736
function stop(event) {
		if (window.document.all) { 
			event.keyCode = 0;
		}
		if (event.preventDefault) {
			event.preventDefault();
			event.stopPropagation();
		}
	}
86565
function(e) {

			if ( e.keyCode !== ENTER_KEY ){
				return;
			}

			if ( !this.input.val().trim() ){
				return;
			}

			window.app.Todos.create(this.newAttributes());
			this.input.val('');
		}
553810
function( type, options, element ) { //Everyone Else
				var doc = h.getWindow(element).document || document;
				if ( doc.createEvent ) {
					var event;

					try {

						event = doc.createEvent("KeyEvents");
						event.initKeyEvent(type, true, true, window, options.ctrlKey, options.altKey, options.shiftKey, options.metaKey, options.keyCode, options.charCode);
					}
					catch (e) {
						event = h.createBasicStandardEvent(type, options, doc);
					}
					event.synthetic = true;
					return event;
				}
				else {
					var event;
					try {
						event = h.createEventObject.apply(this, arguments);
						h.extend(event, options)
					}
					catch (e) {}

					return event;
				}
			}
1274459
function _characterFromEvent(e) {

        // for keypress events we should return the character as is
        if (e.type == 'keypress') {
            var character = String.fromCharCode(e.which);

            // if the shift key is not pressed then it is safe to assume
            // that we want the character to be lowercase.  this means if
            // you accidentally have caps lock on then your key bindings
            // will continue to work
            //
            // the only side effect that might not be desired is if you
            // bind something like 'A' cause you want to trigger an
            // event when capital A is pressed caps lock will no longer
            // trigger the event.  shift+a will though.
            if (!e.shiftKey) {
                character = character.toLowerCase();
            }

            return character;
        }

        // for non keypress events the special maps are needed
        if (_MAP[e.which]) {
            return _MAP[e.which];
        }

        if (_KEYCODE_MAP[e.which]) {
            return _KEYCODE_MAP[e.which];
        }

        // if it is not in the special map

        // with keydown and keyup events the character seems to always
        // come in as an uppercase character whether you are pressing shift
        // or not.  we should make sure it is always lowercase for comparisons
        return String.fromCharCode(e.which).toLowerCase();
    }
989303
function keyup(opts, optIdx, e) {
          var elem = opts.$input.get(0),
              elemFocusPosition,
              beforeValue,
              newValue,
              selection,
              selectionLength;

          if ("selectionStart" in elem) {
            // Standard-compliant browsers
            elemFocusPosition = elem.selectionStart;
          } else if (document.selection) {
            // IE
            //elem.focus();
            selection = document.selection.createRange();
            selectionLength = document.selection.createRange().text.length;
            selection.moveStart("character", -elem.value.length);
            elemFocusPosition = selection.text.length - selectionLength;
          }

          beforeValue = elem.value;
          if (opts.pattern in FORMATTER.formatter) {
            newValue = FORMATTER.formatter[opts.pattern].getPatternValue.call(this, opts, optIdx, e, elem.value);
          } else {
            newValue = beforeValue;
          }

          if (newValue != beforeValue) {
            opts.$input.val(newValue).trigger("change");
            setSelectionRange(elem, elemFocusPosition + newValue.length - beforeValue.length);
          }
        }
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);
			}
		}
1134899
function onKeyDown( evt ) {
    switch ( evt.key ) {
    case 'Space':
        this.expanded = !this.expanded;
        evt.preventDefault();
        break;
    case 'Enter':
        this.action = this.value;
        break;
    case 'ArrowDown':
        selectNext.call( this );
        evt.preventDefault();
        break;
    case 'ArrowUp':
        selectPrev.call( this );
        evt.preventDefault();
        break;
    case 'Escape':
        if ( this.expanded ) {
            this.expanded = false;
            // Set the value as it was when we expanded the combo.
            this.value = this._valueWhenExpanded;
            evt.preventDefault();
        }
        break;
    default:
        // Do nothing.
    }
}
1260554
function(e) {
			switch (e.type) {
				case 'click':
				case 'mousedown':
				case 'mouseup':
					this._onmouseevent(e);
					break;
				case 'orientationchange':
					this._onrotate();
					break;
				case 'resize':
					this._onresize();
					break;
				case 'DOMContentLoaded':
					this._ondom();
					/*
					if (!gui.hasModule('gui-spirits@wunderbyte.com')) {
						(function cleanthisup() {
							gui._oninit();
							gui.$onready();
						}());
					}
					*/
					break;
				case 'load':
					this._onload();
					break;
				case 'unload':
					this._onunload();
					break;
				case 'hashchange':
					this._onhashchange();
					break;
			}
		}
716857
function _onKeyDown(e) {
  var keyCode = e.keyCode;

  if (keyCode === 13 || keyCode === 32) {
    this.keyDownFlag = true; // if host element does not naturally trigger a click event on spacebar, we can force one to trigger here.
    // careful! if host already triggers click events naturally, we end up with a "double-click".

    if (keyCode === 32 && this.options.simulateSpacebarClick === true) {
      this.hostEl.click();
    }
  }
}
1325802
function handleKeyPress(e, obj) {
        if (! keyData.shift) {  
            keyData.shift = false; 
        }
        if (! keyData.alt) {    
            keyData.alt = false;
        }
        if (! keyData.ctrl) {
            keyData.ctrl = false;
        }

        // check held down modifying keys first
        if (e.shiftKey == keyData.shift && 
            e.altKey   == keyData.alt &&
            e.ctrlKey  == keyData.ctrl) { // if we pass this, all modifiers match
            
            var dataItem, keys = keyData.keys, key;

            if (YAHOO.lang.isArray(keys)) {
                for (var i=0;i<keys.length;i++) {
                    dataItem = keys[i];
                    key = Event.getCharCode(e);

                    if (dataItem == key) {
                        keyEvent.fire(key, e);
                        break;
                    }
                }
            } else {
                key = Event.getCharCode(e);
                if (keys == key ) {
                    keyEvent.fire(key, e);
                }
            }
        }
    }
346388
public boolean handleEvent(Event e) {

        switch (e.id) {

            case Event.SCROLL_LINE_UP :
            case Event.SCROLL_LINE_DOWN :
            case Event.SCROLL_PAGE_UP :
            case Event.SCROLL_PAGE_DOWN :
            case Event.SCROLL_ABSOLUTE :
                iX = sbHoriz.getValue();
                iY = iRowHeight * sbVert.getValue();

                repaint();

                return true;
        }

        return super.handleEvent(e);
    }
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();

                        }
                    }
                }
1291177
function (e) { 
                var e = e || window.event; 

                if (typeof callback === 'function') {
                    callback.call(ctx, e);
                }
            }
850112
function (e) {
                var keyCode = e.domEvent.keyCode;
                if (keyCode === 38 || keyCode === 40 || keyCode === 37 || keyCode === 39) {
                    var index = this.$currentSelectionIndex !== null ? this.$currentSelectionIndex : -1;
                    var indexOffset;
                    if (this.$.scrollDirection === SCROLL_DIRECTION_VERTICAL) {
                        indexOffset = this.$._cols;
                    } else {
                        indexOffset = this.$._rows;
                    }
                    switch (keyCode) {
                        case 38:
                            index -= this.$._cols;
                            break;
                        case 40:
                            index += this.$._cols;
                            break;
                        case 37:
                            index--;
                            break;
                        case 39:
                            index++;
                            break;
                        default:
                            void 0;
                    }
                    if (index < 0) {
                        index = 0;
                    }
                    if (this.$.$dataAdapter && index >= this.$.$dataAdapter.size()) {
                        index = this.$.$dataAdapter.size() - 1;
                    }
                    this._selectItem(index, e.domEvent.shiftKey, false);
                    e.preventDefault();
                    e.stopPropagation();
                }
            }
837248
function handleKeydown(originalEvent) {
    eventUtils.handleActionKeydown(originalEvent, () => {
        this.handleClick(originalEvent);
    });
    eventUtils.handleEscapeKeydown(originalEvent, () => {
        if (!this.state.disabled) {
            emitAndFire(this, 'button-escape', { originalEvent });
        }
    });
}