Internal method to handle the focus event
@protected
@param {aria.DomEvent} event Focus event
541889
function () {
            this._hasFocus = true;
            if (this._cfg) {
                if (this._cfg.validationEvent === 'onFocus'
                        && ((this._cfg.formatError && this._cfg.formatErrorMessages.length) || (this._cfg.error && this._cfg.errorMessages.length))) {
                    this._validationPopupShow();
                }
            }
            this._updateState();
        }
484012
function (event) {
            var inputField = this.getTextInputField();
            var blurredElement = event.target;

            if (blurredElement === inputField) {
                if (inputField.nextSibling != null && inputField.value === "") {
                    this._makeInputFieldLastChild();
                }
            } else if (blurredElement.parentNode.className.indexOf("highlight") != -1) {
                this.unhighlightOption(blurredElement.parentNode);
            }
            // call TextInput onblur handler with avoidCallback set to true
            this.$TextInput._dom_onblur.call(this, event, true);

            if (this._cfg.onblur) {
                // timeout is needed to retrieve (on every browser) the activeElement
                ariaCoreTimer.addCallback({
                    fn : function () {
                        var isAncestor = ariaUtilsDom.isAncestor;
                        var focusedEl = Aria.$window.document.activeElement;

                        // if onblur is defined and window lost focus ( ==null ) or if focus is not in the widget or
                        // dropdown element
                        if (this._cfg
                                && (focusedEl == null || ((this._dropdownPopup == null || !isAncestor(focusedEl, this._dropdownPopup.domElement)) && !isAncestor(focusedEl, this._domElt)))) {
                            this.evalCallback(this._cfg.onblur);
                        }
                    },
                    scope : this,
                    delay : 100
                });
            }
        }
1355822
function(event) {
      if(this.layer) {
         if(this.layer.focusedContainer && this.layer.focusedContainer != this) {
            this.layer.focusedContainer.removeFocus();
         }
         this.setFocus();
         this.layer.focusedContainer = this;
      }
   }
1221730
function (event) {
            this.$AutoComplete._dom_onclick.call(this, event);
            var element = event.target;
            if (element.className === "closeBtn") {
                this._removeMultiselectValue(element, event);
                this._textInputField.focus();
            }
            if (element.className.indexOf("xMultiAutoComplete_Option_Text") != -1) {
                var highlightedSuggestions = this.getHighlight();
                var index = this._getIndexFromNode(element.parentNode);
                if (this.controller.freeText && ariaUtilsJson.equals(highlightedSuggestions, [index])) {
                    this._editMultiselectValue(element);
                } else {
                    this.highlightOption(index);
                }
            }
            this.__resizeInput();
        }
576094
function(event_name, event_object) {

		if (this._focused_element != event_object.target) {
			this._setTarget(null);
			this._focused_element = event_object.target;
		}

	}
1061363
function(event) {
    var inputs = $(event.target).parents("form").eq(0).find(":input:visible");
    var inputIndex = inputs.index(event.target);
    // If at end of focusable elements return false, if not move forward one.
    if (inputIndex == inputs.length - 1) {
      // return false on last form input so we know to let the form submit.
      return false
    } else {inputs[inputIndex + 1].focus();}
  }
1271322
function handleKeyEvent() {
        if (!$dropdown) {
            if (!SidebarView.isVisible()) {
                SidebarView.show();
            }

            $("#project-dropdown-toggle").trigger("click");

            $dropdown.focus();
            $links = $dropdown.find("a");
            // By default, select the most recent project (which is at the top of the list underneath Open Folder),
            // but if there are none, select Open Folder instead.
            $dropdownItem = $links.eq($links.length > 1 ? 1 : 0);
            $dropdownItem.addClass("selected");

            // If focusing the dropdown caused a modal bar to close, we need to refocus the dropdown
            window.setTimeout(function () {
                $dropdown.focus();
            }, 0);
        }
    }
1011451
function enter(aria) {
        aria = aria || {};
        focusedControl.fire('click', { target: focusedElement, aria: aria });
      }
1345369
protected void keyEvent(final KeyEvent event) {
		try {
			if (event.getID() == KeyEvent.KEY_PRESSED && event.getKeyCode() == KeyEvent.VK_ENTER
					&& isEditable()) {
				// voir aussi focusEvent
				setValue(getValue());
			}
		} catch (final Exception e) {
			beep();
		}
	}
1043665
function(input, eventType) {
		// We'd like to prevent autocomplete on the input datalist field
		input.setAttribute('autocomplete', 'off');

		// WAI ARIA attributes
		input.setAttribute('role', 'textbox');
		input.setAttribute('aria-haspopup', 'true');
		input.setAttribute('aria-autocomplete', 'list');
		input.setAttribute('aria-owns', input.getAttribute('list'));

		// Bind the keyup event on the related datalists input
		if (eventType === 'focusin') {
			input.addEventListener('keyup', inputInputList);

			input.addEventListener('focusout', changesInputList, true);

			// As only EDGE doesn't trigger the input event after selecting an item via mouse, we need to differentiate here
			if (isGteIE10 || (isEDGE && input.type === 'text')) {
				input.addEventListener('input', inputInputListIE);
			}
		} else if (eventType === 'blur') {
			input.removeEventListener('keyup', inputInputList);

			input.removeEventListener('focusout', changesInputList, true);

			// As only EDGE doesn't trigger the input event after selecting an item via mouse, we need to differentiate here
			if (isGteIE10 || (isEDGE && input.type === 'text')) {
				input.removeEventListener('input', inputInputListIE);
			}
		}

		// Add class for identifying that this input is even already being polyfilled
		input.className += ' ' + classNameInput;
	}
1105642
def on_focusout(self, event, a):
		
		if event.widget.get() == '':
			event.widget.insert(0, default_text[a])
			event.widget.config(fg = 'grey')
590837
function (domEvt) {
            if (this._cfg.blurBeforeAction) {
                var document = Aria.$window.document;
                var activeElement = document.activeElement;
                this.getDom(); // makes sure _focusElt is defined
                if (activeElement && activeElement !== document.body && activeElement !== this._focusElt) {
                    activeElement.blur();
                    var self = this;
                    setTimeout(function () {
                        // executes the action a bit later, when the blur has been fully taken into account
                        // (especially by IE)
                        self._performAction(domEvt);
                    });
                    return true;
                }
            }
            return this.$ActionWidget._performAction.call(this, domEvt);
        }
350708
function onFocus(cm) {
    if (cm.options.readOnly == "nocursor") return;
    if (!cm.state.focused) {
      signal(cm, "focus", cm);
      cm.state.focused = true;
      addClass(cm.display.wrapper, "CodeMirror-focused");
      // The prevInput test prevents this from firing when a context
      // menu is closed (since the resetInput would kill the
      // select-all detection hack)
      if (!cm.curOp && cm.display.selForContextMenu != cm.doc.sel) {
        resetInput(cm);
        if (webkit) setTimeout(bind(resetInput, cm, true), 0); // Issue #1730
      }
    }
    slowPoll(cm);
    restartBlink(cm);
  }
1031477
function SearchBox_requestingFocusOnKeyboardInputHandler() {
                    this._fireEvent(EventName.receivingfocusonkeyboardinput, null);
                    if (_Global.document.activeElement !== this._inputElement) {
                        try {
                            this._inputElement.focus();
                        } catch (e) {
                        }
                    }
                }
380140
def focusInEvent(self, event):
        
        if not self.signalsBlocked():
            self.focusChanged.emit(True)
            self.focusEntered.emit()
        
        return super(XTextEdit, self).focusInEvent(event)
793234
function (event) {
            this.$Widget._dom_onmouseleave.call(this, event);
            if (this._ellipsis && this._ellipsis.ellipsesNeeded) {
                if (this._hasFocus === false && this._hasMouseOver === true) {
                    this._hasMouseOver = false;
                    this._ellipsis._hideFullText(event.relatedTarget);
                }
            }
        }
936622
function() {
		var that = this,
			opts = this.options,
			tree = this.tree,
			ns = tree._ns
			// selstartEvent = ( $.support.selectstart ? "selectstart" : "mousedown" )
			;

		// Remove all previuous handlers for this tree
		this._unbind();

		//alert("keydown" + ns + "foc=" + tree.hasFocus() + tree.$container);
		// tree.debug("bind events; container: ", tree.$container);
		tree.$container.on("focusin" + ns + " focusout" + ns, function(event){
			var node = FT.getNode(event),
				flag = (event.type === "focusin");
			// tree.debug("Tree container got event " + event.type, node, event);
			// tree.treeOnFocusInOut.call(tree, event);
			if(node){
				// For example clicking into an <input> that is part of a node
				tree._callHook("nodeSetFocus", node, flag);
			}else{
				tree._callHook("treeSetFocus", tree, flag);
			}
		}).on("selectstart" + ns, "span.fancytree-title", function(event){
			// prevent mouse-drags to select text ranges
			// tree.debug("<span title> got event " + event.type);
			event.preventDefault();
		}).on("keydown" + ns, function(event){
			// TODO: also bind keyup and keypress
			// tree.debug("got event " + event.type + ", hasFocus:" + tree.hasFocus());
			// if(opts.disabled || opts.keyboard === false || !tree.hasFocus() ){
			if(opts.disabled || opts.keyboard === false ){
				return true;
			}
			var res,
				node = tree.focusNode, // node may be null
				ctx = tree._makeHookContext(node || tree, event),
				prevPhase = tree.phase;

			try {
				tree.phase = "userEvent";
				// If a 'fancytreekeydown' handler returns false, skip the default
				// handling (implemented by tree.nodeKeydown()).
				if(node){
					res = tree._triggerNodeEvent("keydown", node, event);
				}else{
					res = tree._triggerTreeEvent("keydown", event);
				}
				if ( res === "preventNav" ){
					res = true; // prevent keyboard navigation, but don't prevent default handling of embedded input controls
				} else if ( res !== false ){
					res = tree._callHook("nodeKeydown", ctx);
				}
				return res;
			} finally {
				tree.phase = prevPhase;
			}
		}).on("click" + ns + " dblclick" + ns, function(event){
			if(opts.disabled){
				return true;
			}
			var ctx,
				et = FT.getEventTarget(event),
				node = et.node,
				tree = that.tree,
				prevPhase = tree.phase;

			if( !node ){
				return true;  // Allow bubbling of other events
			}
			ctx = tree._makeHookContext(node, event);
//			that.tree.debug("event(" + event.type + "): node: ", node);
			try {
				tree.phase = "userEvent";
				switch(event.type) {
				case "click":
					ctx.targetType = et.type;
					return ( tree._triggerNodeEvent("click", ctx, event) === false ) ? false : tree._callHook("nodeClick", ctx);
				case "dblclick":
					ctx.targetType = et.type;
					return ( tree._triggerNodeEvent("dblclick", ctx, event) === false ) ? false : tree._callHook("nodeDblclick", ctx);
				}
//             } catch(e) {
// //                var _ = null; // DT issue 117 // TODO
//                 $.error(e);
			} finally {
				tree.phase = prevPhase;
			}
		});
	}